Skip to main content
Glama

get_history

Retrieve historical weather data for past dates from 2010 onward, including daily summaries and hourly breakdowns, to analyze past conditions or verify weather events.

Instructions

Get historical weather data for a specific date from 1 January 2010 onwards. Returns daily summary and full hourly breakdown. Useful for past weather lookups, analytics, and backtesting.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qYesLocation query — city name, lat/lon, zip, postcode, IATA, or IP.
dtYesDate in yyyy-MM-dd format. Must be on or after 2010-01-01.
end_dtNoOptional end date for a date range (Pro+ plan only). Max 30 days range. yyyy-MM-dd.

Implementation Reference

  • The handler logic for "get_history" that processes arguments and calls the WeatherAPI's history endpoint.
    case "get_history": {
      const { q, dt, end_dt } = args as { q: string; dt: string; end_dt?: string };
      const params: Record<string, string | number> = { q, dt };
      if (end_dt) params.end_dt = end_dt;
      result = await weatherRequest("/history.json", params);
      break;
    }
  • The tool schema registration for "get_history", defining its description, input parameters, and constraints.
      name: "get_history",
      description:
        "Get historical weather data for a specific date from 1 January 2010 onwards. Returns daily summary and full hourly breakdown. Useful for past weather lookups, analytics, and backtesting.",
      inputSchema: {
        type: "object",
        properties: {
          q: {
            type: "string",
            description: "Location query — city name, lat/lon, zip, postcode, IATA, or IP.",
          },
          dt: {
            type: "string",
            description: "Date in yyyy-MM-dd format. Must be on or after 2010-01-01.",
          },
          end_dt: {
            type: "string",
            description:
              "Optional end date for a date range (Pro+ plan only). Max 30 days range. yyyy-MM-dd.",
          },
        },
        required: ["q", "dt"],
      },
    },
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses the temporal scope ('from 1 January 2010 onwards') and return format ('daily summary and full hourly breakdown'), which are useful behavioral traits. However, it doesn't mention rate limits, authentication requirements, error conditions, or pagination behavior that would be valuable for a data retrieval tool.

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 efficiently structured in two sentences. The first sentence states the core functionality and constraints, while the second provides usage context. Every phrase earns its place with no redundant information.

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?

For a data retrieval tool with no annotations and no output schema, the description provides good context about what data is returned and temporal constraints. However, it could be more complete by mentioning authentication requirements, rate limits, or error handling. The 100% schema coverage helps compensate for some gaps.

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 documents all parameters thoroughly. The description adds minimal value beyond the schema - it mentions the date constraint but doesn't provide additional semantic context about parameter usage or interactions. Baseline 3 is appropriate when the schema does the heavy lifting.

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's purpose with specific verbs ('Get historical weather data') and resources ('daily summary and full hourly breakdown'). It distinguishes from siblings by specifying historical data from 2010 onward, unlike get_current_weather or get_forecast which focus on current/future data.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool ('past weather lookups, analytics, and backtesting'), which implicitly distinguishes it from siblings focused on current, future, or specialized weather data. However, it doesn't explicitly state when NOT to use it or name specific alternatives among siblings.

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/weatherapicom/weatherapi-mcp'

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