Skip to content

Conditionally Add Tools to an MCP #556

Open
@LonnieMiddleton-Inhabit

Description

Is your feature request related to a problem? Please describe.

I am currently building a read-only agent. It would be helpful if I could specify that a tool is not added to the MCP under certain conditions. For example, if a command-line argument read-only is true, don't add tools that write. This is more useful than disabling the tool because Cursor (and probably other environments) has a limit of 40 tools across all MCPs.

Describe the solution you'd like

I would like a means to specify a condition under which a tool is added (or is not added) to the MCP. This could be a parameter on the decorator, or something else.

Describe alternatives you've considered

It is currently possible to disable a tool, or to simply not call a tool, but this does not solve the issue of some environments having a limit on the number of tools registered.

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions