Skip to main content
Glama

Reconcile Wikidata Osm

reconcile_wikidata_osm
Read-onlyIdempotent

Reconcile a set of Wikidata items against OpenStreetMap features of a given tag, the join Wikidata<->OSM community mapping efforts need before editing anything. Give either explicit Q-ids ("qids") or a SPARQL query that selects them ("sparql", must bind ?item to a wd:Q... URI, used to discover an arbitrary class, e.g. "every power station in country X"), plus an OSM tag filter ("osm_filter", e.g. "power=plant"). Fetches each item's coordinate (P625) and labels in the requested languages, searches OSM within radius_m of each, and scores candidates on THREE signals: an existing wikidata= tag (ground truth when present), cross-lingual name agreement, and distance. Returns one of four DISTINCT states per item: "matched" (confident link + evidence), "ambiguous" (2+ plausible candidates, ALL returned with scoresnever auto-resolved), "unmatched" (the OSM search completed and found nothing plausible), or "error" (the search did NOT complete, no Wikidata coordinate, the item didn't resolve, or the Overpass call failed/timed out/was capped). "error" is never collapsed into "unmatched": a failed lookup is not evidence a thing is missing from OSM. Read-only, this does not write to Wikidata, Wikipedia or OpenStreetMap.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "qids": [
        "Q162887",
        "Q3650523",
        "Q4501177"
      ],
      "radius_m": 2000,
      "languages": "ka,ru,en",
      "osm_filter": "power=plant"
    },
    "name": "reconcile_wikidata_osm"
  }
}

Input Schema

NameRequiredDescriptionDefault
qidsNoWikidata Q-ids to reconcile, up to 200an array of strings or a comma/pipe-joined string (e.g. ["Q162887","Q3650523"] or "Q162887,Q3650523"). Provide this OR "sparql".
sparqlNoA SPARQL SELECT that binds ?item to the Wikidata items to reconcile (up to 200 used)e.g. "SELECT ?item WHERE { ?item wdt:P31/wdt:P279* wd:Q159719 . ?item wdt:P17 wd:Q230 . }" for every power station (Q159719) in Georgia (Q230). Labels and coordinates are fetched separately per item, so this query only needs to pick the set, it does not need to select labels or coordinates itself. Provide this OR "qids".
radius_mNoSearch radius in metres around each item's coordinate, 10-20000 (default 300). An OSM feature carrying a matching wikidata= tag is still recognised as "matched" even if it falls outside this radius, the tag is ground truth.
languagesNoComma/pipe-joined language codes to compare, e.g. "ka,ru,en", the shape needed when the same real-world place has different names in different languages (his own example: a Georgian power station named differently in Georgian, Russian and English). Every requested language's label is fetched and compared against every OSM name tag (name, name:<lang>, alt_name, int_name, official_name); a match in ANY requested language counts as name agreement, and the response says which one. Default "en", pass the full set you actually need, an English-only comparison both misses real matches and can manufacture false ones.
osm_filterYesOSM tag filter(s) candidates must carry, as key=value, e.g. "power=plant", or several alternatives comma-joined, e.g. "power=plant,power=generator" (OR-ed together). Required.
overpass_timeout_sNoTimeout passed to the Overpass query itself, 5-180 seconds (default 25). Lower it to fail fast over a large area rather than wait.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • changedInput schema / properties / languages / description
      Previous value: -"Comma/pipe-joined language codes to compare, e.g. \"ka,ru,en\" — the shape needed when the same real-world place has different names in different languages (his own example: a Georgian power station named differently in Georgian, Russian and English). Every requested language's label is fetched and compared against every OSM name tag (name, name:<lang>, alt_name, int_name, official_name); a match in ANY requested language counts as name agreement, and the response says which one. Default \"en\" — pass the full set you actually need, an English-only comparison both misses real matches and can manufacture false ones."New value: +"Comma/pipe-joined language codes to compare, e.g. \"ka,ru,en\", the shape needed when the same real-world place has different names in different languages (his own example: a Georgian power station named differently in Georgian, Russian and English). Every requested language's label is fetched and compared against every OSM name tag (name, name:<lang>, alt_name, int_name, official_name); a match in ANY requested language counts as name agreement, and the response says which one. Default \"en\", pass the full set you actually need, an English-only comparison both misses real matches and can manufacture false ones."
    • changedInput schema / properties / osm_filter / description
      Previous value: -"OSM tag filter(s) candidates must carry, as key=value, e.g. \"power=plant\" — or several alternatives comma-joined, e.g. \"power=plant,power=generator\" (OR-ed together). Required."New value: +"OSM tag filter(s) candidates must carry, as key=value, e.g. \"power=plant\", or several alternatives comma-joined, e.g. \"power=plant,power=generator\" (OR-ed together). Required."
    • changedInput schema / properties / qids / description
      Previous value: -"Wikidata Q-ids to reconcile, up to 200 — an array of strings or a comma/pipe-joined string (e.g. [\"Q162887\",\"Q3650523\"] or \"Q162887,Q3650523\"). Provide this OR \"sparql\"."New value: +"Wikidata Q-ids to reconcile, up to 200an array of strings or a comma/pipe-joined string (e.g. [\"Q162887\",\"Q3650523\"] or \"Q162887,Q3650523\"). Provide this OR \"sparql\"."
    • changedInput schema / properties / radius_m / description
      Previous value: -"Search radius in metres around each item's coordinate, 10-20000 (default 300). An OSM feature carrying a matching wikidata= tag is still recognised as \"matched\" even if it falls outside this radius — the tag is ground truth."New value: +"Search radius in metres around each item's coordinate, 10-20000 (default 300). An OSM feature carrying a matching wikidata= tag is still recognised as \"matched\" even if it falls outside this radius, the tag is ground truth."
    • changedInput schema / properties / sparql / description
      Previous value: -"A SPARQL SELECT that binds ?item to the Wikidata items to reconcile (up to 200 used) — e.g. \"SELECT ?item WHERE { ?item wdt:P31/wdt:P279* wd:Q159719 . ?item wdt:P17 wd:Q230 . }\" for every power station (Q159719) in Georgia (Q230). Labels and coordinates are fetched separately per item, so this query only needs to pick the set — it does not need to select labels or coordinates itself. Provide this OR \"qids\"."New value: +"A SPARQL SELECT that binds ?item to the Wikidata items to reconcile (up to 200 used)e.g. \"SELECT ?item WHERE { ?item wdt:P31/wdt:P279* wd:Q159719 . ?item wdt:P17 wd:Q230 . }\" for every power station (Q159719) in Georgia (Q230). Labels and coordinates are fetched separately per item, so this query only needs to pick the set, it does not need to select labels or coordinates itself. Provide this OR \"qids\"."
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the readOnly/idempotent/destructive annotations, the description discloses the scoring model (wikidata= tag, name agreement, distance), the four distinct return states, and crucially why 'error' is never collapsed into 'unmatched'. It also notes the 200-item cap and the radius-exception behavior for ground-truth tags. This is rich behavioral context the annotations alone do not provide.

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?

Front-loaded with the core verb and resource, then progressively details inputs and output states. It is dense and slightly marred by minor typos ('scoresnever') and repetition of the read-only fact already in annotations, but every section earns its place for a complex tool.

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?

For a six-parameter, no-output-schema reconciliation tool, the description covers input modes, scoring, and all four return states with their distinctions. An agent has everything needed to call it correctly and interpret results.

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

Parameters4/5

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

Schema coverage is 100%, so the schema already documents the parameters, giving a baseline of 3. The description nonetheless adds framing: that sparql must bind ?item to a wd:Q... URI and that labels/coordinates are fetched separately, plus the reasoning behind the languages comparison and the radius ground-truth exception.

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?

States a specific verb and resource pair: 'Reconcile a set of Wikidata items against OpenStreetMap features of a given tag.' It also frames why the tool exists in the mapping workflow. An agent immediately knows this is a cross-source entity-matching tool, distinct from the surrounding research/edge tools.

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

Usage Guidelines4/5

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

Explains the prerequisite use case ('the join ... mapping efforts need before editing anything') and clarifies the qids-vs-sparql choice, including the discovery scenario for an arbitrary class. It stops short of explicit when-not-to-use guidance or naming alternatives, but the context is clear.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.