{"record":{"id":"d00abb964ac0e38c","repo":"PrefectHQ/fastmcp","slug":"unknown-tool-name-r-d00abb","errorCode":null,"errorMessage":"Unknown tool: {name!r}","messagePattern":"Unknown tool: (.+?)","errorType":"exception","errorClass":"NotFoundError","httpStatus":null,"severity":"error","filePath":"fastmcp_slim/fastmcp/server/transforms/search/base.py","lineNumber":250,"sourceCode":"                dict[str, Any] | None, \"Arguments to pass to the tool\"\n            ] = None,\n            ctx: Context = None,  # type: ignore[assignment]  # ty:ignore[invalid-parameter-default]\n        ) -> ToolResult:\n            \"\"\"Call a tool by name with the given arguments.\n\n            Use this to execute tools discovered via search_tools.\n            \"\"\"\n            if name in {transform._call_tool_name, transform._search_tool_name}:\n                raise ValueError(\n                    f\"'{name}' is a synthetic search tool and cannot be called via the call_tool proxy\"\n                )\n            # The name comes from the model, so this proxy is a second way\n            # into the server that no host mediates. It may reach only what\n            # the model was allowed to discover.\n            if not any(\n                tool.name == name for tool in await transform.get_tool_catalog(ctx)\n            ):\n                raise NotFoundError(f\"Unknown tool: {name!r}\")\n            return await ctx.fastmcp.call_tool(name, arguments)\n\n        return Tool.from_function(fn=call_tool, name=self._call_tool_name)\n\n    # ------------------------------------------------------------------\n    # Serialization\n    # ------------------------------------------------------------------\n\n    async def _render_results(self, tools: Sequence[Tool]) -> Any:\n        return await _invoke_serializer(self._search_result_serializer, tools)\n\n    # ------------------------------------------------------------------\n    # Catalog access\n    # ------------------------------------------------------------------\n\n    async def _get_visible_tools(self, ctx: Context) -> Sequence[Tool]:\n        \"\"\"Get the auth-filtered tool catalog, excluding pinned tools.\"\"\"\n        tools = await self.get_tool_catalog(ctx)","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/PrefectHQ/fastmcp/blob/1f021142978e0861cd910c8df4e8074bc7cf3978/fastmcp_slim/fastmcp/server/transforms/search/base.py#L232-L268","documentation":"The call_tool proxy created by the search transform only reaches tools the model was allowed to discover; if the requested name is not present in the current tool catalog, it raises NotFoundError('Unknown tool: {name!r}') rather than forwarding to the server. This prevents the proxy from being an unmediated second entry point.","triggerScenarios":"Calling the proxy with a tool name that doesn't exist, was renamed, is filtered out by visibility/auth, or wasn't returned by search_tools' catalog.","commonSituations":"Stale tool name from a previous session/catalog; hallucinated tool name from an LLM; tool hidden by middleware visibility rules.","solutions":["Call search_tools first and use an exact name from its results","Check the tool exists and is visible to the current user/middleware","Fix the tool name typo or register the missing tool on the server"],"exampleFix":"// before\nawait call_tool(\"summarize_doc\", {...})  # never discovered\n// after\ncatalog = await search_tools(\"summarize documents\")\nawait call_tool(catalog[0].name, {...})","handlingStrategy":"try-catch","validationCode":"catalog = await transform.get_tool_catalog(ctx)\nif not any(t.name == name for t in catalog):\n    raise LookupError(f\"{name!r} not discoverable; call search_tools first\")","typeGuard":null,"tryCatchPattern":"try:\n    result = await call_tool(name, args)\nexcept NotFoundError:\n    results = await search_tools(name.replace('_', ' '))\n    # retry with a discovered exact name","preventionTips":["Always discover tools via search_tools before proxy calls","Use exact catalog names, not memory or LLM guesses","Verify the tool isn't hidden by visibility/auth middleware","Handle NotFoundError by re-running discovery"],"tags":["python","search","tools","not-found"],"backgroundTag":"unknown-tool","analyzedSha":"1f021142978e0861cd910c8df4e8074bc7cf3978","analyzedAt":"2026-08-29T14:31:16.082Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}