Skip to main content
Glama

Get Wikidata Sitelinks

wikidata_get_sitelinks
Read-onlyIdempotent

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesQ-ID of the item (e.g., "Q76"). Only items have sitelinks; properties (P-IDs) are not supported.
sitesNoOptional filter to specific site codes (e.g., ["enwiki", "frwiki", "dewiki"]). Omit to return all sitelinks.
wikis_onlyNoWhen true, return only Wikipedia sitelinks (site codes ending in "wiki", e.g., "enwiki", "dewiki"). Excludes Wikisource, Wiktionary, Wikiquote, etc.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoThe Q-ID whose sitelinks were fetched.
countNoNumber of sitelinks returned.
errorNoPresent when the call failed. Absent on success.
messageNoInformational note when no sitelinks were found. Absent when sitelinks are present.
sitelinksNoMap of site code to sitelink metadata. Empty when the entity has no matching sitelinks.

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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"
      -]
  2. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and idempotentHint, so safety is covered. The description adds key behavioral context: the item-vs-property limitation is not present in annotations, and the note about 300+ sitelinks informs about scale. This adds value beyond structured fields without contradicting them.

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?

The description is tightly written: it leads with the function, then explains the filter options, and closes with the critical item-vs-property constraint. Each sentence contributes new information with no redundancy, and the most important caveat is placed last for emphasis.

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?

With an output schema present and annotations providing read-only/idempotent hints, the description covers all necessary invocation details: purpose, filters, scale expectations, and a critical domain restriction. An agent has enough to correctly select and call this tool without additional information.

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?

Schema coverage is 100%, so parameters are documented. However, the description enriches understanding by explaining the purpose of the filters (sites for specific language editions, wikis_only for Wikipedia-only) and the underlying concept of a sitelink mapping site codes to article titles. It also highlights the property exclusion, which is not in the schema descriptions but is crucial for correct invocation.

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 description clearly states the action ('Fetch Wikipedia and Wikimedia project article URLs') and the resource ('for a Wikidata item'). It distinguishes from sibling tools by explicitly noting that only items (Q-IDs) have sitelinks, not properties (P-IDs), which immediately separates it from property-related tools like wikidata_get_statements.

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?

Provides explicit guidance on using the 'sites' parameter to filter by language and 'wikis_only' to restrict to Wikipedia. It also warns that major items can have 300+ sitelinks, implying potential large responses. While it doesn't explicitly state when NOT to use this tool, the property exclusion clarifies a boundary, and the context is clear enough for an agent to decide.

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.