Skip to main content
Glama

Read Wikidata with a read-only SPARQL query

wikidata
Read-only

Runs a read-only SPARQL query on Wikidata and returns the rows as plain values (ASK returns true or false). Only SELECT and ASK are allowed; updates are refused. A LIMIT of 100 or less is added when missing. 8-second limit. Data is CC0. Price: $0.002 per successful call, paid with x402 (USDC on Base, Solana and 10 more networks); failed calls are not charged.

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": "wikidata"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesA SPARQL SELECT or ASK query, up to 4,000 characters

Output Schema

NameRequiredDescriptionDefault
rowsNo
queryNo
sourceNo
columnsNo
rowCountNo
checkedAtNo
attributionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already declare readOnlyHint and openWorldHint, and the description goes well past them: an 8-second execution limit, an enforced LIMIT of 100, CC0 licensing, a $0.002 per-successful-call price via x402, and the explicit reassurance that failed calls are not charged. Cost and timeout behavior are not derivable from annotations or schema, so this is high-value disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Roughly four sentences, each carrying a distinct operational fact, ordered from capability to constraints to cost. Every sentence earns its place and the most decision-relevant information is front-loaded.

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 single-parameter, read-only query tool with an output schema and read-only annotations, everything an agent needs to call it correctly is present: allowed query types, injected LIMIT, timeout ceiling, and billing consequences. Nothing material is missing.

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?

The schema already documents the single query parameter at 100% coverage, but the description adds semantics the schema omits: the query language subset, that updates are refused, and that a LIMIT of 100 or less is injected when missing. The last point materially affects how the agent should author queries, which is genuine value beyond the schema.

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?

The first clause states a specific verb and resource ("Runs a read-only SPARQL query on Wikidata") and clarifies the return shape (rows as plain values, ASK returns true/false). It is unmistakable against the sibling catalog, which contains no other SPARQL/query tool.

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

Usage Guidelines3/5

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

The description constrains usage ("Only SELECT and ASK are allowed; updates are refused"), which tells the agent what will be rejected, but it never names an alternative tool or states the conditions under which an agent should prefer this over other lookup tools. Usage is implied rather than directed.

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.

Resources