Skip to main content
Glama

update_character

Modify existing D&D 5e character attributes including stats, level, equipment, spells, and abilities to reflect gameplay changes and progression.

Instructions

Update an existing D&D 5e character with new stats, HP, level, equipment, etc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
characterIdNo
characterNameNo
nameNo
raceNo
classNo
levelNo
backgroundNo
characterTypeNo
statsNo
hpNo
healingNo
maxHpNo
acNo
speedNo
resistancesNo
immunitiesNo
vulnerabilitiesNo
conditionImmunitiesNo
spellcastingAbilityNo
knownSpellsNo
preparedSpellsNo
cantripsNo
skillProficienciesNo
saveProficienciesNo
equipmentNo
customClassNo
customRaceNo
resourceNo
batchNo

Implementation Reference

  • Registration of the 'update_character' tool, specifying name, description, input schema (referencing updateCharacterSchema), and inline handler function that validates arguments and delegates to updateCharacter function.
    update_character: {
      name: 'update_character',
      description: 'Update an existing D&D 5e character with new stats, HP, level, equipment, etc.',
      inputSchema: toJsonSchema(updateCharacterSchema),
      handler: async (args) => {
        try {
          const validated = updateCharacterSchema.parse(args);
          const result = updateCharacter(validated);
    
          if (!result.success) {
            return error(result.error || 'Failed to update 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 tool handler implementation: parses input using updateCharacterSchema, calls the core updateCharacter function with validated args, handles success/error responses with markdown formatting using success/error helpers.
    handler: async (args) => {
      try {
        const validated = updateCharacterSchema.parse(args);
        const result = updateCharacter(validated);
    
        if (!result.success) {
          return error(result.error || 'Failed to update 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);
      }
Behavior2/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 of behavioral disclosure. While 'update' implies a mutation operation, the description doesn't state whether this requires specific permissions, what happens to existing data not mentioned in the update, whether changes are reversible, or any rate limits. For a complex mutation tool with 29 parameters and no annotation coverage, this is a significant gap in behavioral context.

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

Conciseness4/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. It avoids unnecessary words and directly states what the tool does. However, given the tool's complexity (29 parameters, nested objects), more detail might be warranted, but this doesn't detract from its conciseness.

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 high complexity (29 parameters, nested objects, no output schema, and no annotations), the description is inadequate. It doesn't explain the tool's behavior, parameter meanings, or expected outcomes. For a mutation tool that can update multiple character aspects in batch, the description should provide more context about how updates are applied, what happens to unspecified fields, and any constraints.

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%, meaning none of the 29 parameters have descriptions in the schema. The description only provides generic examples ('stats, HP, level, equipment, etc.') without explaining what specific parameters do, their formats, or relationships. For instance, it doesn't clarify the difference between 'characterId' and 'characterName', or how 'batch' works. The description adds minimal value beyond the schema's structure.

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: 'Update an existing D&D 5e character with new stats, HP, level, equipment, etc.' It specifies the verb ('update'), resource ('existing D&D 5e character'), and provides examples of updatable fields. However, it doesn't explicitly distinguish this tool from its sibling 'modify_terrain' or other character-related tools like 'level_up', which would require more specific 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 provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., character must exist), exclusions (e.g., cannot update non-existent characters), or alternatives like 'level_up' for specific level changes or 'manage_inventory' for equipment-only updates. The agent must infer usage from the tool name and schema 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