Skip to main content
Glama

manage_encounter

Create and manage RPG encounters by linking simulation states with persistent character records, supporting operations like adding participants, tracking combat, and syncing outcomes.

Instructions

Composite tool for encounter management with state synchronization. Operations: create (with characterId linking), get (with verbosity), end (with participantUpdates), commit (sync to persistent characters), list (active encounters). Supports bridging encounter simulation state with persistent character records.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
operationNo
seedNo
participantsNo
terrainNo
lightingNobright
surpriseNo
encounterIdNo
verbosityNostandard
outcomeNo
generateSummaryNo
preserveLogNo
notesNo
characterIdsNoSpecific characters to commit (defaults to all)
dryRunNoPreview changes without applying
includeEndedNo
participantNo
manualInitiativeNoManual initiative roll (otherwise rolls automatically)

Implementation Reference

  • Registration of the 'manage_encounter' tool. Defines name, description, input schema from manageEncounterSchema, and a handler that parses arguments with the schema and executes manageEncounter function.
    manage_encounter: {
      name: 'manage_encounter',
      description: 'Composite tool for encounter management with state synchronization. Operations: create (with characterId linking), get (with verbosity), end (with participantUpdates), commit (sync to persistent characters), list (active encounters). Supports bridging encounter simulation state with persistent character records.',
      inputSchema: toJsonSchema(manageEncounterSchema),
      handler: async (args) => {
        try {
          const validated = manageEncounterSchema.parse(args);
          const result = manageEncounter(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 handler function that implements the tool logic: input validation using manageEncounterSchema, execution of core manageEncounter logic, and response formatting with success or error.
    handler: async (args) => {
      try {
        const validated = manageEncounterSchema.parse(args);
        const result = manageEncounter(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);
      }
  • Usage of manageEncounterSchema for input validation (schema definition imported from './modules/combat.js').
    const validated = manageEncounterSchema.parse(args);
  • Import statement for manageEncounter function and manageEncounterSchema 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';
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions 'state synchronization' and 'bridging encounter simulation state with persistent character records,' which hints at data persistence and integration behavior. However, it doesn't disclose critical behavioral traits like whether operations are destructive, whether changes are reversible, what permissions are needed, or what happens when operations fail. For a composite tool with 17 parameters and complex operations, this is inadequate.

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

Conciseness3/5

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

The description is reasonably concise (two sentences) and front-loaded with the composite nature and operations. However, the second sentence is somewhat dense with parenthetical details, and the description could be more structured to clearly map operations to use cases. It's not wasteful but could be more organized.

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 tool's complexity (17 parameters, composite operations, no annotations, no output schema), the description is insufficient. It doesn't explain how the operations work together, what the tool returns, error conditions, or prerequisites. The mention of 'state synchronization' is helpful but doesn't provide enough context for an agent to use this tool effectively compared to simpler alternatives.

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 only 18%, meaning most parameters are undocumented in the schema. The description mentions operations (create, get, end, commit, list) and hints at parameters like 'characterId linking' and 'participantUpdates,' but doesn't explain the relationship between operations and the 17 parameters in the schema. It fails to compensate for the poor schema coverage, leaving most parameter meanings unclear.

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 this is a 'composite tool for encounter management with state synchronization' and lists specific operations (create, get, end, commit, list). It distinguishes from siblings by mentioning 'bridging encounter simulation state with persistent character records,' which suggests integration capabilities not present in simpler encounter tools like create_encounter or end_encounter. However, it doesn't explicitly differentiate from all sibling tools in the list.

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. With siblings like create_encounter, end_encounter, and get_encounter available, there's no indication whether this tool should be used instead of those simpler tools, or whether it's for specific scenarios requiring state synchronization. The agent receives no usage context.

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