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

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

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

A4.6/5.0
Behavior5/5

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

Beyond readOnlyHint/openWorldHint, the description discloses the exact result contract (match=<entity>, match=null, multipleMatches on data-integrity conflicts) and explains that invalid property types are rejected rather than returning an empty match. The normalization rules (trim, strip resolver prefixes, uppercase DOIs, strip PMID prefixes, normalize ORCID hyphens) are behavior an agent could not infer from annotations.

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 purpose, then return contract, then join use cases, then constraints and normalization — a logical progression with no filler sentences. It is somewhat dense and repeats P-ID/property examples already present in the schema, which slightly dilutes economy.

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?

An output schema exists so return shape need not be explained, yet the description still states the success/not-found/ambiguous outcomes, covers all three parameters' behavior, and warns about the property-type rejection path. Nothing an agent needs to invoke this correctly is missing.

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 the baseline is 3, but the description adds normalization semantics for value (DOI uppercasing, PMID prefix stripping, ORCID hyphen normalization) that the schema does not state. The property constraint (must be external-id data type) is reinforced with a pointer to wikidata_get_entity for checking unknown P-IDs, though the P-ID examples duplicate the schema.

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+resource ("Look up a Wikidata entity by an external identifier") and scopes it precisely to external-id lookups such as DOI, PMID, ORCID, and OpenAlex ID. This clearly separates it from siblings like wikidata_get_entity (QID lookup) and wikidata_search_entities (label search).

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 when-to-use context via the cross-server join use cases (DOI → QID P356, PMID → P698, ORCID → P496, OpenAlex → P10283) and a clear when-not: properties that are not external-id type are rejected. It never names a sibling tool as the alternative to use instead when you lack an external ID, so an explicit routing statement is missing.

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.