my_tool
Extend AI application functionality in Claude Desktop using modular tools without modifying core code. Configure custom parameters to add specific capabilities.
Instructions
自定义工具
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"param": "<param>"
},
"name": "my_tool"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| param | Yes |
Implementation Reference
- modules/my_module/my_module.py:18-21 (handler)The handler implementation for the 'my_tool' tool, decorated with @server.tool() which also handles registration. It takes a string parameter and returns a formatted processing message.
@server.tool() def my_tool(param: str) -> str: """自定义工具""" return f"处理参数: {param}" - modules/my_module/my_module.py:18-18 (registration)The @server.tool() decorator registers the my_tool function in the module's register method.
@server.tool() - modules/my_module/my_module.py:19-19 (schema)The function signature defines the input schema (param: str) and output type (str) for the my_tool.
def my_tool(param: str) -> str: