Skip to main content
Glama

manage_concentration

Track and manage D&D 5e spell concentration, including setting concentration, checking saves after damage, and ending concentration with proper DC calculations.

Instructions

Manage D&D 5e concentration on spells. Operations: set (begin concentrating), get (query state), check (roll save after damage), break (end concentration). DC = max(10, damage/2). Supports advantage/disadvantage on saves.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
characterIdNo
operationNo
spellNameNo
targetsNo
durationNo
reasonNo
damageNo
conSaveModifierNo
rollModeNo
manualRollNo
manualRollsNo

Implementation Reference

  • Main handler function for the manage_concentration tool. Dispatches to operation-specific handlers (set, get, break, check) based on input.operation. Returns ASCII-formatted result string.
    export function manageConcentration(input: ManageConcentrationInput): string {
      switch (input.operation) {
        case 'set':
          return handleSetConcentration(input);
        case 'get':
          return handleGetConcentration(input);
        case 'break':
          return handleBreakConcentration(input);
        case 'check':
          return handleCheckConcentration(input);
        default:
          // TypeScript exhaustiveness check
          const _exhaustive: never = input;
          throw new Error(`Unknown operation: ${(_exhaustive as { operation: string }).operation}`);
      }
    }
  • Zod schema defining the input for manage_concentration tool as a discriminated union of four operations: set (begin concentration), get (query state), break (end concentration), check (save after damage).
    /**
     * Combined schema for all manage_concentration operations.
     * Supports: set, get, break, check
     */
    export const manageConcentrationSchema = z.union([
      setOperationSchema,
      getOperationSchema,
      breakOperationSchema,
      checkOperationSchema,
    ]);
    
    export type ManageConcentrationInput = z.infer<typeof manageConcentrationSchema>;
  • Tool registration in the central registry. Defines name, description, converts Zod schema to JSON Schema for MCP, and provides an async wrapper handler that parses input with manageConcentrationSchema and calls the main manageConcentration function.
    manage_concentration: {
      name: 'manage_concentration',
      description: 'Manage D&D 5e concentration on spells. Operations: set (begin concentrating), get (query state), check (roll save after damage), break (end concentration). DC = max(10, damage/2). Supports advantage/disadvantage on saves.',
      inputSchema: toJsonSchema(manageConcentrationSchema),
      handler: async (args) => {
        try {
          const validated = manageConcentrationSchema.parse(args);
          const result = manageConcentration(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);
        }
      },
    },
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses key behavioral traits: the DC calculation formula (DC = max(10, damage/2)), support for advantage/disadvantage on saves, and the four operation types. However, it doesn't cover important aspects like error conditions, persistence of concentration state, or what happens when concentration breaks.

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 perfectly concise and front-loaded. The first sentence establishes the core purpose, followed by specific operations and key mechanics. Every sentence earns its place with essential information, and there's zero wasted text.

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 (11 parameters, no annotations, no output schema), the description is incomplete. While it covers the basic purpose and some mechanics, it doesn't explain parameter usage, return values, or important behavioral details needed for a tool with this many parameters and no structured documentation support.

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?

With 0% schema description coverage for 11 parameters, the description fails to compensate adequately. It mentions 'damage' and 'advantage/disadvantage' which relate to some parameters, but doesn't explain the purpose of characterId, operation, spellName, targets, duration, reason, conSaveModifier, rollMode, manualRoll, or manualRolls. The description adds minimal value beyond the bare schema.

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 tool's purpose with specific verbs ('manage D&D 5e concentration on spells') and lists four distinct operations (set, get, check, break). It distinguishes this tool from siblings like manage_condition or manage_spell_slots by focusing specifically on concentration mechanics.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool (for D&D 5e concentration operations) and implies usage through the operation list. However, it doesn't explicitly state when NOT to use it or mention specific alternatives among the sibling tools for related tasks.

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