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

TableJSON 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

TableJSON 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

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.