Skip to main content
Glama
igs-pochenkuo

SouthAsia MCP Tool

mcp_hello_world

Demonstrates how to create and integrate custom tools using the Model Control Protocol framework by returning a greeting message.

Instructions

A simple demonstration tool that returns a greeting message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
random_stringYesDummy parameter for no-parameter tools

Implementation Reference

  • The handler logic for the 'mcp_hello_world' tool. It returns a TextContent object with a greeting message when the tool is called.
    if name == "mcp_hello_world":
        return [
            types.TextContent(
                type="text",
                text="Hello World! 這是您的第一個 mcp 工具!"
            )
        ]
  • The input schema for the 'mcp_hello_world' tool, defining a required dummy 'random_string' parameter.
    inputSchema={
        "type": "object",
        "properties": {
            "random_string": {
                "type": "string",
                "description": "Dummy parameter for no-parameter tools"
            }
        },
        "required": ["random_string"],
    },
  • The registration of the 'mcp_hello_world' tool object in the handle_list_tools function, which includes the name, description, and input schema.
    types.Tool(
        name="mcp_hello_world",
        description="A simple demonstration tool that returns a greeting message",
        inputSchema={
            "type": "object",
            "properties": {
                "random_string": {
                    "type": "string",
                    "description": "Dummy parameter for no-parameter tools"
                }
            },
            "required": ["random_string"],
        },
    ),
  • Registration of the hello_world handlers (including mcp_hello_world) in the HANDLERS list, matched by prefix 'mcp_hello'.
    HANDLERS = [
        {
            "prefixes": ["mcp_hello"],
            "list_tools": hello_world_list_tools,
            "call_tool": hello_world_call_tool
        }
    ]
  • Top-level registration of the combined list_tools and call_tool handlers on the MCP server instance.
    # 註冊工具列表處理器
    server.list_tools()(combined_list_tools)
    
    # 註冊工具調用處理器
    server.call_tool()(combined_call_tool)
Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/igs-pochenkuo/southasia_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server