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.
        """
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses the return format ('list of property IDs') and edge-case behavior ('empty list if no properties found'), which is useful. However, it lacks details on permissions, rate limits, or error handling, which are important for a read operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and front-loaded with the purpose, followed by clear sections for arguments and returns. Every sentence adds value without redundancy, making it efficient and easy to parse.

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?

Given the tool's simplicity (one parameter, no output schema, no annotations), the description is mostly complete. It covers the purpose, parameter semantics, and return behavior. However, it lacks usage guidelines and some behavioral details like error cases, which slightly reduces completeness.

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

Parameters4/5

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

The description adds significant meaning beyond the input schema, which has 0% coverage. It explains that 'entity_id' is a 'valid Wikidata entity ID' and specifies its purpose. Since there is only one parameter, the description adequately compensates for the schema's lack of detail, though it could provide examples or format constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get the properties associated with a given Wikidata entity ID.' It specifies the verb ('Get') and resource ('properties'), but does not explicitly differentiate it from sibling tools like 'get_metadata' or 'search_property', which might have overlapping functionality.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It does not mention sibling tools like 'search_entity' or 'search_property', nor does it specify prerequisites or exclusions. Usage is implied by the purpose but not explicitly stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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