Skip to main content
Glama
bobbyyng

Weather MCP Server

by bobbyyng

get_weather_stats

Retrieve weather statistics, including current conditions, forecasts, and alerts, using simulated data from the Weather MCP Server.

Instructions

Get weather statistics information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP CallToolRequest handler case for 'get_weather_stats': calls weatherService.getWeatherStats() and returns JSON stringified response.
    case 'get_weather_stats': {
      const stats = await this.weatherService.getWeatherStats();
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(stats, null, 2),
          },
        ],
      };
    }
  • Core handler function getWeatherStats() that computes weather statistics from mock data: total locations, avg temp, most common condition, and breakdown.
    async getWeatherStats(): Promise<{
      totalLocations: number;
      averageTemperature: number;
      mostCommonCondition: string;
      locationBreakdown: Array<{location: string, temperature: number, condition: string}>;
    }> {
      const locations = Object.values(mockWeatherData);
      const totalLocations = locations.length;
      const averageTemperature = locations.reduce((sum, data) => sum + data.temperature, 0) / totalLocations;
      
      const conditionCounts: Record<string, number> = {};
      locations.forEach(data => {
        conditionCounts[data.condition] = (conditionCounts[data.condition] || 0) + 1;
      });
      
      const mostCommonCondition = Object.entries(conditionCounts)
        .reduce((a, b) => a[1] > b[1] ? a : b)[0];
      
      const locationBreakdown = locations.map(data => ({
        location: data.location,
        temperature: data.temperature,
        condition: data.condition
      }));
      
      return {
        totalLocations,
        averageTemperature: Math.round(averageTemperature * 10) / 10,
        mostCommonCondition,
        locationBreakdown
      };
    }
  • src/index.ts:99-106 (registration)
    Tool registration in ListToolsRequest handler: defines name 'get_weather_stats', description, and empty input schema (no parameters).
    {
      name: 'get_weather_stats',
      description: 'Get weather statistics information',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • Input schema for get_weather_stats tool: empty object properties (no input parameters required).
    inputSchema: {
      type: 'object',
      properties: {},
    },
Behavior1/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. The description only states what the tool does at a high level ('Get weather statistics information') without revealing any behavioral traits such as whether it requires authentication, has rate limits, returns historical or aggregated data, or what format the output takes. This leaves critical operational aspects undocumented.

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

Conciseness3/5

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

The description is extremely concise ('Get weather statistics information'), which is efficient but under-specified. While it avoids unnecessary words, it fails to provide enough context to be useful, making it feel more like under-specification than effective brevity. It's front-loaded but lacks substance, so it doesn't fully earn its place as a helpful description.

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 complexity implied by 'weather statistics' (which could involve historical data, aggregates, or comparisons), the lack of annotations, no output schema, and a vague description, this is incomplete. The description doesn't clarify what 'statistics' entails, how data is returned, or any operational constraints, leaving significant gaps for an agent to understand and use the tool effectively.

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

Parameters4/5

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

The tool has 0 parameters, and the schema description coverage is 100% (since there are no parameters to describe). With no parameters, the description doesn't need to add semantic details beyond what the schema provides. The baseline for 0 parameters is 4, as there's no parameter information to compensate for or elaborate upon.

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

Purpose2/5

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

The description 'Get weather statistics information' is a tautology that essentially restates the tool name 'get_weather_stats' with minimal elaboration. While it indicates the general domain (weather statistics), it lacks specificity about what statistics are retrieved, what time periods are covered, or what geographical scope applies. It doesn't distinguish this tool from its siblings like 'get_current_weather' or 'get_weather_forecast' beyond the vague term 'statistics'.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention any context, prerequisites, or exclusions. With siblings like 'get_current_weather', 'get_weather_alerts', and 'get_weather_forecast', there's no indication of when 'statistics' are appropriate versus 'current', 'alerts', or 'forecast' data, leaving the agent to guess based on the tool names 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

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/bobbyyng/weather-mcp-ts'

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