Skip to main content
Glama

Get Wikidata Entity

wikidata_get_entity
Read-only

Fetch a Wikidata entity (item or property) by QID or PID. The fields parameter narrows the upstream fetch, not just the response — asking for labels alone costs a fraction of the whole entity, so name the fields you need. Omit fields for all data; a well-connected item is large enough to overflow, and an oversized entity returns kind: "outline" — the field categories with their byte sizes — instead of the data. Follow its retrieval_notice literally rather than picking from sections yourself — it names a fields set already measured to fit, since category sizes are additive and requesting them all would overflow again; for a category too large to deliver whole (statements or sitelinks on a major item) it names the sibling tool that can narrow it. Q-IDs (e.g. Q76) fetch items; P-IDs (e.g. P31) fetch properties from the correct endpoint automatically. Use wikidata_get_statements for deep claim traversal with label resolution, and whenever an entity's statements are large — its properties parameter selects individual P-IDs, granularity fields does not carry.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesQ-ID (e.g., "Q76") or P-ID (e.g., "P31"). Case-insensitive — normalized to uppercase.
fieldsNoFields to include. Options: "labels", "descriptions", "aliases", "statements", "sitelinks". Narrows the upstream fetch as well as the response, so a narrow selection is markedly cheaper. Omit for all fields.
languagesNoWikidata language codes to include in labels, descriptions, and aliases (e.g., ["en", "de"]). Case-insensitive; "_" is read as "-"; blank entries are dropped. A requested language with no label of its own falls back to the entity's multilingual ("mul") value, returned under the requested code. Omit, or send an empty list, to return all available languages.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoNormalized entity ID (e.g., "Q76" or "P31").
kindNofull — the requested field categories carry their data. outline — the entity overflowed the inline byte budget, so sections lists the categories with their byte sizes instead, and retrieval_notice names how to fetch each one. The id and type are present either way.
typeNoEntity type: "item" or "property".
errorNoPresent when the call failed. Absent on success.
labelsNoMap of language code to label string (e.g., {"en": "Barack Obama", "de": "Barack Obama"}).
aliasesNoMap of language code to list of alias strings (e.g., {"en": ["Barack H. Obama", "President Obama"]}).
sectionsNoPresent when kind = outline: the entity's field categories, largest first, each with its byte size. Sizes are additive — a set of categories is only retrievable together if their total fits the budget, so follow retrieval_notice rather than requesting every name listed here.
data_typeNoProperty data type (e.g., "wikibase-item", "external-id"). Present on properties only.
sitelinksNoMap of site code (e.g., "enwiki") to sitelink metadata with title, url, and badges fields.
statementsNoMap of property ID to array of raw statement objects. Use wikidata_get_statements for resolved claims with label resolution, and whenever this entity's statements are large — its properties parameter selects individual P-IDs, granularity fields does not carry.
descriptionsNoMap of language code to description string (e.g., {"en": "44th President of the United States"}).
fieldsReturnedNoWhich fields were requested. In outline mode these are the categories the outline covers, not data returned.
retrieval_noticeNoPresent when kind = outline: the next call to make, and the authoritative one to follow. It names a literal fields set already measured to fit the budget, defers any category that would not fit alongside it, and for a category too large for fields to deliver at all names the sibling tool (wikidata_get_statements, wikidata_get_sitelinks) or the languages parameter that can narrow it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / languages / description
      Previous value: -"Language codes to include in labels, descriptions, and aliases (e.g., [\"en\", \"de\"]). A requested language with no label of its own falls back to the entity's multilingual (\"mul\") value, returned under the requested code. Omit to return all available languages."New value: +"Wikidata language codes to include in labels, descriptions, and aliases (e.g., [\"en\", \"de\"]). Case-insensitive; \"_\" is read as \"-\"; blank entries are dropped. A requested language with no label of its own falls back to the entity's multilingual (\"mul\") value, returned under the requested code. Omit, or send an empty list, to return all available languages."
    • addedInput schema / properties / languages / items / pattern
      Added value: +"^\\s*(?:[A-Za-z]{2,8}(?:[-_][A-Za-z0-9]{1,9})*\\s*)?$"
  2. 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",
      +      "type",
      +      "kind",
      +      "fieldsReturned"
      +    ]
      +  },
      +  {
      +    "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 entity exists at this ID — either unassigned (resource-not-found) or out of range (invalid-path-parameter). `invalid_id`: ID format is not recognized as a Q-ID or P-ID. Other values are possible when a failure originates below the handler.",
      +          "examples": [
      +            "entity_not_found",
      +            "invalid_id"
      +          ],
      +          "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",
      -  "type",
      -  "kind",
      -  "fieldsReturned"
      -]
  3. Changed7 schema fields changed
    • changedInput schema / properties / fields / description
      Previous value: -"Fields to include in the response. Options: \"labels\", \"descriptions\", \"aliases\", \"statements\", \"sitelinks\". Omit for all fields."New value: +"Fields to include. Options: \"labels\", \"descriptions\", \"aliases\", \"statements\", \"sitelinks\". Narrows the upstream fetch as well as the response, so a narrow selection is markedly cheaper. Omit for all fields."
    • changedOutput schema / properties / fieldsReturned / description
      Previous value: -"Which fields are included in this response."New value: +"Which fields were requested. In outline mode these are the categories the outline covers, not data returned."
    • addedOutput schema / properties / kind
      Added value: +{
      +  "description": "full — the requested field categories carry their data. outline — the entity overflowed the inline byte budget, so sections lists the categories with their byte sizes instead, and retrieval_notice names how to fetch each one. The id and type are present either way.",
      +  "enum": [
      +    "full",
      +    "outline"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / properties / retrieval_notice
      Added value: +{
      +  "description": "Present when kind = outline: the next call to make, and the authoritative one to follow. It names a literal fields set already measured to fit the budget, defers any category that would not fit alongside it, and for a category too large for fields to deliver at all names the sibling tool (wikidata_get_statements, wikidata_get_sitelinks) or the languages parameter that can narrow it.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / sections
      Added value: +{
      +  "description": "Present when kind = outline: the entity's field categories, largest first, each with its byte size. Sizes are additive — a set of categories is only retrievable together if their total fits the budget, so follow retrieval_notice rather than requesting every name listed here.",
      +  "items": {
      +    "additionalProperties": false,
      +    "description": "An available field category — its name and the serialized byte size of its data.",
      +    "properties": {
      +      "bytes": {
      +        "description": "Serialized byte size of the section",
      +        "maximum": 9007199254740991,
      +        "minimum": 0,
      +        "type": "integer"
      +      },
      +      "name": {
      +        "description": "Section identifier — pass in `sections` to retrieve it",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "name",
      +      "bytes"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • changedOutput schema / properties / statements / description
      Previous value: -"Map of property ID to array of raw statement objects. Use wikidata_get_statements for resolved claims with label resolution."New value: +"Map of property ID to array of raw statement objects. Use wikidata_get_statements for resolved claims with label resolution, and whenever this entity's statements are large — its properties parameter selects individual P-IDs, granularity fields does not carry."
    • changedOutput schema / required
      Previous value: -[
      -  "id",
      -  "type",
      -  "fieldsReturned"
      -]New value: +[
      +  "id",
      +  "type",
      +  "kind",
      +  "fieldsReturned"
      +]
  4. Changed1 schema field changed
    • changedInput schema / properties / languages / description
      Previous value: -"Language codes to include in labels, descriptions, and aliases (e.g., [\"en\", \"de\"]). Omit to return all available languages."New value: +"Language codes to include in labels, descriptions, and aliases (e.g., [\"en\", \"de\"]). A requested language with no label of its own falls back to the entity's multilingual (\"mul\") value, returned under the requested code. Omit to return all available languages."
  5. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.