hello
Generate personalized greetings by providing a name. This tool creates custom hello messages for use in applications and demonstrations.
Instructions
A simple greeting tool that says hello
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The name to greet |
Input Schema (JSON Schema)
{
"properties": {
"name": {
"description": "The name to greet",
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
}
Implementation Reference
- src/index.ts:88-98 (handler)Handler for the 'hello' tool in the main fast-mcp-demo server. Responds with a greeting message.if (name === "hello") { const userName = (args?.name as string) || "World"; return { content: [ { type: "text", text: `Hello, ${userName}! Welcome to MCP!`, }, ], }; }
- src/index.ts:43-56 (schema)Schema and registration for the 'hello' tool returned in ListToolsRequestHandler.{ name: "hello", description: "A simple greeting tool that says hello", inputSchema: { type: "object", properties: { name: { type: "string", description: "The name to greet", }, }, required: ["name"], }, },
- src/basic-mcp/server.ts:86-96 (handler)Handler for the 'hello' tool in the basic-mcp server implementation.if (name === "hello") { const userName = (args?.name as string) || "World"; return { content: [ { type: "text", text: `Hello, ${userName}! Welcome to MCP!`, }, ], }; }
- src/fastmcp-example/server.ts:19-28 (handler)Full registration, schema (using Zod), and inline handler for the 'hello' tool using FastMCP framework.server.addTool({ name: "hello", description: "A simple greeting tool that says hello", parameters: z.object({ name: z.string().describe("The name to greet"), }), execute: async (args) => { return `Hello, ${args.name}! Welcome to MCP!`; }, });