Skip to main content
Glama
v4lheru

generic-mcp-server

get-weather

Retrieve weather forecast data for a specified city to check current conditions and upcoming weather patterns.

Instructions

Get weather forecast for a city

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cityYesThe city name

Implementation Reference

  • The handler function that executes the get-weather tool logic, generating a mock weather forecast for the given city.
    handler: async ({ city }: { city: string }) => {
        // Mock implementation
        const weather = ["Sunny", "Cloudy", "Rainy"][Math.floor(Math.random() * 3)];
        return {
            content: [
                {
                    type: "text" as const,
                    text: `The weather in ${city} is ${weather}`,
                },
            ],
        };
    },
  • The Zod input schema defining the 'city' parameter for the get-weather tool.
    inputSchema: z.object({
        city: z.string().describe("The city name"),
    }),
  • src/tools.ts:21-38 (registration)
    The get-weather tool is registered in the TOOLS object exported from tools.ts, which is used by the MCP server for listing and calling tools.
    "get-weather": {
        description: "Get weather forecast for a city",
        inputSchema: z.object({
            city: z.string().describe("The city name"),
        }),
        handler: async ({ city }: { city: string }) => {
            // Mock implementation
            const weather = ["Sunny", "Cloudy", "Rainy"][Math.floor(Math.random() * 3)];
            return {
                content: [
                    {
                        type: "text" as const,
                        text: `The weather in ${city} is ${weather}`,
                    },
                ],
            };
        },
    },
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'Get weather forecast' but doesn't specify details like data freshness, rate limits, error handling, or authentication needs. This leaves significant gaps in understanding how the tool behaves beyond its basic function.

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 purpose without any wasted words. It is appropriately sized and front-loaded, making it easy to parse quickly.

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?

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what the weather forecast includes (e.g., temperature, conditions), potential limitations, or return format. For a tool with no structured behavioral data, more context is needed to fully understand its operation.

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 input schema has 100% description coverage, with the 'city' parameter fully documented. The description implies the parameter's use ('for a city') but adds no additional meaning beyond what the schema provides, such as format examples or constraints. This meets 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 ('Get') and resource ('weather forecast for a city'), making it immediately understandable. However, it doesn't differentiate from sibling tools, as 'calculate-sum' is unrelated, so no sibling distinction is needed or provided.

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, such as other weather-related tools or data sources. It only states what the tool does, without context for its application or prerequisites.

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/v4lheru/generic-mcp-template'

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