Skip to main content
Glama

Get Wikidata Labels

wikidata_get_labels
Read-only

Resolve one or more QIDs or PIDs to their human-readable labels and descriptions. Lightweight — returns no claim data. Supports up to 50 IDs per call (batched automatically). Designed for the common agent pattern: receive QIDs from a SPARQL query, then humanize them.

Input Schema

NameRequiredDescriptionDefault
idsYesQ-IDs (e.g., "Q76") or P-IDs (e.g., "P31") to resolve. 1–50 IDs per call.
languagesNoWikidata language codes for returned labels and descriptions (e.g., ["en", "de", "fr"]). Case-insensitive; "_" is read as "-"; blank entries are dropped, and an empty list means ["en"]. A language with no label of its own falls back to the entity's multilingual ("mul") value, returned under the requested code.

Output Schema

NameRequiredDescriptionDefault
errorNoPresent when the call failed. Absent on success.
foundNoCount of IDs that returned data.
entitiesNoMap of entity ID to labels and descriptions. IDs that were not found are absent.
notFoundNoIDs from the request that did not return data (not found or invalid).
languagesNoThe language codes that were requested.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedInput schema / properties / languages / description
      Previous value: -"BCP 47 language codes for returned labels and descriptions (e.g., [\"en\", \"de\", \"fr\"]). A language with no label of its own falls back to the entity's multilingual (\"mul\") value, returned under the requested code."New value: +"Wikidata language codes for returned labels and descriptions (e.g., [\"en\", \"de\", \"fr\"]). Case-insensitive; \"_\" is read as \"-\"; blank entries are dropped, and an empty list means [\"en\"]. A language with no label of its own falls back to the entity's multilingual (\"mul\") value, returned under the requested code."
    • removedInput schema / properties / languages / items / minLength
      Removed value: -1
    • addedInput schema / properties / languages / items / pattern
      Added value: +"^\\s*(?:[A-Za-z]{2,8}(?:[-_][A-Za-z0-9]{1,9})*\\s*)?$"
    • removedInput schema / properties / languages / minItems
      Removed value: -1
  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": [
      +      "entities",
      +      "found",
      +      "notFound",
      +      "languages"
      +    ]
      +  },
      +  {
      +    "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_ids`: One or more IDs in the array are not valid Q-IDs or P-IDs. Other values are possible when a failure originates below the handler.",
      +          "examples": [
      +            "invalid_ids"
      +          ],
      +          "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: -[
      -  "entities",
      -  "found",
      -  "notFound",
      -  "languages"
      -]
  3. Changed1 schema field changed
    • changedInput schema / properties / languages / description
      Previous value: -"BCP 47 language codes for returned labels and descriptions (e.g., [\"en\", \"de\", \"fr\"])."New value: +"BCP 47 language codes for returned labels and descriptions (e.g., [\"en\", \"de\", \"fr\"]). A language with no label of its own falls back to the entity's multilingual (\"mul\") value, returned under the requested code."
  4. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations cover safety (readOnlyHint, openWorldHint), and the description adds real behavioral context beyond them: automatic batching up to 50 IDs, and the fact that no claim data is returned. It does not mention behavior for unknown/missing QIDs or any rate limits, which keeps it out of the top score.

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 the core action ('Resolve ... to labels and descriptions') and kept to four short sentences with no filler. The 50-ID batching point is stated twice in effect (description and schema), a minor redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present, the description needn't explain return shape; it still adds the key distinction that only labels/descriptions come back and that IDs are batched. The only gap is behavior for unresolvable IDs, a minor omission for a 2-parameter read tool.

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

Parameters3/5

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

Schema description coverage is 100%, and the schema already documents the 1–50 ID range and language fallback semantics in detail, so the baseline is 3. The description's mention of '50 IDs per call (batched automatically)' restates the maxItems constraint rather than adding new parameter meaning.

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 ('Resolve') and resource (QIDs/PIDs to labels and descriptions), and explicitly delimits scope with 'Lightweight — returns no claim data', which separates it from wikidata_get_entity and wikidata_get_statements. An agent can pick this over its siblings without opening any 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 a clear usage context — 'receive QIDs from a SPARQL query, then humanize them' — which is exactly the pipeline an agent would be in after wikidata_sparql_query. It never names an alternative tool or states when NOT to use this (e.g., when claims are needed), so it stops short of a 5.

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.