Skip to main content
Glama

Search Wikidata Entities

wikidata_search_entities
Read-only

Search Wikidata for items or properties by text query. Returns QIDs or PIDs with labels, descriptions, and match metadata indicating whether the hit was on a label or alias. Use type="item" for real-world concepts (people, places, works) and type="property" to find predicate P-IDs. The API returns no total count — pagination is offset-based with no result ceiling indicator.

Input Schema

NameRequiredDescriptionDefault
typeNoEntity type to search. Use "item" for Q-IDs (people, places, concepts) or "property" for P-IDs (predicates).item
limitNoMaximum number of results to return. Range: 1–50.
queryYesSearch terms to match against entity labels, aliases, and descriptions.
offsetNoPagination offset. Start at 0; increment by limit to page through results.
languageNoWikidata language code for returned labels and descriptions (e.g., "en", "de", "zh-hant"). Case-insensitive; "_" is read as "-"; blank means "en".en

Output Schema

NameRequiredDescriptionDefault
capNoThe limit parameter in effect.
errorNoPresent when the call failed. Absent on success.
shownNoNumber of results returned on this page.
noticeNoRecovery hint when results are empty — echoes filters and suggests how to broaden. Absent when results are present.
resultsNoRanked list of matching entities. Empty when no results found.
languageNoThe language used for label and description display.
truncatedNoTrue when results were capped at the limit. The Wikidata search API returns no total count — use offset pagination to retrieve more.
searchTypeNoThe entity type that was searched ("item" or "property").
effectiveQueryNoThe search query that was executed.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedInput schema / properties / language / description
      Previous value: -"BCP 47 language code for returned labels and descriptions (e.g., \"en\", \"de\", \"zh\")."New value: +"Wikidata language code for returned labels and descriptions (e.g., \"en\", \"de\", \"zh-hant\"). Case-insensitive; \"_\" is read as \"-\"; blank means \"en\"."
    • addedInput schema / properties / language / pattern
      Added value: +"^\\s*(?:[A-Za-z]{2,8}(?:[-_][A-Za-z0-9]{1,9})*\\s*)?$"
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode."New value: +"Machine-readable failure mode. Declared by this tool: `invalid_search_parameter`: The search endpoint refused a request parameter, in practice a language it does not search in such as \"mul\". Other values are possible when a failure originates below the handler."
    • addedOutput schema / properties / error / properties / data / properties / reason / examples
      Added value: +[
      +  "invalid_search_parameter"
      +]
  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": [
      +      "results",
      +      "effectiveQuery",
      +      "searchType",
      +      "language",
      +      "shown",
      +      "cap"
      +    ]
      +  },
      +  {
      +    "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.",
      +          "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: -[
      -  "results",
      -  "effectiveQuery",
      -  "searchType",
      -  "language",
      -  "shown",
      -  "cap"
      -]
  3. Changed5 schema fields changed
    • addedOutput schema / properties / cap
      Added value: +{
      +  "description": "The limit parameter in effect.",
      +  "type": "number"
      +}
    • removedOutput schema / properties / resultCount
      Removed value: -{
      -  "description": "Number of results returned on this page.",
      -  "type": "number"
      -}
    • addedOutput schema / properties / shown
      Added value: +{
      +  "description": "Number of results returned on this page.",
      +  "type": "number"
      +}
    • addedOutput schema / properties / truncated
      Added value: +{
      +  "description": "True when results were capped at the limit. The Wikidata search API returns no total count — use offset pagination to retrieve more.",
      +  "type": "boolean"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "results",
      -  "effectiveQuery",
      -  "searchType",
      -  "language",
      -  "resultCount"
      -]New value: +[
      +  "results",
      +  "effectiveQuery",
      +  "searchType",
      +  "language",
      +  "shown",
      +  "cap"
      +]
  4. Changed8 schema fields changed
    • addedOutput schema / properties / effectiveQuery
      Added value: +{
      +  "description": "The search query that was executed.",
      +  "type": "string"
      +}
    • removedOutput schema / properties / message
      Removed value: -{
      -  "description": "Recovery hint when results are empty — suggests how to broaden the query. Absent when results are present.",
      -  "type": "string"
      -}
    • addedOutput schema / properties / notice
      Added value: +{
      +  "description": "Recovery hint when results are empty — echoes filters and suggests how to broaden. Absent when results are present.",
      +  "type": "string"
      +}
    • removedOutput schema / properties / query
      Removed value: -{
      -  "description": "The search query that was executed.",
      -  "type": "string"
      -}
    • addedOutput schema / properties / resultCount
      Added value: +{
      +  "description": "Number of results returned on this page.",
      +  "type": "number"
      +}
    • addedOutput schema / properties / searchType
      Added value: +{
      +  "description": "The entity type that was searched (\"item\" or \"property\").",
      +  "type": "string"
      +}
    • removedOutput schema / properties / type
      Removed value: -{
      -  "description": "The entity type that was searched (\"item\" or \"property\").",
      -  "type": "string"
      -}
    • changedOutput schema / required
      Previous value: -[
      -  "results",
      -  "query",
      -  "type",
      -  "language"
      -]New value: +[
      +  "results",
      +  "effectiveQuery",
      +  "searchType",
      +  "language",
      +  "resultCount"
      +]
  5. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered. The description adds genuinely non-obvious behavior: there is no total count and pagination is offset-based with no result ceiling indicator, which prevents the agent from assuming it can detect the end of results. It could still say more about result ordering or rate limits.

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?

Four tight sentences with the core purpose front-loaded and the pagination caveat placed after the usage guidance. No filler, though the return-format sentence is partially redundant given the output schema exists.

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 annotations, a full schema, and an output schema present, the description fills the remaining gaps: which type to choose for a given need and the pagination/total-count limitation. An agent has everything needed to call this correctly.

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%, so the schema already documents all five parameters including the type enum and offset semantics. The description's type guidance and pagination caveat largely restate the schema; baseline 3 is appropriate.

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 (search) and resource (Wikidata entities) and enumerates the return shape (QIDs/PIDs with labels, descriptions, match metadata). It is clearly distinguishable from siblings like wikidata_get_entity or wikidata_sparql_query, which retrieve or query rather than text-search.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description tells the agent when to use type="item" vs type="property", which is useful selection guidance. However, it never mentions the sibling alternatives (e.g., wikidata_get_entity once you have an ID, or wikidata_sparql_query for structured queries), so the routing guidance is implied rather than 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.