Skip to main content
Glama

Get Wikidata Sitelinks

wikidata_get_sitelinks
Read-onlyIdempotent

Fetch Wikipedia and other Wikimedia project article URLs for a Wikidata item. A sitelink maps a site code (e.g., "enwiki", "commonswiki") to an article title and URL. Major items can have 300+ sitelinks across languages. Use sites to filter to specific site codes, or wikis_only to return only Wikipedia editions. Only Q-IDs (items) have sitelinks — properties (P-IDs) do not.

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": {
      "id": "<id>"
    },
    "name": "wikidata_get_sitelinks"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesQ-ID of the item (e.g., "Q76"), bare or as an entity URI or wd: form (e.g., "http://www.wikidata.org/entity/Q76", "wd:Q76"). Only items have sitelinks; properties (P-IDs) are not supported.
sitesNoOptional filter to specific site codes (e.g., ["enwiki", "frwiki", "commonswiki"]), matched in any case with surrounding whitespace ignored. Omit to return all sitelinks.
wikis_onlyNoWhen true, return only Wikipedia language editions: sitelinks whose URL is on a <subdomain>.wikipedia.org host, such as enwiki (en.wikipedia.org) or be_x_oldwiki (be-tarask.wikipedia.org). Excludes Abstract Wikipedia, Wikimedia Commons, Wikispecies, Wikisource, Wiktionary, Wikiquote, and every other project.

Output Schema

NameRequiredDescriptionDefault
idNoThe resolved Q-ID whose sitelinks were fetched.
countNoNumber of sitelinks returned.
errorNoPresent when the call failed. Absent on success.
messageNoInformational note when a requested site code is absent or no sitelinks match.
notFoundNoRequested site codes absent from the resolved item, normalized to lowercase with surrounding whitespace removed.
sitelinksNoMap of site code to sitelink metadata. Empty when the entity has no matching sitelinks.
redirectedFromNoThe normalized requested Q-ID when it redirects to id.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • changedInput schema / properties / wikis_only / description
      Previous value: -"When true, return only Wikipedia editions: sitelinks whose URL is on a <subdomain>.wikipedia.org host, such as enwiki (en.wikipedia.org) or be_x_oldwiki (be-tarask.wikipedia.org). Excludes Wikimedia Commons, Wikispecies, Wikisource, Wiktionary, Wikiquote, and every other project."New value: +"When true, return only Wikipedia language editions: sitelinks whose URL is on a <subdomain>.wikipedia.org host, such as enwiki (en.wikipedia.org) or be_x_oldwiki (be-tarask.wikipedia.org). Excludes Abstract Wikipedia, Wikimedia Commons, Wikispecies, Wikisource, Wiktionary, Wikiquote, and every other project."
    • changedOutput schema / properties / id / description
      Previous value: -"The Q-ID whose sitelinks were fetched."New value: +"The resolved Q-ID whose sitelinks were fetched."
    • changedOutput schema / properties / message / description
      Previous value: -"Informational note when no sitelinks were found. Absent when sitelinks are present."New value: +"Informational note when a requested site code is absent or no sitelinks match."
    • addedOutput schema / properties / notFound
      Added value: +{
      +  "description": "Requested site codes absent from the resolved item, normalized to lowercase with surrounding whitespace removed.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / redirectedFrom
      Added value: +{
      +  "description": "The normalized requested Q-ID when it redirects to id.",
      +  "type": "string"
      +}
  2. Changed3 schema fields changed
    • changedInput schema / properties / id / description
      Previous value: -"Q-ID of the item (e.g., \"Q76\"). Only items have sitelinks; properties (P-IDs) are not supported."New value: +"Q-ID of the item (e.g., \"Q76\"), bare or as an entity URI or wd: form (e.g., \"http://www.wikidata.org/entity/Q76\", \"wd:Q76\"). Only items have sitelinks; properties (P-IDs) are not supported."
    • changedInput schema / properties / sites / description
      Previous value: -"Optional filter to specific site codes (e.g., [\"enwiki\", \"frwiki\", \"dewiki\"]). Omit to return all sitelinks."New value: +"Optional filter to specific site codes (e.g., [\"enwiki\", \"frwiki\", \"commonswiki\"]), matched in any case with surrounding whitespace ignored. Omit to return all sitelinks."
    • changedInput schema / properties / wikis_only / description
      Previous value: -"When true, return only Wikipedia sitelinks (site codes ending in \"wiki\", e.g., \"enwiki\", \"dewiki\"). Excludes Wikisource, Wiktionary, Wikiquote, etc."New value: +"When true, return only Wikipedia editions: sitelinks whose URL is on a <subdomain>.wikipedia.org host, such as enwiki (en.wikipedia.org) or be_x_oldwiki (be-tarask.wikipedia.org). Excludes Wikimedia Commons, Wikispecies, Wikisource, Wiktionary, Wikiquote, and every other project."
  3. Changed6 schema fields changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / additionalProperties
      Added value: +false
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedOutput schema / anyOf
      Added value: +[
      +  {
      +    "not": {
      +      "required": [
      +        "error"
      +      ]
      +    },
      +    "required": [
      +      "id",
      +      "sitelinks",
      +      "count"
      +    ]
      +  },
      +  {
      +    "required": [
      +      "error"
      +    ]
      +  }
      +]
    • addedOutput schema / properties / error
      Added value: +{
      +  "additionalProperties": {},
      +  "description": "Present when the call failed. Absent on success.",
      +  "properties": {
      +    "code": {
      +      "description": "JSON-RPC error code for this failure.",
      +      "maximum": 9007199254740991,
      +      "minimum": -9007199254740991,
      +      "type": "integer"
      +    },
      +    "data": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "reason": {
      +          "description": "Machine-readable failure mode. Declared by this tool: `entity_not_found`: No item exists at this Q-ID — either unassigned or out of range. `not_an_item`: A P-ID was supplied — only items (Q-IDs) have sitelinks. Other values are possible when a failure originates below the handler.",
      +          "examples": [
      +            "entity_not_found",
      +            "not_an_item"
      +          ],
      +          "type": "string"
      +        },
      +        "recovery": {
      +          "additionalProperties": {},
      +          "description": "Actionable next step for the caller.",
      +          "properties": {
      +            "hint": {
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "hint"
      +          ],
      +          "type": "object"
      +        },
      +        "retryable": {
      +          "description": "Whether retrying may succeed.",
      +          "type": "boolean"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "message": {
      +      "description": "Human-readable description of what went wrong.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "code",
      +    "message"
      +  ],
      +  "type": "object"
      +}
    • removedOutput schema / required
      Removed value: -[
      -  "id",
      -  "sitelinks",
      -  "count"
      -]
  4. First observed

TDQS

A3.6/5.0
Behavior3/5

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

The annotations already declare readOnly, idempotent and openWorld, so the safety profile is covered. The description adds useful behavior context — the volume warning ("300+ sitelinks across languages") and the item-only restriction — but says nothing about response size limits, truncation, or whether the 300+ case is paginated, which is the one behavioral risk an agent would care about here.

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 action and resource, then the definition, then the filtering options, then the precondition — a sensible order with no filler. The P-ID caveat is stated twice (description and id schema field), a minor redundancy that keeps it from a 5.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple, annotations cover the safety profile, and an output schema exists so return values need no explanation. The only unaddressed gap is what happens when an item has hundreds of sitelinks — truncation or pagination is never addressed despite the description raising that scenario.

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

Parameters3/5

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

Schema coverage is 100% and each parameter already carries an example-rich description, so the baseline is 3. The description's single mention of sites and wikis_only largely restates what the schema says and adds no syntax or edge-case detail beyond it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Names a specific verb and resource ("Fetch Wikipedia and other Wikimedia project article URLs for a Wikidata item") and defines what a sitelink is, which is genuinely more than restating the title. It also draws a hard boundary ("Only Q-IDs (items) have sitelinks — properties (P-IDs) do not"), though it never explicitly contrasts itself with close siblings like wikidata_get_entity or wikidata_get_labels.

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?

Gives concrete routing advice for the optional parameters ("Use sites to filter to specific site codes, or wikis_only to return only Wikipedia editions") and a clear precondition that P-IDs are unsupported. It stops short of naming an alternative tool for the cases it excludes, so the agent must infer what to call when sitelinks aren't available.

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.