weather_search
Search for locations using a query to quickly find weather data. Integrated with Weather MCP Server to provide accurate results for AI-driven weather inquiries.
Instructions
Search for locations matching query
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | Yes | Location query |
Implementation Reference
- server.py:195-200 (handler)Executes the weather_search tool by validating the 'q' parameter, fetching data from the 'search.json' endpoint using the shared fetch function, and formatting the result as JSON.elif tool_name == "weather_search": q = arguments.get("q") if not q: raise ValueError("Location (q) is required") result = await fetch("search.json", {"q": q}) content = json.dumps(result, indent=2)
- server.py:147-160 (registration)Registers the weather_search tool in the tools/list response, including its name, description, and input schema.{ "name": "weather_search", "description": "Search for locations matching query", "inputSchema": { "type": "object", "properties": { "q": { "type": "string", "description": "Location query" } }, "required": ["q"] } }
- server.py:150-159 (schema)Defines the input schema for the weather_search tool, requiring a 'q' string parameter for the location query."inputSchema": { "type": "object", "properties": { "q": { "type": "string", "description": "Location query" } }, "required": ["q"] }