greet
Generate personalized greetings by providing a name. Use this MCPKit tool to create custom welcome messages for users or applications.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes |
Implementation Reference
- examples/greet.ts:17-26 (handler)The async execute function that handles the 'greet' tool call, receiving a 'name' parameter and returning a text-based greeting response.execute: async ({ name }) => { return { content: [ { type: 'text', text: `Hello, ${name}! Nice to meet you.`, // Returns a personalized greeting }, ], }; },
- examples/greet.ts:12-14 (schema)Zod schema defining the input parameters for the 'greet' tool, specifically a required 'name' string.parameters: { name: z.string(), // Expects a string input named 'name' },
- examples/greet.ts:30-30 (registration)Registers the 'greet' tool object with the MCP server.server.tool(tool);
- examples/greet-class.ts:23-32 (handler)The class-based execute method that implements the 'greet' tool logic, similar to the functional version.public async execute({ name }: z.infer<ZodObject<typeof this.parameters>>) { return { content: [ { type: 'text', text: `Hello, ${name}! Nice to meet you.`, }, ], }; }
- examples/greet-class.ts:4-6 (schema)Zod schema defining the input parameters for the class-based 'greet' tool.const parameters = { name: z.string().describe('The name is required'), };
- examples/greet-class.ts:42-42 (registration)Registers the GreetTool class instance with the MCP server.server.tool(greetTool);