You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The actual inputSchema is missing based on the fact that there are 2 types of Tool obejcts, the internal server implementation and the protocol one usually imported as MCPTool. Have you chekced both tools structures?
in fastmcp.tools.base
classTool(BaseModel):
"""Internal tool registration info."""fn: Callable[..., Any] =Field(exclude=True)
name: str=Field(description="Name of the tool")
description: str=Field(description="Description of what the tool does")
parameters: dict[str, Any] =Field(description="JSON schema for tool parameters")
fn_metadata: FuncMetadata=Field(
description="Metadata about the function including a pydantic model for tool"" arguments"
)
is_async: bool=Field(description="Whether the tool is async")
context_kwarg: str|None=Field(
None, description="Name of the kwarg that should receive context"
)
annotations: ToolAnnotations|None=Field(
None, description="Optional annotations for the tool"
)
in types
# types.pyclassTool(BaseModel):
"""Definition for a tool the client can call."""name: str"""The name of the tool."""description: str|None=None"""A human-readable description of the tool."""inputSchema: dict[str, Any]
"""A JSON Schema object defining the expected parameters for the tool."""annotations: ToolAnnotations|None=None"""Optional additional tool information."""model_config=ConfigDict(extra="allow")
I know nothing about nothing but allowing for inputSchema would require extra validation with respect to the automatically introspective build of parameters that precisely holds that info.
Describe the bug
It's more an inconsistence than a bug but there is no "inputSchema" field in mcp.tool decorator while it's available in Tool
To Reproduce
@mcp.tool(
name="Name",
description=(
"description"
),
inputSchema = {}
)
Expected behavior
Add of mcp tool to mcp server
Current behavior
TypeError: FastMCP.tool() got an unexpected keyword argument 'inputSchema'
The text was updated successfully, but these errors were encountered: