Skip to main content
Glama
weather-mcp

weather-mcp

by hammerZh-Z

weather_query_by_days

Read-onlyIdempotent

Query a city's weather forecast for today or any day up to 16 days ahead, returning conditions, temperatures, precipitation, wind, humidity, UV index, and sunrise/sunset in Markdown or JSON.

Instructions

查询指定城市在指定天数后的天气情况。

这个工具可以查询未来16天内任意一天的天气预报,包括温度、降水、风力等信息。

Args: params (WeatherQueryInput): 已验证的输入参数,包含: - city (str): 城市名称(例如:'北京', '上海', 'New York', 'London') - days_later (int): 未来的天数(0=今天, 1=明天, 2=后天, 范围:0-16) - response_format (ResponseFormat): 输出格式,默认为markdown

Returns: str: 格式化的天气信息

成功响应包含:
- 天气状况(晴朗、多云、雨等)
- 温度范围(最低/最高温度)
- 体感温度
- 降水量和降水概率
- 风速
- 湿度
- 紫外线指数
- 日出日落时间

错误响应:
"Error: <错误信息>"

Examples: - 查询明天的天气: city="北京", days_later=1 - 查询后天的天气: city="上海", days_later=2 - 查询7天后的天气: city="New York", days_later=7

Error Handling: - 如果城市名称无效,返回城市未找到错误 - 如果天数超出范围(0-16),返回验证错误 - 如果API请求失败,返回相应的错误信息

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "params": "<params>"
    },
    "name": "weather_query_by_days"
  }
}

Input Schema

NameRequiredDescriptionDefault
paramsYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior4/5

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

The annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint, so safety is covered. The description adds value beyond that with error semantics (city not found, out-of-range days validation error, API failure) and the surface area of the payload; the enumerated return fields are somewhat redundant given an output schema exists.

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 purpose is front-loaded in the first two sentences, which is good. But the Args block largely restates the nested schema, the Returns list duplicates an existing output schema, and the three examples add little beyond the already-stated 0/1/2 mapping — the document is longer than its information content.

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 single-parameter wrapper around an open-world API, an agent gets scope limits, offset semantics, error behavior, and output shape — enough to call it correctly and interpret failures. The only real omission is guidance on selecting this tool versus the weekday variant.

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?

Reported schema description coverage is 0%, so the description must carry parameter meaning and it does: city examples in multiple languages, days_later range 0-16 with concrete anchor values (0/1/2), and a note that response_format defaults to markdown. It does not explain when to pick json over markdown or what the format differences actually look like.

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 states a specific verb and resource (query the weather forecast for a given city N days in the future) and bounds the horizon to 16 days. The offset semantics of days_later distinguish it in spirit from a weekday-based sibling, but the description never names or contrasts an alternative, so it stops short of full sibling differentiation.

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 range table (0=today, 1=tomorrow, 2=day after tomorrow, 0-16) and the three worked examples make intended usage inferable. However, there is no explicit statement of when to prefer this tool over a weekday-keyed alternative, and no when-not-to-use conditions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools