Skip to main content
Glama

greet

Generate personalized greetings tailored to individual names and desired politeness levels. Perfect for client-server interactions showcasing TypeScript integration.

Instructions

Generates a personalized greeting.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesThe name of the person to greet.
politenessNoDesired politeness level.informal

Implementation Reference

  • The asynchronous handler function that implements the core logic of the 'greet' tool. It generates a personalized greeting based on the provided name and optional politeness level (formal or informal).
    async ({ name, politeness }) => {
        console.error(`Executing greet tool for: ${name}, Politeness: ${politeness}`);
        let greeting = "";
        if (politeness === "formal") {
            greeting = `Esteemed greetings to you, ${name}. It is a pleasure.`;
        } else {
            greeting = `Hey ${name}! What's up?`;
        }
        return {
            content: [{ type: "text", text: greeting }],
        };
    }
  • The input schema for the 'greet' tool, defining parameters 'name' (required string) and 'politeness' (optional enum: formal/informal, defaults to informal). Uses Zod for validation.
    {
        name: z.string().describe("The name of the person to greet."),
        politeness: z.enum(["formal", "informal"]).optional().default("informal").describe("Desired politeness level."),
    },
  • src/index.ts:24-43 (registration)
    The registration of the 'greet' tool on the MCP server using server.tool(), including name, description, input schema, and handler function.
    server.tool(
        "greet",
        "Generates a personalized greeting.",
        {
            name: z.string().describe("The name of the person to greet."),
            politeness: z.enum(["formal", "informal"]).optional().default("informal").describe("Desired politeness level."),
        },
        async ({ name, politeness }) => {
            console.error(`Executing greet tool for: ${name}, Politeness: ${politeness}`);
            let greeting = "";
            if (politeness === "formal") {
                greeting = `Esteemed greetings to you, ${name}. It is a pleasure.`;
            } else {
                greeting = `Hey ${name}! What's up?`;
            }
            return {
                content: [{ type: "text", text: greeting }],
            };
        }
    );
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'personalized greeting' but doesn't explain what that entails (e.g., format, length, language), whether it's idempotent, or any side effects. This leaves significant gaps in understanding the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with a single sentence that directly states the tool's purpose. There is no wasted language, and it is front-loaded with the essential information, making it efficient and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (2 parameters, no output schema, no annotations), the description is minimally adequate. However, it lacks details on the greeting format or any behavioral context, which would be helpful for an agent to use it effectively, especially without annotations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, so the schema already fully documents both parameters (name and politeness). The description adds no additional meaning beyond what the schema provides, such as examples or edge cases, meeting the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Generates') and resource ('a personalized greeting'), making it immediately understandable. However, since there are no sibling tools, it doesn't need to differentiate from alternatives, which prevents a perfect score of 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives, prerequisites, or any contextual constraints. It simply states what the tool does without offering usage instructions or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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/sanketshinde3001/MCP'

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