shop_inventory
Display shop inventory to purchase equipment and items for dungeon exploration. View anytime, buy only during idle phases.
Instructions
ショップで販売中の商品一覧を表示します。装備と持ち物アイテムを購入できます。探索中でも閲覧可能ですが、購入は待機中のみです。
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| save_key | Yes | セーブキー |
Implementation Reference
- src/tools/shop.ts:53-101 (handler)The actual implementation of the shop_inventory tool logic.
export async function getShopInventory(saveKey: string): Promise<string> { const gameData = await storage.load(saveKey); // 探索中は閲覧のみ可能(購入は不可) const canBuy = gameData.player.state === 'idle'; const statusMessage = canBuy ? `所持金: ${gameData.player.gold}G\n` : `⚠️ 探索中のため購入できません(閲覧のみ)\n所持金: ${gameData.player.gold}G\n`; let output = '=== 🏪 ショップ ===\n\n' + statusMessage + '\n'; // 装備セクション output += '【装備】\n'; const equipmentByRarity = { common: SHOP_EQUIPMENT.filter(eq => eq.rarity === 'common'), rare: SHOP_EQUIPMENT.filter(eq => eq.rarity === 'rare'), epic: SHOP_EQUIPMENT.filter(eq => eq.rarity === 'epic') }; for (const [rarity, items] of Object.entries(equipmentByRarity)) { if (items.length === 0) continue; const rarityName = rarity === 'common' ? 'コモン' : rarity === 'rare' ? 'レア' : 'エピック'; output += `\n[${rarityName}]\n`; for (const eq of items) { const typeIcon = eq.type === 'weapon' ? '⚔️' : eq.type === 'shield' ? '🛡️' : eq.type === 'armor' ? '🎽' : '💍'; const canAfford = gameData.player.gold >= eq.price ? '✅' : '❌'; output += `${canAfford} ${typeIcon} ${eq.name} - ${eq.price}G\n`; output += ` ID: ${eq.id}\n`; output += ` 攻撃+${eq.stats.attack} 防御+${eq.stats.defense} 速度+${eq.stats.speed} 運+${eq.stats.luck}\n`; } } // 持ち物アイテムセクション output += '\n【持ち物アイテム】\n'; for (const item of SHOP_ITEMS) { const typeIcon = item.type === 'herb' ? '🌿' : '🧿'; const canAfford = gameData.player.gold >= item.price ? '✅' : '❌'; output += `${canAfford} ${typeIcon} ${item.name} - ${item.price}G\n`; output += ` ID: ${item.id}\n`; output += ` ${item.description}\n`; } output += '\n購入方法: buy_item ツールで item_id を指定してください\n'; return output; } - src/index.ts:248-255 (registration)Registration of the shop_inventory tool in the MCP tools list.
name: 'shop_inventory', description: 'ショップで販売中の商品一覧を表示します。装備と持ち物アイテムを購入できます。探索中でも閲覧可能ですが、購入は待機中のみです。', inputSchema: { type: 'object', properties: { save_key: { type: 'string', description: 'セーブキー',