Skip to main content
Glama

execute_action

Execute combat actions like attack or dash in ChatRPG encounters to resolve turn-based battles and manage character movements.

Instructions

Execute a combat action in an encounter (attack, dash, disengage, dodge, etc.). Phase 1 supports attack and dash actions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
encounterIdYes
actorIdNo
actorNameNo
actionTypeYes
actionCostNoaction
targetIdNo
targetNameNo
weaponTypeNo
damageExpressionNo
damageTypeNo
moveToNo
advantageNo
disadvantageNo
manualAttackRollNo
manualDamageRollNo
shoveDirectionNo
spellSlotNo
spellNameNo
pactMagicNo
aoeShapeNo
aoeRadiusNo
aoeCenterNo
saveAbilityNo
saveDCNo
spellDamageNo
spellDamageTypeNo
halfOnSaveNo
spellRangeNoSpell range in feet. 0 = self/touch, 5 = touch, etc.

Implementation Reference

  • Registration of the 'execute_action' tool in the central registry. Includes name, description, input schema (converted from Zod executeActionSchema), and handler function that validates args and delegates to executeAction function.
    execute_action: {
      name: 'execute_action',
      description: 'Execute a combat action in an encounter (attack, dash, disengage, dodge, etc.). Phase 1 supports attack and dash actions.',
      inputSchema: toJsonSchema(executeActionSchema),
      handler: async (args) => {
        try {
          const validated = executeActionSchema.parse(args);
          const result = executeAction(validated);
          return success(result);
        } 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 logic: parses input with executeActionSchema, calls executeAction(validated args), and returns formatted success or error result using shared helpers.
    handler: async (args) => {
      try {
        const validated = executeActionSchema.parse(args);
        const result = executeAction(validated);
        return success(result);
      } 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);
      }
    },
  • Reference to executeActionSchema (Zod schema converted to JSON schema for MCP) used for input validation. Schema imported from './modules/combat.js'.
    inputSchema: toJsonSchema(executeActionSchema),
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 states the tool executes actions but lacks critical details: whether this is a read-only or destructive operation, what permissions are needed, how errors are handled, or what the response looks like (since no output schema exists). For a complex mutation tool with 28 parameters, 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.

Conciseness4/5

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

The description is appropriately concise with two sentences: the first states the core purpose, and the second adds a limitation. It's front-loaded with the main function, and every sentence earns its place by providing essential information without waste.

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 (28 parameters, nested objects), no annotations, and no output schema, the description is incomplete. It doesn't explain the return values, error conditions, or detailed behavioral context needed for a tool of this scope. While it covers the basic purpose, it lacks the depth required for effective use by an AI agent.

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 very low (4%), meaning most parameters are undocumented in the schema. The description adds minimal value beyond the schema—it mentions 'attack and dash actions' which loosely relates to 'actionType', but doesn't explain the semantics of other 27 parameters like 'moveTo', 'advantage', or 'spellSlot'. With such low coverage, the description fails to compensate adequately.

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: 'Execute a combat action in an encounter' with examples (attack, dash, disengage, dodge). It specifies the verb ('execute') and resource ('combat action'), and distinguishes it from siblings by focusing on action execution rather than calculation or management. However, it doesn't explicitly differentiate from all siblings like 'roll_check' or 'advance_turn'.

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

Usage Guidelines3/5

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

The description provides some context by mentioning 'Phase 1 supports attack and dash actions,' which implies when to use it (for specific action types) and potentially when not to use it (for other phases or unsupported actions). However, it doesn't explicitly state alternatives (e.g., when to use 'calculate_aoe' vs. this tool for area effects) or prerequisites, leaving usage somewhat implied rather than fully guided.

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/mnehmos.chatrpg.game'

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