Skip to main content
Glama

get_character

Retrieve existing D&D 5e character data by ID or name to access character sheets and stats for role-playing games.

Instructions

Retrieve an existing D&D 5e character by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
characterIdNo
characterNameNo
batchNo

Implementation Reference

  • Registration of the 'get_character' tool in toolRegistry. Defines name, description, converts getCharacterSchema to JSON schema for input validation, and provides a handler that parses arguments with getCharacterSchema and executes getCharacter function, returning formatted markdown success or error.
    get_character: {
      name: 'get_character',
      description: 'Retrieve an existing D&D 5e character by ID',
      inputSchema: toJsonSchema(getCharacterSchema),
      handler: async (args) => {
        try {
          const validated = getCharacterSchema.parse(args);
          const result = getCharacter(validated);
    
          if (!result.success) {
            return error(result.error || 'Failed to retrieve character');
          }
    
          return success(result.markdown);
        } catch (err) {
          if (err instanceof z.ZodError) {
            const messages = err.errors.map(e => `${e.path.join('.')}: ${e.message}`).join(', ');
            return error(`Validation failed: ${messages}`);
          }
          const message = err instanceof Error ? err.message : String(err);
          return error(message);
        }
      },
    },
  • The main handler function for the get_character tool. Validates input arguments using getCharacterSchema, calls the getCharacter helper with validated args, and returns success with markdown or error based on result.
    handler: async (args) => {
      try {
        const validated = getCharacterSchema.parse(args);
        const result = getCharacter(validated);
    
        if (!result.success) {
          return error(result.error || 'Failed to retrieve character');
        }
    
        return success(result.markdown);
      } catch (err) {
        if (err instanceof z.ZodError) {
          const messages = err.errors.map(e => `${e.path.join('.')}: ${e.message}`).join(', ');
          return error(`Validation failed: ${messages}`);
        }
        const message = err instanceof Error ? err.message : String(err);
        return error(message);
      }
    },
  • Import of getCharacterSchema (Zod schema for input validation) and getCharacter (core handler function) from './modules/characters.js'.
    getCharacter,
    getCharacterSchema,
Behavior2/5

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

With no annotations, the description carries full burden but only states it retrieves existing characters. It doesn't disclose behavioral traits such as error handling (e.g., what happens if the ID doesn't exist), authentication needs, rate limits, or the return format. This is inadequate for a tool with multiple parameters and no output schema.

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 that front-loads the core purpose without unnecessary words. Every part earns its place, making it easy to parse quickly.

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 complexity (3 parameters, 0% schema coverage, no output schema, no annotations), the description is incomplete. It doesn't cover all retrieval methods, lacks behavioral details, and provides no output information, making it insufficient for an agent to use the tool effectively without guessing.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate but only mentions retrieval by ID. It ignores two other parameters (characterName and batch) entirely, failing to explain their purpose or how they relate to the ID-based retrieval. This leaves significant gaps in understanding the tool's functionality.

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 action ('Retrieve') and resource ('D&D 5e character'), specifying it's for existing characters by ID. However, it doesn't differentiate from sibling tools like 'get_encounter' or 'get_session_context' beyond the resource type, and the input schema suggests additional retrieval methods (by name or batch) not mentioned in the description.

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a character ID), exclusions, or comparisons to siblings like 'update_character' or 'create_character', leaving the agent to infer usage from the 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/Mnehmos/ChatRPG'

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