-
Notifications
You must be signed in to change notification settings - Fork 561
Open
Labels
bugSomething isn't workingSomething isn't working
Description
The docstring of the tool shows that a TypedDict can be inserted as input_schema for declared functions inputted into an MCP server, this is from claude_code_sdk/init.py:
def tool(
name: str, description: str, input_schema: type | dict[str, Any]
) -> Callable[[Callable[[Any], Awaitable[dict[str, Any]]]], SdkMcpTool[Any]]:
"""Decorator for defining MCP tools with type safety.
Creates a tool that can be used with SDK MCP servers. The tool runs
in-process within your Python application, providing better performance
than external MCP servers.
Args:
name: Unique identifier for the tool. This is what Claude will use
to reference the tool in function calls.
description: Human-readable description of what the tool does.
This helps Claude understand when to use the tool.
input_schema: Schema defining the tool's input parameters.
Can be either:
- A dictionary mapping parameter names to types (e.g., {"text": str})
- A **TypedDict** class for more complex schemas
- A JSON Schema dictionary for full validation
But then inserting a TypedDict, Claude Code cannot see any params.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working