Skip to main content
Glama

Weather Dataset Statistics

weather_stats

Retrieve statistics about the Weather dataset: stations covered, date range, data sources, and last update timestamp.

Instructions

Get statistics about the Weather dataset: stations covered, date range, data sources, and last updated timestamp. Free endpoint.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The weather_stats tool handler - calls /api/v1/weather/stats, returns JSON-formatted dataset statistics including stations covered, date range, data sources, and last updated timestamp. Free endpoint with no input parameters.
    server.registerTool(
      "weather_stats",
      {
        title: "Weather Dataset Statistics",
        description:
          "Get statistics about the Weather dataset: stations covered, date range, " +
          "data sources, and last updated timestamp. Free endpoint.",
        inputSchema: {},
      },
      async () => {
        const res = await apiGet<WeatherStatsResponse>("/api/v1/weather/stats");
    
        if (!res.ok) {
          if (res.status === 404) {
            return {
              content: [
                {
                  type: "text" as const,
                  text: "Weather dataset is not yet available. This data source is coming soon.",
                },
              ],
            };
          }
          return {
            content: [
              {
                type: "text" as const,
                text: `API error (${res.status}): ${JSON.stringify(res.data)}`,
              },
            ],
            isError: true,
          };
        }
    
        return {
          content: [
            { type: "text" as const, text: JSON.stringify(res.data, null, 2) },
          ],
        };
      },
    );
  • src/index.ts:42-42 (registration)
    Registration of weather tools (including weather_stats) via registerWeatherTools(server) call in the main MCP server setup.
    registerWeatherTools(server);
  • WeatherStatsResponse interface defining the response type: dataset, source, update_frequency, and stats fields.
    interface WeatherStatsResponse {
      dataset: string;
      source: string;
      update_frequency: string;
      stats: Record<string, unknown>;
    }
  • Tool registration with empty inputSchema (no parameters required), title 'Weather Dataset Statistics', and handler that fetches stats from the API.
      server.registerTool(
        "weather_stats",
        {
          title: "Weather Dataset Statistics",
          description:
            "Get statistics about the Weather dataset: stations covered, date range, " +
            "data sources, and last updated timestamp. Free endpoint.",
          inputSchema: {},
        },
        async () => {
          const res = await apiGet<WeatherStatsResponse>("/api/v1/weather/stats");
    
          if (!res.ok) {
            if (res.status === 404) {
              return {
                content: [
                  {
                    type: "text" as const,
                    text: "Weather dataset is not yet available. This data source is coming soon.",
                  },
                ],
              };
            }
            return {
              content: [
                {
                  type: "text" as const,
                  text: `API error (${res.status}): ${JSON.stringify(res.data)}`,
                },
              ],
              isError: true,
            };
          }
    
          return {
            content: [
              { type: "text" as const, text: JSON.stringify(res.data, null, 2) },
            ],
          };
        },
      );
    }
  • apiGet helper used by the handler to make the HTTP GET request to /api/v1/weather/stats.
    export async function apiGet<T = unknown>(
      path: string,
      params?: Record<string, string | number | undefined>,
    ): Promise<ApiResponse<T>> {
      const url = buildUrl(path, params);
    
      const headers: Record<string, string> = {
        Accept: "application/json",
        "User-Agent": "verilex-mcp-server/0.1.0",
      };
    
      // Forward x402 payment token if present in env (for paid endpoints)
      const paymentToken = process.env.VERILEX_PAYMENT_TOKEN;
      if (paymentToken) {
        headers["X-Payment-Token"] = paymentToken;
      }
    
      const res = await fetch(url, { headers });
      const data = (await res.json()) as T;
    
      const stale = res.headers.get("X-Data-Stale");
      const lastUpdated = res.headers.get("X-Data-Last-Updated");
      const ageSeconds = res.headers.get("X-Data-Age-Seconds");
    
      return {
        ok: res.ok,
        status: res.status,
        data,
        stale: stale === "true",
        lastUpdated: lastUpdated ?? undefined,
        ageSeconds: ageSeconds ? Number(ageSeconds) : undefined,
      };
    }
Behavior3/5

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

With no annotations, the description carries full burden. It states 'Free endpoint' and lists returned data, but omits behavioral details like read-only nature, rate limits, or error handling. Adequate but not comprehensive.

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?

Two sentences that are clear and front-loaded. No wasted words; every sentence provides value.

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 no output schema, the description adequately lists the statistics returned. It could benefit from mentioning output format or whether results are paginated, but for a simple stats endpoint, it is sufficiently complete.

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?

No parameters exist, so schema coverage is effectively 100%. The description adds no parameter details, which is appropriate. Baseline score of 4 is justified.

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

Purpose5/5

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

The description clearly states the tool retrieves statistics about the Weather dataset, listing specific elements (stations covered, date range, data sources, last updated). This clearly distinguishes it from sibling tools like get_current_weather, get_weather_forecast, and get_weather_history.

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?

No guidance on when to use this tool versus alternatives. The description only mentions 'Free endpoint,' but does not specify context, prerequisites, or scenarios for usage.

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/carrierone/verilexdata-mcp'

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