Skip to main content
Glama
hsiangjenli

Python MCP Template

by hsiangjenli

new_endpoint

Generate a personalized welcome message by providing a name. This tool returns a JSON response with a greeting message or validation error details.

Instructions

New Endpoint

Responses:

  • 200 (Success): Successful Response

    • Content-Type: application/json

    • Response Properties:

      • message: A welcome message.

    • Example:

{
  "message": "Hello, world!"
}
  • 422: Validation Error

    • Content-Type: application/json

    • Response Properties:

    • Example:

{
  "detail": [
    "unknown_type"
  ]
}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesThe name to include in the message.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYesA welcome message.

Implementation Reference

  • The handler function for the "new_endpoint" MCP tool. It receives a NewEndpointRequest with a 'name' field and returns a greeting message in NewEndpointResponse format.
    async def new_endpoint(request: NewEndpointRequest):
        return {"message": f"Hello, {request.name}!"}
  • FastAPI route decorator that registers the new_endpoint handler as an MCP tool using operation_id="new_endpoint". FastMCP.from_fastapi will expose this as an MCP tool.
    @app.post(
        "/new/endpoint/", operation_id="new_endpoint", response_model=NewEndpointResponse
    )
  • Pydantic input schema (NewEndpointRequest) for the new_endpoint tool, defining the 'name' parameter.
    class NewEndpointRequest(BaseModel):
        name: str = Field(
            ..., description="The name to include in the message.", examples=["developer"]
        )
  • Pydantic output schema (NewEndpointResponse) for the new_endpoint tool, defining the 'message' response.
    class NewEndpointResponse(BaseModel):
        message: str = Field(..., description="A welcome message.", examples=["Hello, world!"])
  • Identical handler function for the "new_endpoint" tool in the HTTP-optimized main file.
    async def new_endpoint(request: NewEndpointRequest):
        return {"message": f"Hello, {request.name}!"}
Behavior2/5

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

With no annotations provided, the description carries full burden but provides minimal behavioral information. It documents response formats for success (200) and validation error (422) cases, which gives some insight into possible outcomes, but doesn't describe what the tool actually does, whether it's read-only or mutative, authentication requirements, rate limits, or other behavioral characteristics.

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

Conciseness2/5

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

The description is poorly structured - it leads with a tautological title, then dives into response format details without first explaining the tool's purpose. While not excessively verbose, the content is misprioritized and doesn't efficiently communicate essential information. The response documentation could be useful but comes before establishing basic understanding.

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

Completeness2/5

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

For a tool with 1 parameter, 100% schema coverage, and an output schema, the description is incomplete. It documents response formats but fails to explain what the tool does, its purpose, or when to use it. The presence of an output schema means return values are documented elsewhere, but the description should still provide context about the tool's function and behavior.

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%, so the schema already fully documents the single 'name' parameter. The description adds no parameter information beyond what's in the schema - it doesn't explain how the name parameter affects the response or provide additional context about parameter usage. Baseline 3 is appropriate when schema does all the work.

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

Purpose1/5

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

The description is tautological - 'New Endpoint' restates the tool name without explaining what it does. It provides no verb or resource specification, no indication of functionality, and fails to distinguish from siblings (though none exist). The description focuses entirely on response formats rather than the tool's purpose.

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

Usage Guidelines1/5

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

No guidance is provided about when to use this tool. The description contains only response documentation with no context about appropriate use cases, prerequisites, or alternatives. There's no mention of when this tool should be invoked versus other approaches.

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/hsiangjenli/mcp-slidev'

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