hello
Generate personalized greetings by inputting a name to receive a customized hello message from the HelloWorld MCP Server.
Instructions
Say hello to someone
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "hello"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | The name of the person to greet | World |
Implementation Reference
- src/index.ts:69-79 (handler)Handler logic for the 'hello' tool, extracting the name parameter and returning a greeting text response.
case 'hello': { const targetName = (args as { name?: string }).name || 'World'; return { content: [ { type: 'text', text: `Hello, ${targetName}! 👋 Welcome to the HelloWorld MCP server!`, }, ], }; } - src/index.ts:28-41 (schema)Input schema and metadata for the 'hello' tool, defined in the ListTools response.
{ name: 'hello', description: 'Say hello to someone', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'The name of the person to greet', default: 'World', }, }, }, }, - src/index.ts:25-62 (registration)Registration of tools including 'hello' via the ListToolsRequestHandler.
server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ { name: 'hello', description: 'Say hello to someone', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'The name of the person to greet', default: 'World', }, }, }, }, { name: 'add', description: 'Add two numbers together', inputSchema: { type: 'object', properties: { a: { type: 'number', description: 'First number', }, b: { type: 'number', description: 'Second number', }, }, required: ['a', 'b'], }, }, ], }; });