Skip to main content
Glama
wolkwork

KNMI Weather MCP

by wolkwork

search_location

Search for locations in the Netherlands to retrieve weather data from KNMI stations.

Instructions

Search for locations in the Netherlands

Args:
    query: Search term for location

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes

Implementation Reference

  • The 'search_location' tool handler function. Decorated with @mcp.tool(), it queries OpenStreetMap's Nominatim API to search for locations in the Netherlands and returns a list of results with name, type, latitude, and longitude.
    @mcp.tool()
    async def search_location(query: str, ctx: Context) -> List[Dict[str, str]]:
        """
        Search for locations in the Netherlands
    
        Args:
            query: Search term for location
        """
        async with httpx.AsyncClient() as client:
            response = await client.get(
                "https://nominatim.openstreetmap.org/search",
                params={"q": f"{query}, Netherlands", "format": "json", "limit": 5},
                headers={"User-Agent": "KNMI_Weather_MCP/1.0"},
            )
            response.raise_for_status()
    
            results = []
            for place in response.json():
                results.append(
                    {
                        "name": place["display_name"],
                        "type": place["type"],
                        "latitude": place["lat"],
                        "longitude": place["lon"],
                    }
                )
    
            return results
  • The tool is registered via the @mcp.tool() decorator on line 115, which is how FastMCP registers it as an MCP tool.
    @mcp.tool()
Behavior2/5

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

No annotations are provided, so the description bears full responsibility. It mentions 'Search' (implying read-only) but offers no details on behavior like pagination, result limits, or response structure. This leaves the agent guessing about side effects or constraints.

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 description is very short (two sentences) but minimally structured with an Args section. While concise, the brevity comes at the cost of informativeness, and the docstring format is acceptable but not exemplary.

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

Completeness2/5

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

Given the single parameter, lack of output schema, and no annotations, the description should cover usage context. It does not explain what the search returns (e.g., locations, coordinates) or any limitations, making it incomplete for effective tool invocation.

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

Parameters1/5

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

With 0% schema description coverage, the description must compensate. It merely paraphrases the parameter as 'search term for location' without adding format, examples, or constraints beyond the schema, which already lists 'query' as a string.

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 clearly states the tool searches for locations in the Netherlands, specifying the verb 'Search' and the resource 'locations'. However, it does not differentiate from sibling tools like get_location_weather or what_is_the_weather_like_in, which could also involve location queries.

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

Usage Guidelines2/5

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

There is no guidance on when to use this tool versus its siblings, nor any exclusions or prerequisites. The description simply restates the function without context on alternatives or scenarios.

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/wolkwork/knmi-mcp'

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