SPARQL query on Wikidata
query_wikidataRun read-only SPARQL SELECT or ASK queries against Wikidata to retrieve entity data, labels, and Swiss municipality codes with predefined prefixes and automatic limits.
Instructions
Run a read-only SPARQL SELECT (or ASK) against the Wikidata Query Service. Prefixes wd:, wdt:, p:, ps:, pq:, rdfs:, schema:, wikibase:, bd: are predefined; use SERVICE wikibase:label { bd:serviceParam wikibase:language "de,fr,en". } for labels. Swiss hooks: wd:Q39 = Switzerland, wdt:P771 = BFS municipality code, wdt:P17 = country, wdt:P131 = located in. Example: SELECT ?m ?mLabel ?bfs WHERE { ?m wdt:P771 ?bfs . SERVICE wikibase:label { bd:serviceParam wikibase:language "de". } }. LIMIT 100 is injected when absent; larger LIMITs are clamped to 1000. 60 s timeout.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"query": "<query>"
},
"name": "query_wikidata"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | SPARQL SELECT/ASK query (read-only) |