Skip to main content
Glama
zzaebok

Wikidata MCP Server

by zzaebok

get_properties

Retrieve property IDs linked to a specific Wikidata entity ID using this tool. Input the entity ID to receive a list of associated property IDs, returning an empty list if none exist.

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' MCP tool. It retrieves the list of property IDs associated with a given Wikidata entity ID by querying the Wikidata API's wbgetentities endpoint with claims props. The function is registered via @server.tool() decorator.
    @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())

Other Tools

Related Tools

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