Skip to main content
Glama

advance_turn

Progress combat encounters by moving to the next combatant's turn, managing round transitions, updating conditions, and tracking initiative order.

Instructions

Advance to the next combatant's turn in an encounter. Handles round transitions when all combatants have acted, ticks condition durations (removing expired conditions), clears action economy for the previous combatant, and provides death save reminders for combatants at 0 HP. Returns ASCII-formatted turn info with initiative order preview.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
encounterIdYesActive encounter ID
processEffectsNoProcess start/end turn effects
processAurasNoProcess aura effects

Implementation Reference

  • Registration of the 'advance_turn' MCP tool, including metadata, input schema reference (advanceTurnSchema), and handler wrapper that validates arguments and delegates to the core advanceTurn function.
    advance_turn: {
      name: 'advance_turn',
      description: 'Advance to the next combatant\'s turn in an encounter. Handles round transitions when all combatants have acted, ticks condition durations (removing expired conditions), clears action economy for the previous combatant, and provides death save reminders for combatants at 0 HP. Returns ASCII-formatted turn info with initiative order preview.',
      inputSchema: toJsonSchema(advanceTurnSchema),
      handler: async (args) => {
        try {
          const validated = advanceTurnSchema.parse(args);
          const result = advanceTurn(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 MCP tool handler for 'advance_turn'. Performs Zod validation on input args using advanceTurnSchema, executes the core advanceTurn(validated) logic, and handles success/error responses.
    handler: async (args) => {
      try {
        const validated = advanceTurnSchema.parse(args);
        const result = advanceTurn(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 the Zod input schema (advanceTurnSchema) converted to JSON Schema for MCP tool input validation. Schema imported from './modules/combat.js'.
    inputSchema: toJsonSchema(advanceTurnSchema),
  • Import statement bringing in the advanceTurn function (core handler logic) and advanceTurnSchema from the combat module.
    import { manageCondition, manageConditionSchema, createEncounter, createEncounterSchema, executeAction, executeActionSchema, advanceTurn, advanceTurnSchema, rollDeathSave, rollDeathSaveSchema, modifyTerrain, modifyTerrainSchema, renderBattlefield, renderBattlefieldSchema, getEncounter, getEncounterSchema, endEncounter, endEncounterSchema, manageEncounter, manageEncounterSchema } from './modules/combat.js';
Behavior4/5

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

With no annotations provided, the description carries full burden and does an excellent job disclosing behavioral traits: it explains round transitions, condition duration ticking, action economy clearing, death save reminders, and ASCII-formatted output. The only minor gap is lack of explicit mention about permissions or error conditions.

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?

Perfectly structured with zero wasted words. The first sentence states the core purpose, subsequent clauses detail behavioral aspects, and the final sentence describes the return format. Every sentence earns its place.

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

Completeness4/5

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

For a mutation tool with no annotations and no output schema, the description provides excellent behavioral context about what happens during turn advancement. The only minor gap is not explicitly stating this is a write operation (though 'advance' implies mutation), but overall it's quite complete given the complexity.

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 all three parameters. The description doesn't add any parameter-specific information beyond what the schema provides, maintaining the baseline score of 3.

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

Purpose5/5

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

The description clearly states the specific action ('Advance to the next combatant's turn') and resource ('in an encounter'), distinguishing it from siblings like 'end_encounter' or 'execute_action'. It precisely defines the scope of the operation beyond just moving initiative.

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 implies usage during active combat encounters but doesn't explicitly state when to use this tool versus alternatives like 'end_encounter' or 'execute_action'. No guidance is provided about prerequisites or exclusions.

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