Skip to main content
Glama
IBM

chuk-mcp-open-meteo

by IBM

geocode_location

Convert location names to precise coordinates and geographic details for weather lookups. Use before weather tools to ensure accurate results.

Instructions

Convert location names to coordinates and get detailed geographic information.

Use this tool FIRST before calling weather tools to get accurate coordinates for any location. Searches worldwide database of cities, towns, and places with comprehensive metadata.

Args: name: Location name to search for. Can be: - City name: "London", "Tokyo", "New York" - City with country: "Paris, France", "Portland, Oregon" - Region or landmark: "Cornwall", "Lake Tahoe" - Address or place: "Times Square", "Big Ben" count: Maximum number of results to return (1-100). Default is 10. Use 1 if you're confident about the location (e.g., "London, UK") Use 5-10 for ambiguous names (e.g., "Paris" - could be France, Texas, etc.) language: Language code for result names. Options: "en" (English, default), "de" (German), "fr" (French), "es" (Spanish), "it" (Italian), "pt" (Portuguese), etc. format: Response format. Always use "json" (default).

Returns: GeocodingResponse: A Pydantic model containing: - results: List of matching locations, each with: - name: Location name - latitude, longitude: Coordinates (use these for weather tools!) - country, country_code: Country information - timezone: IANA timezone (e.g., "Europe/London") - elevation: Meters above sea level - population: Population (if available) - admin1, admin2: Administrative divisions (state, county, etc.) - feature_code: Type of place (PPLC=capital, PPL=populated place, etc.)

Tips for LLMs: - ALWAYS geocode location names before requesting weather data - Results are sorted by relevance (population, importance) - First result is usually what users mean for well-known cities - For ambiguous names, check country/admin divisions to pick the right one - Use the exact latitude/longitude from results in weather API calls - Timezone from geocoding can be passed to weather APIs for local time - CRITICAL: If no results found, IMMEDIATELY retry with simpler search terms! The API works best with just city names (e.g., "Portland" not "Portland Harbor" or "Portland, Maine") WORKFLOW: If "City, Region" fails → AUTOMATICALLY try just "City" → filter by admin1/admin2/country DO NOT ask the user - just retry automatically with the simpler name! - If still no results after retry: try even simpler terms or use nearest known location - Common pattern: "Harbor Name" fails → retry just the city name → filter by region/country

Example: # Find London coordinates locations = await geocode_location("London", count=1) london = locations.results[0] # Use coordinates for weather: london.latitude, london.longitude

# Handle ambiguous names
locations = await geocode_location("Paris", count=5)
# results[0] = Paris, France (population 2.1M)
# results[1] = Paris, Texas (population 25K)
# Pick based on context or ask user

# If "City, Region" returns no results, try just "City"
locations = await geocode_location("Portland, Maine", count=5)
if not locations.results:
    # Try simpler search
    locations = await geocode_location("Portland", count=5)
    # Filter by country_code='US' and admin1='Maine' to get the right one
    portland = next(r for r in locations.results if r.country_code == 'US' and r.admin1 == 'Maine')

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
countNo
formatNojson
languageNoen
Behavior5/5

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

With no annotations provided, the description fully discloses behavior: it searches a worldwide database, returns results sorted by relevance, and details the retry logic on failure. It also explains what the return values contain, compensating for the lack of output schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but well-structured with sections (Args, Returns, Tips, Examples). It is slightly verbose in places (e.g., repeating 'ALWAYS geocode'), but every sentence adds value. It could be more concise, but the structure compensates.

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

Completeness5/5

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

Given the tool's complexity (4 parameters, no output schema), the description is remarkably complete. It covers all parameters, return value structure, error handling workflow, and example use cases. The context signals indicate high complexity, and the description meets it fully.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 0% description coverage, so the description must compensate. It does so excellently by explaining each parameter in detail: name formats, count usage suggestions, language options, and format instructions. This adds significant meaning beyond the bare schema.

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: 'Convert location names to coordinates and get detailed geographic information.' It distinguishes itself from sibling tools like weather tools by being a prerequisite, and from batch_geocode_locations by being the single-location version.

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

Usage Guidelines5/5

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

The description provides explicit when-to-use guidance: 'Use this tool FIRST before calling weather tools' and includes a retry workflow for handling no results. It gives specific advice on count selection and how to handle ambiguous names, leaving no ambiguity about 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/IBM/chuk-mcp-open-meteo'

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