Skip to main content
Glama

get_current_weather

Retrieve current weather data including temperature, wind, humidity, pressure, UV index, visibility, and conditions for any location. Optionally includes air quality information.

Instructions

Get real-time current weather for any location. Returns temperature, wind speed and direction, humidity, pressure, UV index, visibility, feels-like temperature, and weather condition. Optionally includes air quality (AQI) data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qYesLocation query. Accepts: city name (London), lat/lon (51.5,-0.1), US zip (10001), UK postcode (SW1), IATA airport code (iata:LHR), IP address, or auto:ip for caller's location.
aqiNoInclude air quality data (CO, NO2, O3, SO2, PM2.5, PM10). Default: no.

Implementation Reference

  • Handler logic for the get_current_weather tool.
    case "get_current_weather": {
      const { q, aqi = "no" } = args as { q: string; aqi?: string };
      result = await weatherRequest("/current.json", { q, aqi });
      break;
    }
  • Schema registration for get_current_weather.
    {
      name: "get_current_weather",
      description:
        "Get real-time current weather for any location. Returns temperature, wind speed and direction, humidity, pressure, UV index, visibility, feels-like temperature, and weather condition. Optionally includes air quality (AQI) data.",
      inputSchema: {
        type: "object",
        properties: {
          q: {
            type: "string",
            description:
              "Location query. Accepts: city name (London), lat/lon (51.5,-0.1), US zip (10001), UK postcode (SW1), IATA airport code (iata:LHR), IP address, or auto:ip for caller's location.",
          },
          aqi: {
            type: "string",
            enum: ["yes", "no"],
            description: "Include air quality data (CO, NO2, O3, SO2, PM2.5, PM10). Default: no.",
          },
        },
        required: ["q"],
      },
  • Helper function used by tools to perform API requests.
    async function weatherRequest(
      endpoint: string,
      params: Record<string, string | number>
    ): Promise<unknown> {
      const searchParams = new URLSearchParams({ key: API_KEY! });
      for (const [k, v] of Object.entries(params)) {
        searchParams.set(k, String(v));
      }
      const url = `${BASE_URL}${endpoint}?${searchParams.toString()}`;
      const res = await fetch(url);
      const data = await res.json();
      if (!res.ok) {
        const err = data as { error?: { code: number; message: string } };
        throw new McpError(
          ErrorCode.InternalError,
          `WeatherAPI error ${err.error?.code}: ${err.error?.message ?? res.statusText}`
        );
      }
      return data;
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It describes the return data (temperature, wind, etc.) and optional air quality, but lacks details on rate limits, authentication needs, error handling, or data freshness. This is a significant gap for a tool with no annotation coverage.

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 front-loaded with the core purpose in the first sentence, followed by details on returns and optional features. Both sentences earn their place by adding value, with zero wasted words, making it highly efficient.

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

Completeness3/5

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

Given no annotations and no output schema, the description partially compensates by listing return data fields. However, it lacks details on response structure, error cases, or operational constraints, leaving gaps for a tool with two parameters and no structured safety or output information.

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 fully documents both parameters. The description adds minimal value beyond the schema by mentioning 'any location' and 'optionally includes air quality (AQI) data,' but does not provide additional syntax or format details. 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 real-time current weather') and resources ('for any location'), distinguishing it from siblings like get_forecast or get_history by focusing on current conditions rather than predictions or past data.

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

Usage Guidelines3/5

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

The description implies usage for current weather data but does not explicitly state when to use this tool versus alternatives like get_forecast or get_history. It mentions optional air quality inclusion, which provides some context but lacks explicit guidance on tool selection.

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