Skip to main content
Glama

Resolve Wikidata External ID

wikidata_resolve_external_id
Read-only

Look up a Wikidata entity by an external identifier such as a DOI, PubMed ID, ORCID iD, or OpenAlex ID. Returns match= on success, match=null when not found, and match=null with multipleMatches populated when a Wikidata data integrity issue causes more than one entity to claim the same external ID. Common cross-server join use cases: CrossRef DOI → Wikidata paper QID (P356), PubMed PMID → Wikidata paper QID (P698), ORCID → author QID (P496), OpenAlex ID → entity QID (P10283). The property must be one whose Wikidata data type is external-id — item-valued or media properties (e.g. P31 instance-of, P18 image) are rejected rather than returning an empty match. Known value normalization is applied automatically: surrounding whitespace is trimmed, identifier-resolver URL prefixes are stripped (https://doi.org/, https://pubmed.ncbi.nlm.nih.gov/, https://orcid.org/), DOIs are uppercased, PMID prefixes stripped, ORCID hyphens normalized.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
valueYesThe external identifier value to look up (e.g., "10.1038/nature01234" for a DOI, "32283226" for a PubMed ID, "0000-0002-1825-0097" for an ORCID). A resolver URL is accepted for DOI, PubMed, and ORCID — the prefix is stripped before lookup.
languageNoWikidata language code for the label and description in the response (e.g., "en", "de"). Case-insensitive; "_" is read as "-"; blank means "en". An entity with no label in this language returns its multilingual ("mul") label.en
propertyYesP-ID of the external identifier property, whose Wikidata data type must be external-id (e.g., "P356" for DOI, "P698" for PubMed ID, "P496" for ORCID, "P10283" for OpenAlex ID, "P345" for IMDb ID). Properties of any other data type are rejected — check an unfamiliar P-ID's data type with wikidata_get_entity.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNoPresent when the call failed. Absent on success.
matchNoMatching entity, or null when no Wikidata entity claims this external identifier (including the case where multipleMatches is populated). A null match is not proof of absence — the Query Service backing this lookup lags the live wiki, so a recently added identifier may not be indexed yet.
valueNoThe normalized value that was searched (may differ from input due to canonicalization).
propertyNoThe P-ID used for the lookup.
multipleMatchesNoPresent when more than one Wikidata entity claims this external ID (data integrity issue). match is null when this field is present. Inspect the list and select the correct QID manually.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / language / description
      Previous value: -"Language code for label and description in the response (e.g., \"en\", \"de\")."New value: +"Wikidata language code for the label and description in the response (e.g., \"en\", \"de\"). Case-insensitive; \"_\" is read as \"-\"; blank means \"en\". An entity with no label in this language returns its multilingual (\"mul\") label."
    • addedInput schema / properties / language / pattern
      Added value: +"^\\s*(?:[A-Za-z]{2,8}(?:[-_][A-Za-z0-9]{1,9})*\\s*)?$"
    • changedOutput schema / properties / match / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "description": {
      -        "description": "Short description in the requested language, or empty string if unavailable.",
      -        "type": "string"
      -      },
      -      "id": {
      -        "description": "Wikidata Q-ID of the matching entity (e.g., \"Q12345\").",
      -        "type": "string"
      -      },
      -      "label": {
      -        "description": "Display label in the requested language, or empty string if unavailable.",
      -        "type": "string"
      -      },
      -      "url": {
      -        "description": "Wikidata entity page URL (e.g., \"https://www.wikidata.org/wiki/Q12345\").",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "id",
      -      "label",
      -      "description",
      -      "url"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "description": {
      +        "description": "Short description in the requested language, or empty string if unavailable.",
      +        "type": "string"
      +      },
      +      "id": {
      +        "description": "Wikidata Q-ID of the matching entity (e.g., \"Q12345\").",
      +        "type": "string"
      +      },
      +      "label": {
      +        "description": "Display label in the requested language, else the multilingual (\"mul\") label, or empty string if neither exists.",
      +        "type": "string"
      +      },
      +      "url": {
      +        "description": "Wikidata entity page URL (e.g., \"https://www.wikidata.org/wiki/Q12345\").",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "id",
      +      "label",
      +      "description",
      +      "url"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
  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": [
      +      "match",
      +      "property",
      +      "value"
      +    ]
      +  },
      +  {
      +    "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: `invalid_property`: Property ID is not in P+digits format. `not_external_id_property`: Property does not exist on Wikidata, or its data type is not external-id. Other values are possible when a failure originates below the handler.",
      +          "examples": [
      +            "invalid_property",
      +            "not_external_id_property"
      +          ],
      +          "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: -[
      -  "match",
      -  "property",
      -  "value"
      -]
  3. Changed3 schema fields changed
    • changedInput schema / properties / property / description
      Previous value: -"P-ID of the external identifier property (e.g., \"P356\" for DOI, \"P698\" for PubMed ID, \"P496\" for ORCID, \"P10283\" for OpenAlex ID, \"P345\" for IMDb ID)."New value: +"P-ID of the external identifier property, whose Wikidata data type must be external-id (e.g., \"P356\" for DOI, \"P698\" for PubMed ID, \"P496\" for ORCID, \"P10283\" for OpenAlex ID, \"P345\" for IMDb ID). Properties of any other data type are rejected — check an unfamiliar P-ID's data type with wikidata_get_entity."
    • changedInput schema / properties / value / description
      Previous value: -"The external identifier value to look up (e.g., \"10.1038/nature01234\" for a DOI, \"32283226\" for a PubMed ID, \"0000-0002-1825-0097\" for an ORCID)."New value: +"The external identifier value to look up (e.g., \"10.1038/nature01234\" for a DOI, \"32283226\" for a PubMed ID, \"0000-0002-1825-0097\" for an ORCID). A resolver URL is accepted for DOI, PubMed, and ORCID — the prefix is stripped before lookup."
    • changedOutput schema / properties / match / description
      Previous value: -"Matching entity, or null when no Wikidata entity claims this external identifier (including the case where multipleMatches is populated)."New value: +"Matching entity, or null when no Wikidata entity claims this external identifier (including the case where multipleMatches is populated). A null match is not proof of absence — the Query Service backing this lookup lags the live wiki, so a recently added identifier may not be indexed yet."
  4. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.