Skip to main content
Glama
sayedpfe

MCP & Copilot Studio Learning Project

by sayedpfe

greeting

Generate customized greetings tailored to individual names and preferred styles (formal, casual, enthusiastic)

Instructions

Create personalized greetings

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the person to greet
styleNoStyle of greeting

Implementation Reference

  • Handler function that generates a personalized greeting based on the provided name and style (formal, casual, or enthusiastic), returning it as MCP content.
    async ({ name, style = "casual" }) => { let greeting; switch (style) { case "formal": greeting = `Good day, ${name}. I hope you're having a pleasant experience.`; break; case "enthusiastic": greeting = `HEY THERE ${name.toUpperCase()}! 🎉 You're AWESOME!`; break; default: // casual greeting = `Hey ${name}! Nice to meet you! 👋`; } return { content: [{ type: "text", text: greeting }] }; }
  • Zod schema defining the input parameters for the greeting tool: required 'name' string and optional 'style' enum.
    { name: z.string().describe("Name of the person to greet"), style: z.enum(["formal", "casual", "enthusiastic"]).optional().describe("Style of greeting"), },
  • src/index.ts:27-55 (registration)
    Registration of the 'greeting' tool on the MCP server, including name, description, schema, and handler function.
    server.tool( "greeting", "Create personalized greetings", { name: z.string().describe("Name of the person to greet"), style: z.enum(["formal", "casual", "enthusiastic"]).optional().describe("Style of greeting"), }, async ({ name, style = "casual" }) => { let greeting; switch (style) { case "formal": greeting = `Good day, ${name}. I hope you're having a pleasant experience.`; break; case "enthusiastic": greeting = `HEY THERE ${name.toUpperCase()}! 🎉 You're AWESOME!`; break; default: // casual greeting = `Hey ${name}! Nice to meet you! 👋`; } return { content: [{ type: "text", text: greeting }] }; } );

Other Tools

Related 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/sayedpfe/MCP'

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