Skip to main content
Glama

get_character

Retrieve detailed character information for Dungeons & Dragons campaigns by providing character name, ID, or player name to access character sheets and game data.

Instructions

Get detailed character information. Accepts character name, ID, or player name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
name_or_idYesCharacter name, ID, or player name

Implementation Reference

  • The get_character method in the PartyServer class handles the '/character/{player_id}' GET route. It validates the user token, checks for permission using a PermissionResolver, and fetches character data from storage.
    async def get_character(self, request: Request) -> Response:
        """
        Get character data for a specific player.
    
        Validates token and checks permissions before returning character data.
    
        Args:
            request: Starlette request object
    
        Returns:
            JSON response with character data or error
        """
        player_id = request.path_params.get("player_id")
        if not player_id:
            return JSONResponse({"error": "Missing player_id"}, status_code=400)
    
        # Validate token
        token = request.query_params.get("token", "")
        requesting_player = self.token_manager.validate_token(token)
        if not requesting_player:
            return JSONResponse({"error": "Unauthorized"}, status_code=401)
    
        # Check permission
        allowed = self.permission_resolver.check_permission(
            requesting_player,
            "get_character",
            player_id
        )
        if not allowed:
            return JSONResponse(
                {"error": "Permission denied"},
                status_code=403
            )
    
        # Get character data from storage
        try:
            character = self.storage.get_character(player_id)
            # Use mode='json' to handle datetime and other non-standard types
            return JSONResponse(character.model_dump(mode='json'))
        except Exception as e:
            logger.error(f"Failed to get character {player_id}: {e}")
            return JSONResponse(
                {"error": f"Character not found: {e}"},
                status_code=404
            )
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It states it 'gets' information (implying read-only) but doesn't disclose permissions needed, rate limits, error conditions, or what 'detailed' means. For a tool with zero annotation coverage, this leaves significant behavioral gaps unaddressed.

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 extremely concise with just two sentences that directly state purpose and parameter acceptance. Every word earns its place with zero waste or redundancy. It's appropriately sized for a simple lookup tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read operation with 100% schema coverage but no annotations or output schema, the description is minimally adequate. It states what the tool does but lacks behavioral context, usage guidance, and output information. Given the tool's relative simplicity compared to more complex siblings, it's borderline viable but has clear gaps.

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 the single parameter 'name_or_id' with description 'Character name, ID, or player name'. The description adds no additional parameter semantics beyond restating this same information. Baseline 3 is appropriate when schema does the heavy lifting.

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 detailed character information' with a specific verb ('Get') and resource ('character information'). It distinguishes from siblings like 'list_characters' (which lists multiple) and 'create_character' (which creates new), but doesn't explicitly differentiate from 'get_campaign_info' or 'get_npc' which have similar 'get' patterns for other resources.

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 doesn't mention when to use 'get_character' versus 'list_characters' (for overview vs details) or 'get_campaign_info' (for campaign vs character data). There are no explicit when/when-not instructions or named alternatives provided.

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/Polloinfilzato/dm20-protocol'

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