Skip to main content
Glama
bellsanct
by bellsanct

equip_item

Equip items from inventory to enhance character abilities in the MCP Dungeon Game. Use item IDs from view_inventory to select gear for dungeon exploration and battles.

Instructions

インベントリからアイテムを装備します。アイテムIDはview_inventoryで確認できます。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
item_idYes装備するアイテムのID(インベントリに表示)
save_keyYesセーブキー

Implementation Reference

  • The core logic that handles equipping an item from the inventory. It performs validation checks (player existence, current state, item existence), manages the equipment swap between inventory and equipment slots, and saves the game state.
    export async function equipItem(itemId: string, saveKey: string): Promise<string> {
      const data = await storage.load(saveKey);
      
      if (!data.player.name) {
        return "プレイヤーが見つかりません。先に'create_player'を実行してください。";
      }
    
      if (data.player.state === 'exploring') {
        return "ダンジョン探索中は装備を変更できません。\n探索完了後に装備を整えてください。";
      }
    
      const itemIndex = data.player.inventory.findIndex(item => item.id === itemId);
      
      if (itemIndex === -1) {
        return `ID '${itemId}' のアイテムがインベントリに見つかりません。`;
      }
    
      const item = data.player.inventory[itemIndex];
      const slot = item.type as keyof typeof data.player.equipment;
    
      // 現在装備中のアイテムがあれば外す
      const currentItem = data.player.equipment[slot];
      if (currentItem && 'stats' in currentItem) {
        // Type guard: Only push Equipment items to equipment inventory
        data.player.inventory.push(currentItem as Equipment);
      }
    
      // 新しいアイテムを装備
      data.player.equipment[slot] = item;
      data.player.inventory.splice(itemIndex, 1);
    
      await storage.save(data, saveKey);
    
      const slotNames: { [key: string]: string } = {
        weapon: '武器',
        shield: '盾',
        armor: '防具',
        accessory: 'アクセサリ'
      };
    
      return `${item.name}を${slotNames[slot]}スロットに装備しました!\n\n'view_status'で更新されたステータスを確認できます。`;
    }
  • src/index.ts:91-105 (registration)
    Registration of the 'equip_item' tool, including its schema definition and input requirements.
    name: 'equip_item',
    description: 'インベントリからアイテムを装備します。アイテムIDはview_inventoryで確認できます。',
    inputSchema: {
      type: 'object',
      properties: {
        item_id: {
          type: 'string',
          description: '装備するアイテムのID(インベントリに表示)',
        },
        save_key: {
          type: 'string',
          description: 'セーブキー',
        },
      },
      required: ['item_id', 'save_key'],
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 lacks behavioral details. It states the action ('equip') but doesn't disclose effects (e.g., stat changes, slot usage), permissions, or error conditions. This leaves significant gaps for a mutation tool.

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 brief and to the point with two sentences. It efficiently conveys the core action and a usage tip without unnecessary elaboration, though it could be more structured.

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 mutation tool with no annotations and no output schema, the description is incomplete. It lacks details on behavioral effects, error handling, and what happens post-equip (e.g., stat updates). The reference to 'view_inventory' helps but doesn't compensate for these gaps.

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 fully documents both parameters. The description adds minimal value by linking 'item_id' to 'view_inventory', but doesn't provide additional context beyond what the schema already states. Baseline 3 is appropriate.

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 action ('equip') and resource ('item from inventory'), making the purpose understandable. It doesn't explicitly differentiate from siblings like 'equip_holding_item' or 'unequip_item', but the mention of 'inventory' provides some implicit distinction.

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 minimal guidance by referencing 'view_inventory' to find item IDs, but offers no explicit advice on when to use this tool versus alternatives like 'equip_holding_item' or 'unequip_item'. No context about prerequisites or exclusions is given.

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/bellsanct/mcp-dungeon-game'

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