Skip to main content
Glama
zzaebok

Wikidata MCP Server

by zzaebok

get_properties

Retrieve property IDs for a Wikidata entity to access its structured data attributes and relationships.

Instructions

Get the properties associated with a given Wikidata entity ID. Args: entity_id (str): The entity ID to retrieve properties for. This should be a valid Wikidata entity ID. Returns: list: A list of property IDs associated with the given entity ID. If no properties are found, an empty list is returned.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entity_idYes

Implementation Reference

  • The handler function for the 'get_properties' tool. It queries the Wikidata API using wbgetentities to retrieve the claims (properties) for the given entity_id and returns a list of property IDs.
    @server.tool() async def get_properties(entity_id: str) -> List[str]: """ Get the properties associated with a given Wikidata entity ID. Args: entity_id (str): The entity ID to retrieve properties for. This should be a valid Wikidata entity ID. Returns: list: A list of property IDs associated with the given entity ID. If no properties are found, an empty list is returned. """ params = { "action": "wbgetentities", "ids": entity_id, "props": "claims", "format": "json", } async with httpx.AsyncClient() as client: response = await client.get(WIKIDATA_URL, headers=HEADER, params=params) response.raise_for_status() data = response.json() return list(data.get("entities", {}).get(entity_id, {}).get("claims", {}).keys())
  • src/server.py:66-66 (registration)
    Registration of the 'get_properties' tool using the FastMCP server's tool decorator.
    @server.tool()
  • Input schema (entity_id: str) and output type (List[str]) defined in function signature and docstring.
    async def get_properties(entity_id: str) -> List[str]: """ Get the properties associated with a given Wikidata entity ID. Args: entity_id (str): The entity ID to retrieve properties for. This should be a valid Wikidata entity ID. Returns: list: A list of property IDs associated with the given entity ID. If no properties are found, an empty list is returned. """

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zzaebok/mcp-wikidata'

If you have feedback or need assistance with the MCP directory API, please join our Discord server