Skip to content

Specific ToolNotFoundError for easier handling than ToolError in multi-tenant environments #2422

@DevonFulcher

Description

@DevonFulcher

Description

We are running a remote MCP server and we are seeing errors like:

mcp.server.fastmcp.exceptions.ToolError: Unknown tool: <unknown-tool-name>

I'm unsure why our users are trying to call our remote MCP server with the name of a tool that we don't manage. Regardless, we would like to handle these errors separately from a generic ToolError. For instance:

  • ToolNotFoundError: user error that shouldn't alert us.
  • ToolError: an error that could indicate an actual issue with our system that we should alert on and fix.

References

I couldn't find any issues related to this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Nice to haves, rare edge casesenhancementRequest for a new feature that's not currently supportedneeds decisionIssue is actionable, needs maintainer decision on whether to implement

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions