Skip to main content
Glama
study-flamingo

D&D MCP Server

get_character

Retrieve detailed Dungeons & Dragons character information by name or ID to support campaign management and gameplay.

Instructions

Get detailed character information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
name_or_idYesCharacter name or ID

Implementation Reference

  • The @mcp.tool-decorated handler function that implements the 'get_character' tool logic. This is the primary entry point for the MCP tool, which fetches character data via storage and returns formatted information. The function signature defines the input schema via Annotated types.
    @mcp.tool
    def get_character(
        name_or_id: Annotated[str, Field(description="Character name or ID")]
    ) -> str:
        """Get detailed character information."""
        character = storage.get_character(name_or_id)
        if not character:
            return f"❌ Character '{name_or_id}' not found."
    
        char_info = f"""**{character.name}** (`{character.id}`)
    Level {character.character_class.level} {character.race.name} {character.character_class.name}
    **Player:** {character.player_name or 'N/A'}
    **Background:** {character.background or 'N/A'}
    **Alignment:** {character.alignment or 'N/A'}
    
    **Description:** {character.description or 'No description provided.'}
    **Bio:** {character.bio or 'No bio provided.'}
    
    **Ability Scores:**
    • STR: {character.abilities['strength'].score} ({character.abilities['strength'].mod:+d})
    • DEX: {character.abilities['dexterity'].score} ({character.abilities['dexterity'].mod:+d})
    • CON: {character.abilities['constitution'].score} ({character.abilities['constitution'].mod:+d})
    • INT: {character.abilities['intelligence'].score} ({character.abilities['intelligence'].mod:+d})
    • WIS: {character.abilities['wisdom'].score} ({character.abilities['wisdom'].mod:+d})
    • CHA: {character.abilities['charisma'].score} ({character.abilities['charisma'].mod:+d})
    
    **Combat Stats:**
    • AC: {character.armor_class}
    • HP: {character.hit_points_current}/{character.hit_points_max}
    • Temp HP: {character.temporary_hit_points}
    
    **Inventory:** {len(character.inventory)} items
    """
    
        return char_info
  • Supporting method in the DnDStorage class that retrieves a Character object by name or ID, used by the main handler.
    def get_character(self, name_or_id: str) -> Character | None:
        """Get a character by name or ID."""
        char = self._find_character(name_or_id)
        if not char:
            logger.error(f"❌ Character '{name_or_id}' not found!")
            return None
        logger.debug(f"✅ Found character '{char.name}'")
        return char
  • The @mcp.tool decorator registers the get_character function as an MCP tool with the name 'get_character'.
    @mcp.tool
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It implies a read-only operation ('Get'), but doesn't specify whether this requires authentication, what happens with invalid inputs, if there are rate limits, or the format of the returned 'detailed information'. For a tool with zero annotation coverage, this is a significant gap in transparency.

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 a single, efficient sentence with no wasted words. It's front-loaded with the core purpose ('Get detailed character information'), making it easy to parse quickly. Every word earns its place, achieving maximum clarity in minimal space.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'detailed character information' includes, how errors are handled, or any behavioral traits. For a tool that likely returns complex character data, this leaves too much unspecified, relying heavily on the agent's inference from the tool name.

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 input schema has 100% description coverage, with the single parameter 'name_or_id' clearly documented. The description doesn't add any parameter-specific details beyond what the schema provides, but with only one parameter and high schema coverage, the baseline is strong. A score of 4 reflects that the description doesn't need to compensate for schema gaps in this case.

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

Purpose3/5

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

The description 'Get detailed character information' clearly states the verb ('Get') and resource ('character information'), but it's vague about what constitutes 'detailed' information and doesn't distinguish this tool from its sibling 'list_characters' or 'update_character'. It provides a basic purpose but lacks specificity about scope or differentiation.

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 offers no guidance on when to use this tool versus alternatives like 'list_characters' (for listing multiple characters) or 'update_character' (for modifying characters). It doesn't mention prerequisites, context, or exclusions, leaving the agent to infer usage based on the tool name alone.

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/study-flamingo/gamemaster-mcp'

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