wiki_sparql
Wikidata SPARQL query — Run a read-only SPARQL query (SELECT or ASK) against the Wikidata knowledge graph (100M+ items) and get clean JSON rows: entity URIs shortened to Q-ids, numbers and booleans typed. A LIMIT is added when missing (limit= 1-1000, default 100); compact=false keeps full URIs. Bad SPARQL returns 422 with the parser message (not charged). Wikidata data is CC0. For agents answering structured questions (largest countries, companies by founder, people by occupation, films by director) or building datasets. Price: $0.005 USDC (Base, via x402).
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": {
"q": "<q>"
},
"name": "wiki_sparql"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | Yes | SELECT ?country ?countryLabel ?population WHERE { ?country wdt:P31 wd:Q6256; wdt:P1082 ?population. SERVICE wikibase:label { bd:serviceParam wikibase:language 'en'. } } ORDER BY DESC(?population) LIMIT 5 |