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, OpenAlex ID, or IMDb 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. The identifier matches through statements of every rank — entities holding it at best rank first, then at another non-deprecated rank, then deprecated — and each match reports the rank of the statement it was found through. The lookup searches both the main Wikidata graph and the scholarly-article graph, where scholarly articles and the DOIs and PubMed IDs on them live; when one does not answer, the result covers the other, with unavailableGraphs naming the one missed. 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 forms are normalized automatically. Surrounding whitespace is trimmed. Resolver prefixes are stripped, in any case and with https://, http://, or no scheme: doi.org/, dx.doi.org/, www.doi.org/, and doi: for DOIs; pubmed.ncbi.nlm.nih.gov/, www.ncbi.nlm.nih.gov/pubmed/, and PMID: for PubMed IDs; orcid.org/, www.orcid.org/, and orcid: for ORCID iDs; openalex.org/ and api.openalex.org/ with an optional entity path for OpenAlex IDs; and the title, name, company, and event pages of imdb.com, www.imdb.com, and m.imdb.com for IMDb IDs; ror.org/ for ROR; and arxiv.org/abs/ or arXiv: for arXiv. PMC is stripped from numeric PMCIDs, and ISNI values displayed in four space-separated groups are compacted. DOIs are uppercased, ORCID iDs regrouped with hyphens and an uppercase X check character, and IMDb IDs lowercased. An OpenAlex ID is stored with its entity letter in either case, so it is tried as given and then with that letter in the other case.

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": {
      "property": "<property>",
      "value": "<value>"
    },
    "name": "wikidata_resolve_external_id"
  }
}

Input 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, "A5035517966" for an OpenAlex ID, "tt0111161" for an IMDb ID). Accepts resolver or page URLs for DOI, PubMed, ORCID, OpenAlex, IMDb, and ROR, and abs URLs for arXiv. Also accepts PMC-prefixed PMCIDs, four space-separated ISNI groups, and arXiv: labels.
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

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). The identifier matches through statements of every rank, from the best tier any entity holds it at: best-rank statements first, then other non-deprecated ones, then deprecated ones. 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, and a graph named in unavailableGraphs was not searched.
valueNoThe normalized value that was searched (may differ from input due to canonicalization). An identifier stored in more than one form — an OpenAlex ID with its entity letter in either case, an IMDb ceremony with or without its number — is also looked up in its other form, which matches only when no entity holds this one.
noticeNoPresent when a graph did not answer (unavailableGraphs names it), or when more than 5 entities claim the identifier, so multipleMatches lists only 5 of them — saying what the result leaves out and how to get it.
propertyNoThe P-ID used for the lookup.
multipleMatchesNoPresent when more than one Wikidata entity claims this external ID at the same rank tier (data integrity issue), listing at most 5; the notice says when more claim it. match is null when this field is present. Inspect the list and select the correct QID manually.
unavailableGraphsNoPresent when one of the two graphs the lookup searches did not answer in time or could not be reached. The result covers the other graph only — an entity held in the named graph would not appear — so retry for a complete answer. Absent when both answered.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • 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, \"A5035517966\" for an OpenAlex ID, \"tt0111161\" for an IMDb ID). A resolver or page URL is accepted for DOI, PubMed, ORCID, OpenAlex, and IMDb IDs — the prefix is stripped before lookup."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, \"A5035517966\" for an OpenAlex ID, \"tt0111161\" for an IMDb ID). Accepts resolver or page URLs for DOI, PubMed, ORCID, OpenAlex, IMDb, and ROR, and abs URLs for arXiv. Also accepts PMC-prefixed PMCIDs, four space-separated ISNI groups, and arXiv: labels."
  2. Changed9 schema fields changed
    • 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). A resolver URL is accepted for DOI, PubMed, and ORCID — the prefix is stripped before lookup."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, \"A5035517966\" for an OpenAlex ID, \"tt0111161\" for an IMDb ID). A resolver or page URL is accepted for DOI, PubMed, ORCID, OpenAlex, and IMDb IDs — the prefix is stripped before lookup."
    • 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, 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"
      -  }
      -]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"
      +      },
      +      "rank": {
      +        "description": "Rank of the statement through which the entity holds this identifier. \"deprecated\" means Wikidata marks the identifier as no longer valid for the entity — often a retired or mistaken ID.",
      +        "enum": [
      +          "preferred",
      +          "normal",
      +          "deprecated"
      +        ],
      +        "type": "string"
      +      },
      +      "url": {
      +        "description": "Wikidata entity page URL (e.g., \"https://www.wikidata.org/wiki/Q12345\").",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "id",
      +      "label",
      +      "description",
      +      "url",
      +      "rank"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • 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). 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."New value: +"Matching entity, or null when no Wikidata entity claims this external identifier (including the case where multipleMatches is populated). The identifier matches through statements of every rank, from the best tier any entity holds it at: best-rank statements first, then other non-deprecated ones, then deprecated ones. 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, and a graph named in unavailableGraphs was not searched."
    • changedOutput schema / properties / multipleMatches / description
      Previous value: -"Present 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."New value: +"Present when more than one Wikidata entity claims this external ID at the same rank tier (data integrity issue), listing at most 5; the notice says when more claim it. match is null when this field is present. Inspect the list and select the correct QID manually."
    • addedOutput schema / properties / multipleMatches / items / properties / rank
      Added value: +{
      +  "description": "Rank of the statement through which this entity holds the identifier.",
      +  "enum": [
      +    "preferred",
      +    "normal",
      +    "deprecated"
      +  ],
      +  "type": "string"
      +}
    • changedOutput schema / properties / multipleMatches / items / required
      Previous value: -[
      -  "id",
      -  "label"
      -]New value: +[
      +  "id",
      +  "label",
      +  "rank"
      +]
    • addedOutput schema / properties / notice
      Added value: +{
      +  "description": "Present when a graph did not answer (unavailableGraphs names it), or when more than 5 entities claim the identifier, so multipleMatches lists only 5 of them — saying what the result leaves out and how to get it.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / unavailableGraphs
      Added value: +{
      +  "description": "Present when one of the two graphs the lookup searches did not answer in time or could not be reached. The result covers the other graph only — an entity held in the named graph would not appear — so retry for a complete answer. Absent when both answered.",
      +  "items": {
      +    "description": "A graph that did not answer: \"wikidata_main\" (everything but scholarly articles) or \"scholarly_articles\" (scholarly articles and their DOIs, PubMed IDs, and other identifiers).",
      +    "enum": [
      +      "wikidata_main",
      +      "scholarly_articles"
      +    ],
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedOutput schema / properties / value / description
      Previous value: -"The normalized value that was searched (may differ from input due to canonicalization)."New value: +"The normalized value that was searched (may differ from input due to canonicalization). An identifier stored in more than one form — an OpenAlex ID with its entity letter in either case, an IMDb ceremony with or without its number — is also looked up in its other form, which matches only when no entity holds this one."
  3. 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"
      +  }
      +]
  4. 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"
      -]
  5. 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."
  6. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare readOnly/openWorld, but the description adds substantive behavior: the match/match=null/multipleMatches return contract, the data-integrity multi-claim case, rank-based tie-breaking (best, then non-deprecated, then deprecated), dual-graph search with unavailableGraphs naming a missed graph, and rejection of non-external-id properties. This is context an agent could not infer from the annotations.

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

Conciseness3/5

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

The purpose, return contract, and join use cases are front-loaded and earn their space, but the closing normalization paragraph is long and partly duplicates what the value parameter schema already says (resolver URLs, PMC prefix, ISNI groups, arXiv labels). At roughly 400 words for a 3-parameter lookup, some trimming is warranted.

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, return values need not be detailed, yet the description still clarifies the ambiguous conditions (multipleMatches, unavailableGraphs, rank attribution) that an agent must interpret. Given the side conditions — external-id-type requirement and graph coverage — nothing needed to call or interpret the tool is missing.

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

Parameters5/5

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

Schema coverage is already 100%, but the description goes well beyond it by specifying normalization semantics: resolver-prefix and scheme stripping for each identifier family, PMCID/ISNI compaction, DOI uppercasing, ORCID regrouping with X checksum handling, IMDb lowercasing, and the two-pass OpenAlex letter-case retry. That meaning directly affects whether a call succeeds with raw URL inputs.

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?

States a specific verb and resource — resolve an external identifier (DOI, PMID, ORCID, OpenAlex, IMDb) to a Wikidata entity — which is clearly distinguishable from sibling QID-based tools (wikidata_get_entity) and text search (wikidata_search_entities). An agent can pick this tool without opening the schema.

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 join scenarios (CrossRef DOI → P356, PMID → P698, ORCID → P496, OpenAlex → P10283) and a hard constraint that the property's data type must be external-id, routing agents to wikidata_get_entity to verify unfamiliar P-IDs. It stops short of explicitly naming the alternatives it replaces (e.g., search_entities when only a free-text name is known), so it is strong but not fully explicit.

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.