unequip_holding_item
Remove an equipped item from a character's hand slot and return it to inventory in the MCP Dungeon Game. Specify the slot (item1 or item2) and save key to manage equipment.
Instructions
特定のスロットから持ち物を外してインベントリに戻します。
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"slot": "<slot>",
"save_key": "<save_key>"
},
"name": "unequip_holding_item"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| slot | Yes | 持ち物スロット: item1 または item2 | |
| save_key | Yes | セーブキー |
Implementation Reference
- src/tools/player.ts:315-339 (handler)The implementation of the unequipHoldingItem tool, which removes an item from a player's equipment slot and adds it back to their inventory.
export async function unequipHoldingItem(slot: 'item1' | 'item2', 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 item = data.player.equipment[slot]; if (!item) { return `${slot === 'item1' ? '持ち物1' : '持ち物2'}スロットには何も装備されていません。`; } // インベントリに移動 data.player.itemInventory.push(item as Item); data.player.equipment[slot] = null; await storage.save(data, saveKey); return `${slot === 'item1' ? '持ち物1' : '持ち物2'}スロットから${(item as Item).name}を外しました。`; } - src/index.ts:229-242 (schema)The MCP tool registration and input schema definition for unequip_holding_item.
name: 'unequip_holding_item', description: '特定のスロットから持ち物を外してインベントリに戻します。', inputSchema: { type: 'object', properties: { slot: { type: 'string', description: '持ち物スロット: item1 または item2', enum: ['item1', 'item2'], }, save_key: { type: 'string', description: 'セーブキー', },