Skip to main content
Glama
bellsanct
by bellsanct

unequip_item

Remove an equipped item from a character's slot and return it to inventory in the MCP Dungeon Game. Specify the slot (weapon, shield, armor, or accessory) and save key to manage equipment.

Instructions

特定のスロットからアイテムを外してインベントリに戻します。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
slotYes装備スロット: weapon, shield, armor, または accessory
save_keyYesセーブキー

Implementation Reference

  • The logic for the 'unequip_item' tool, which validates the player state, checks the equipment slot, moves the item back to the inventory, and saves the game data.
    export async function unequipItem(slot: 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 validSlots = ['weapon', 'shield', 'armor', 'accessory'];
      if (!validSlots.includes(slot)) {
        return `無効なスロットです。有効なスロット: ${validSlots.join(', ')}`;
      }
    
      const slotKey = slot as keyof typeof data.player.equipment;
      const item = data.player.equipment[slotKey];
    
      if (!item) {
        return `${slot}スロットには何も装備されていません。`;
      }
    
      // Type guard: Ensure we only push Equipment to equipment inventory
      if (!('stats' in item)) {
        return `エラー: ${slot}スロットに装備アイテムがありません。`;
      }
    
      // インベントリに移動
      data.player.inventory.push(item as Equipment);
      data.player.equipment[slotKey] = null;
    
      await storage.save(data, saveKey);
    
      const slotNames: { [key: string]: string } = {
        weapon: '武器',
        shield: '盾',
        armor: '防具',
        accessory: 'アクセサリ'
      };
    
      return `${slotNames[slot]}スロットから${item.name}を外しました。`;
    }
  • src/index.ts:108-123 (registration)
    Registration of the 'unequip_item' tool including its input schema and description.
    {
      name: 'unequip_item',
      description: '特定のスロットからアイテムを外してインベントリに戻します。',
      inputSchema: {
        type: 'object',
        properties: {
          slot: {
            type: 'string',
            description: '装備スロット: weapon, shield, armor, または accessory',
            enum: ['weapon', 'shield', 'armor', 'accessory'],
          },
          save_key: {
            type: 'string',
            description: 'セーブキー',
          },
        },
Behavior2/5

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

With no annotations provided, the description carries full burden. It states the action (unequip) and outcome (return to inventory), but doesn't disclose behavioral traits like whether this requires specific game state (e.g., not in battle), if it's reversible, what happens if slot is empty, or any rate limits. It's minimal but not misleading.

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 a single, efficient sentence in Japanese that directly states the tool's purpose without any wasted words. It's appropriately sized and front-loaded with the core action.

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

Completeness3/5

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

Given 2 parameters with full schema coverage and no output schema, the description is minimally complete for a simple mutation tool. However, with no annotations and sibling tools like 'unequip_holding_item', it lacks context about game mechanics or when to choose between similar tools, leaving gaps for an AI agent.

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%, with clear descriptions for both parameters ('slot' with enum values and 'save_key'). The description adds no additional parameter semantics beyond what the schema provides, so baseline 3 is appropriate as the schema does the heavy lifting.

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 ('外して' - unequip) and target resource ('特定のスロットからアイテム' - item from a specific slot), and specifies the outcome ('インベントリに戻します' - return to inventory). It distinguishes from 'equip_item' and 'equip_holding_item' by being the inverse operation, though it doesn't explicitly differentiate from 'unequip_holding_item'.

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?

No guidance is provided on when to use this tool versus alternatives like 'unequip_holding_item' or 'equip_item'. The description implies usage when removing an item from a slot, but lacks context about prerequisites (e.g., must have an item equipped) 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/bellsanct/mcp-dungeon-game'

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