osm-tagging-schema-mcp

v3.0.1
io.github.gander-tools/osm-tagging-schema-mcp Checked 58 minutes ago Published 1 year ago

MCP server for querying and validating OpenStreetMap tags

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

flat_to_json

**INPUT CONVERTER**: Convert OpenStreetMap tags from human-friendly flat text format (one key=value pair per line) into JSON object format required by other MCP tools. This is a preprocessing tool - use it FIRST when users provide tags as text before passing the result to validation, search, or analysis tools. All other tools in this MCP server expect JSON input, so this converter is essential for text-based workflows. The parser is robust and flexible: it handles multiple line ending formats (LF/CRLF/CR), supports comments (lines starting with #), ignores empty lines, trims whitespace, and co…

ParameterTypeDescription
tags *stringOpenStreetMap tags in flat text format with one key=value pair per line. Each line should contain exactly one tag in the format "key=value". Supports comment lines (starting with #) which are ignored,…

get_preset_details

Retrieve comprehensive details for a specific OpenStreetMap preset, including all tags, geometry constraints, and field definitions. A preset represents a complete feature template with its standard tags, allowed geometry types, required fields, and optional fields. Returns the preset's localized name, complete tag set with human-readable names, geometry types (point/line/area/etc.), and expanded field lists. Field lists are automatically expanded from template references (like {@templates/contact} becomes email, phone, website, fax) and preset inheritance (like {building} expands to include a…

ParameterTypeDescription
presetId *Identifier for the preset to retrieve, in one of three formats: 1) Preset ID using slash notation (e.g., 'amenity/restaurant', 'highway/residential', 'natural/tree') - this is the direct preset identi…

get_tag_values

Retrieve all possible values for a specific OpenStreetMap tag key, with localized human-readable names for both the key and each value. This tool searches through the OSM tagging schema (both predefined field options and preset definitions) to find every documented value that can be used with the specified key. Returns four pieces of information: the normalized key name, localized key display name, a simple array of all values, and a detailed array with localized names for each value. Use this to discover what values are available for a tag (e.g., all amenity types), learn the proper terminolo…

ParameterTypeDescription
tagKey *stringThe OpenStreetMap tag key to retrieve values for (e.g., 'amenity', 'building', 'highway', 'natural', 'shop'). Supports both simple keys and namespaced keys with colons (e.g., 'addr:street', 'name:en')…

json_to_flat

**OUTPUT CONVERTER**: Convert OpenStreetMap tags from JSON object format into human-friendly flat text format (one key=value pair per line). This is a postprocessing tool - use it LAST when users want tags displayed as readable text rather than JSON. Since all other tools in this MCP server return JSON format, this converter is essential for creating user-friendly output, generating text files for external tools, or producing easily readable tag lists. The converter validates the input thoroughly: ensures all values are strings (not numbers or other types), rejects empty values, trims whitespa…

ParameterTypeDescription
tags *OpenStreetMap tags in JSON format, provided as either: 1) A JSON string that will be parsed (e.g., '{"amenity":"restaurant","name":"Test Cafe","cuisine":"italian"}') - must be valid JSON with string v…

search_presets

Search for OpenStreetMap presets by keyword or tag combination. OSM presets are predefined feature templates that define common feature types (like 'restaurant', 'park', 'road') with their standard tags, geometry constraints, and recommended fields. This tool searches through preset IDs and their associated tags to find matching features. Supports two search modes: keyword search (searches in preset IDs and all tag keys/values) and tag-based search (exact matching on specific tag key-value pairs using 'key=value' format). Returns comprehensive preset information including localized names, comp…

ParameterTypeDescription
keyword *stringSearch term for finding presets (case-insensitive). Two formats supported: 1) Simple keyword (e.g., 'restaurant', 'parking', 'school') - searches within preset IDs and all tag keys/values, matching pa…
geometrystringFilter results to only presets that support a specific geometry type (optional). Valid values: 'point' (nodes/POIs), 'vertex' (nodes along ways), 'line' (open ways like roads/rivers), 'area' (closed w…
limitnumberMaximum number of preset results to return (optional, no default limit). Use this to get faster responses when you only need a few results, or to avoid overwhelming output when searching broad terms.…

search_tags

Search for OpenStreetMap tags by keyword in both tag keys and tag values. Returns two categories of results: keyMatches (when the keyword matches a tag key, returns that key with all possible values) and valueMatches (when the keyword matches a specific tag value, returns the key-value pair). Searches are case-insensitive and match partial strings. Use this to explore available tags or find tags related to a concept.

ParameterTypeDescription
keyword *stringSingle keyword to search for in tag keys and values (case-insensitive). Should be a standalone word or partial word, not a tag pair. Examples: 'restaurant' (finds amenity=restaurant), 'wheel' (finds w…
limitnumberMaximum total number of results to return across both keyMatches and valueMatches combined (default: 100). Use lower values for faster responses when you only need a few results.

suggest_improvements

Analyze an OpenStreetMap tag collection and suggest improvements to make it more complete and informative. This tool identifies which OSM presets match your tags, then suggests missing fields that would enhance the feature's documentation. Returns structured suggestions categorized by operation type (add, remove, update) with human-readable explanations. Suggestions include both required fields (core attributes for the matched preset) and optional fields (additional details that would be helpful). Each suggestion includes localized field names and explains why the field would improve the data.…

ParameterTypeDescription
tags *Collection of existing OpenStreetMap tags to analyze in one of three formats: 1) JSON object (e.g., {"amenity": "restaurant", "name": "Test Cafe"}), 2) JSON string (e.g., '{"amenity":"parking"}'), or…

validate_tag

Validate a single OpenStreetMap tag key-value pair against the OSM tagging schema. Performs comprehensive validation including: deprecation checking (identifies deprecated tags and suggests modern replacements), schema existence validation (verifies the tag key exists in the schema), option validation (checks if the value is in predefined options for that key), and field type checking (distinguishes between strict fields and combo fields that allow custom values). Returns detailed validation results with localized names and actionable messages. Use this for educational purposes, data quality c…

ParameterTypeDescription
key *stringThe OpenStreetMap tag key to validate (e.g., 'amenity', 'building', 'highway', 'natural'). Tag keys should use the standard OSM format with colons for namespaces (e.g., 'addr:street', 'name:en'). Case…
value *stringThe OpenStreetMap tag value to validate against the specified key (e.g., 'restaurant', 'yes', 'residential', 'park'). Values are checked against predefined options if the field has them. Case-sensitiv…

validate_tag_collection

Validate a complete collection of OpenStreetMap tags together, performing comprehensive validation on each tag and providing aggregated statistics. This tool validates each tag individually (using the same validation logic as validate_tag) and then aggregates the results to give you an overall picture of the collection's quality. Returns detailed validation results for each tag (including deprecation warnings, schema validation, and option checking) plus summary statistics (total valid count, deprecated count, error count). Use this for bulk validation of OSM data exports, quality assurance of…

ParameterTypeDescription
tags *Collection of OpenStreetMap tags in one of three formats: 1) JSON object (e.g., {"amenity": "restaurant", "name": "Test Cafe", "cuisine": "italian"}), 2) JSON string (e.g., '{"amenity":"parking"}'), o…