Skip to main content
Glama

greet

Read-only

Generate a Hello World greeting message with optional name personalization using this PyMCP server template tool.

Instructions

Greet the caller with a quintessential Hello World message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoThe optional name to be greeted.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Implementation of the 'greet' tool handler. Accepts an optional 'name' parameter and returns a greeting message, with logging via context.
    async def greet(
        self,
        ctx: Context,
        name: Annotated[
            str | None,
            Field(
                default=None,
                description="The optional name to be greeted.",
                validate_default=False,
            ),
        ] = None,
    ) -> str:
        """Greet the caller with a quintessential Hello World message."""
        welcome_message = f"Welcome to the {PACKAGE_NAME} {package_version} server! The current date time in UTC is {datetime.now(UTC).isoformat()}. This response may be cached."
        response: str = ""
        if name is None or name.strip() == "":
            await ctx.warning("No name provided, using default greeting.")
            response = f"Hello World! {welcome_message}"
        else:
            await ctx.info(f"Greeting {name}.")
            response = f"Hello, {name}! {welcome_message}"
        return response
  • Registration entry for the 'greet' tool in the PyMCP class tools list, including tags and annotations.
    {
        "fn": "greet",
        "tags": ["greeting", "example"],
        "annotations": {"readOnlyHint": True},
    },
  • Pydantic schema definition for the 'name' input parameter of the greet tool, including description and default.
    name: Annotated[
        str | None,
        Field(
            default=None,
            description="The optional name to be greeted.",
            validate_default=False,
        ),
    ] = None,
Behavior3/5

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

Annotations indicate readOnlyHint=true, and the description's 'Greet' action aligns with a safe read operation, so there's no contradiction. However, the description adds minimal behavioral context beyond annotations—it doesn't explain output format, rate limits, or other traits, relying on the output schema for details.

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 a single, efficient sentence that directly states the tool's function without unnecessary words. It's front-loaded and earns its place by clearly conveying the core action.

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

Completeness4/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, one parameter, and the presence of an output schema, the description is reasonably complete. It covers the basic purpose, though it lacks usage guidelines and deeper behavioral insights, which are less critical for such a simple tool.

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?

Schema description coverage is 100%, with the parameter 'name' documented as optional. The description implies greeting a 'caller' but doesn't add meaning beyond the schema, such as default behavior if name is null. Baseline 3 is appropriate as the schema handles parameter documentation adequately.

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 action ('Greet the caller') and the resource ('Hello World message'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'pirate_summary' or 'text_web_search', which are unrelated greeting functions, so it doesn't fully distinguish itself in context.

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. It doesn't mention any specific contexts, prerequisites, or exclusions, leaving the agent to infer usage based on the tool name alone.

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

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/anirbanbasu/pymcp'

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