Skip to main content
Glama

manage_aura

Create, track, and apply D&D 5e aura effects like Spirit Guardians to targets within range, handling damage, healing, conditions, and saving throws.

Instructions

Manage D&D 5e aura effects (Spirit Guardians, Aura of Protection, etc.). Operations: create (new aura), list (active auras), process (apply effects to targets in range), remove (end aura). Supports damage, healing, conditions, and saving throws.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
operationNo
ownerIdNo
spellNameNo
radiusNo
durationNo
damageNo
damageTypeNo
healingNo
effectNo
conditionNo
saveDCNo
saveAbilityNo
halfOnSaveNo
affectsEnemiesNo
affectsAlliesNo
auraIdNo
reasonNo
targetsNo
decrementDurationNo
manualDamageRollsNo
manualHealingRollsNo
manualSaveRollsNo

Implementation Reference

  • Main handler function for the manage_aura tool. Dispatches to operation-specific handlers: create, list, remove, process.
    export function manageAura(input: ManageAuraInput): string {
      switch (input.operation) {
        case 'create':
          return handleCreateAura(input);
        case 'list':
          return handleListAuras(input);
        case 'remove':
          return handleRemoveAura(input);
        case 'process':
          return handleProcessAura(input);
        default:
          const _exhaustive: never = input;
          throw new Error(`Unknown operation: ${(_exhaustive as { operation: string }).operation}`);
      }
    }
  • Zod schema for manage_aura input validation. Union of schemas for create, list, remove, process operations.
    export const manageAuraSchema = z.union([
      createAuraSchema,
      listAuraSchema,
      removeAuraSchema,
      processAuraSchema,
    ]);
    
    export type ManageAuraInput = z.infer<typeof manageAuraSchema>;
  • Tool registration in the MCP registry. Defines name, description, input schema, and handler wrapper that validates args and calls manageAura.
    manage_aura: {
      name: 'manage_aura',
      description: 'Manage D&D 5e aura effects (Spirit Guardians, Aura of Protection, etc.). Operations: create (new aura), list (active auras), process (apply effects to targets in range), remove (end aura). Supports damage, healing, conditions, and saving throws.',
      inputSchema: toJsonSchema(manageAuraSchema),
      handler: async (args) => {
        try {
          const validated = manageAuraSchema.parse(args);
          const result = manageAura(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);
        }
      },
    },
  • Helper: Creates a new aura with generated ID and stores it in auraStore. Formats ASCII output with aura details.
    function handleCreateAura(input: z.infer<typeof createAuraSchema>): string {
      const id = `aura-${randomUUID().slice(0, 8)}`;
      const content: string[] = [];
    
      const aura: ExtendedAuraState = {
        id,
        ownerId: input.ownerId,
        spellName: input.spellName,
        radius: input.radius,
        duration: input.duration,
        damage: input.damage,
        damageType: input.damageType,
        healing: input.healing,
        effect: input.effect,
        condition: input.condition,
        saveDC: input.saveDC,
        saveAbility: input.saveAbility,
        halfOnSave: input.halfOnSave,
        affectsEnemies: input.affectsEnemies,
        affectsAllies: input.affectsAllies,
      };
    
      auraStore.set(id, aura);
    
      content.push(centerText('AURA CREATED', DISPLAY_WIDTH));
      content.push('');
      content.push(`ID: ${id}`);
      content.push(`Spell: ${input.spellName}`);
      content.push(`Owner: ${input.ownerId}`);
      content.push(`Radius: ${input.radius} ft`);
    
      if (input.duration !== undefined) {
        content.push(`Duration: ${input.duration} rounds`);
      }
    
      content.push('');
      content.push(BOX.LIGHT.H.repeat(DISPLAY_WIDTH));
    
      if (input.damage) {
        content.push('');
        content.push(`Damage: ${input.damage} ${input.damageType || ''}`);
        if (input.saveDC && input.saveAbility) {
          content.push(`Save: DC ${input.saveDC} ${input.saveAbility.toUpperCase()}`);
          if (input.halfOnSave) {
            content.push('Half damage on save');
          }
        }
      }
    
      if (input.healing) {
        content.push('');
        content.push(`Healing: ${input.healing}`);
      }
    
      if (input.condition) {
        content.push('');
        content.push(`Applies: ${input.condition}`);
      }
    
      if (input.affectsEnemies !== undefined || input.affectsAllies !== undefined) {
        content.push('');
        const targets: string[] = [];
        if (input.affectsEnemies) targets.push('enemies');
        if (input.affectsAllies) targets.push('allies');
        if (targets.length === 0) {
          targets.push(input.affectsEnemies === false ? 'allies only' : 'all');
        }
        content.push(`Affects: ${targets.join(', ')}`);
      }
    
      return createBox('AURA CREATED', content);
    }
  • In-memory storage for auras, used by manage_aura operations.
    const auraStore = new Map<string, ExtendedAuraState>();
    
    // ============================================================
    // AURA SCHEMAS
    // ============================================================
    
    const auraTargetSchema = z.object({
      targetId: z.string(),
      distance: z.number(),
      saveModifier: z.number().optional(),
    });
    
    const manualSaveRollSchema = z.object({
      targetId: z.string(),
      roll: z.number().min(1).max(20),
    });
    
    const createAuraSchema = z.object({
      operation: z.literal('create'),
      ownerId: z.string(),
      spellName: z.string(),
      radius: z.number().min(1),
      duration: z.number().optional(),
      damage: z.string().optional(),
      damageType: DamageTypeSchema.optional(),
      healing: z.string().optional(),
      effect: z.string().optional(),
      condition: ConditionSchema.optional(),
      saveDC: z.number().optional(),
      saveAbility: AbilitySchema.optional(),
      halfOnSave: z.boolean().optional(),
      affectsEnemies: z.boolean().optional(),
      affectsAllies: z.boolean().optional(),
    });
    
    const listAuraSchema = z.object({
      operation: z.literal('list'),
      ownerId: z.string().optional(),
    });
    
    const removeAuraSchema = z.object({
      operation: z.literal('remove'),
      auraId: z.string(),
      reason: z.string().optional(),
    });
    
    const processAuraSchema = z.object({
      operation: z.literal('process'),
      auraId: z.string(),
      targets: z.array(auraTargetSchema),
      decrementDuration: z.boolean().optional(),
      manualDamageRolls: z.array(z.number()).optional(),
      manualHealingRolls: z.array(z.number()).optional(),
      manualSaveRolls: z.array(manualSaveRollSchema).optional(),
    });
    
    export const manageAuraSchema = z.union([
      createAuraSchema,
      listAuraSchema,
      removeAuraSchema,
      processAuraSchema,
    ]);
    
    export type ManageAuraInput = z.infer<typeof manageAuraSchema>;
    
    // ============================================================
    // AURA PUBLIC API
    // ============================================================
    
    /**
     * Get an aura by ID.
     */
    export function getAura(auraId: string): ExtendedAuraState | undefined {
      return auraStore.get(auraId);
    }
    
    /**
     * Get all auras for an owner.
     */
    export function getAurasForOwner(ownerId: string): ExtendedAuraState[] {
      return Array.from(auraStore.values()).filter(a => a.ownerId === ownerId);
    }
    
    /**
     * Clear all auras (for testing).
     */
    export function clearAllAuras(): void {
      auraStore.clear();
    }
    
    // ============================================================
    // AURA HANDLER
    // ============================================================
    
    /**
     * Main handler for the manage_aura tool.
     */
    export function manageAura(input: ManageAuraInput): string {
      switch (input.operation) {
        case 'create':
          return handleCreateAura(input);
        case 'list':
          return handleListAuras(input);
        case 'remove':
          return handleRemoveAura(input);
        case 'process':
          return handleProcessAura(input);
        default:
          const _exhaustive: never = input;
          throw new Error(`Unknown operation: ${(_exhaustive as { operation: string }).operation}`);
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It mentions operations but doesn't explain how they interact (e.g., whether 'process' requires a pre-existing aura), what happens when auras overlap, whether changes are persistent, or error conditions. For a complex 22-parameter mutation tool, this is inadequate disclosure.

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 efficiently structured in two sentences: first establishing scope and operations, second listing supported effect types. No wasted words, though it could benefit from operational grouping or bullet points given the complexity.

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?

For a complex mutation tool with 22 parameters, 0% schema coverage, no output schema, and no annotations, the description is severely incomplete. It doesn't explain return values, error handling, state persistence, or how this integrates with the broader D&D combat system represented by sibling tools.

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 and 22 parameters, the description fails to compensate. It mentions general effect types but doesn't explain which parameters correspond to which operations or how they interact (e.g., whether 'damage' and 'healing' are mutually exclusive). The schema's complexity demands more semantic guidance than provided.

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 manages D&D 5e aura effects with specific operations (create, list, process, remove) and supported effect types (damage, healing, conditions, saving throws). It distinguishes from siblings by focusing on aura management rather than general combat or character operations, though it doesn't explicitly contrast with similar tools like manage_condition or manage_concentration.

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 lists operations but provides no guidance on when to use this tool versus alternatives like manage_condition for status effects or calculate_aoe for area calculations. It doesn't specify prerequisites, dependencies, or typical workflow scenarios for aura management in D&D combat.

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