mcp_hello_name
Generate personalized greetings by entering your name. This tool creates custom welcome messages for users interacting with the MCP framework.
Instructions
A demonstration tool that greets you by name
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Your name |
Implementation Reference
- The core handler logic for the 'mcp_hello_name' tool. It extracts the user's name from the arguments, validates its presence, and returns a personalized greeting message as TextContent.elif name == "mcp_hello_name": user_name = arguments.get("name") if not user_name: raise ValueError("缺少名字參數") return [ types.TextContent( type="text", text=f"Hello {user_name}! 很高興見到您!" ) ]
- The JSON schema definition for the 'mcp_hello_name' tool, specifying the required 'name' string parameter.types.Tool( name="mcp_hello_name", description="A demonstration tool that greets you by name", inputSchema={ "type": "object", "properties": { "name": { "type": "string", "description": "Your name" } }, "required": ["name"], }, ),
- src/southasia/server.py:31-37 (registration)Registration of the hello_world handler module in the HANDLERS list using prefix 'mcp_hello', which routes tool calls for 'mcp_hello_name' to the appropriate list_tools and call_tool functions in hello_world.py.HANDLERS = [ { "prefixes": ["mcp_hello"], "list_tools": hello_world_list_tools, "call_tool": hello_world_call_tool } ]