hello_world
Generate a greeting message by providing a name input. This tool demonstrates basic functionality for building MCP servers.
Instructions
A simple hello world tool
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name to greet |
Implementation Reference
- src/server.ts:105-115 (handler)The handleHelloWorld method implements the core logic for the 'hello_world' tool, extracting the 'name' from args and returning a formatted greeting message.private handleHelloWorld(args: any) { const name = args.name as string return { content: [ { type: 'text', text: `Hello, ${name}! Welcome to the Bootstrap MCP Server.`, }, ], } }
- src/server.ts:13-26 (schema)The ToolSchema definition for 'hello_world', including name, description, and inputSchema requiring a 'name' string property.{ name: 'hello_world', description: 'A simple hello world tool', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Name to greet', }, }, required: ['name'], }, },
- src/server.ts:82-83 (registration)The switch case in the CallToolRequestSchema handler that registers and dispatches 'hello_world' tool calls to the handleHelloWorld method.case 'hello_world': return this.handleHelloWorld(args)
- src/server.ts:72-74 (registration)The ListToolsRequestSchema handler that registers the list of tools, including 'hello_world' via the TOOLS array.this.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS, }))