Skip to main content
Glama
bellsanct
by bellsanct

view_inventory

Display all items in your inventory to manage equipment and track collected resources for dungeon exploration.

Instructions

インベントリ内のすべてのアイテムを表示します。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
save_keyYesセーブキー

Implementation Reference

  • The core logic for `view_inventory` which reads the player data and formats the inventory content string.
    export async function viewInventory(saveKey: string): Promise<string> {
      const data = await storage.load(saveKey);
    
      if (!data.player.name) {
        return "プレイヤーが見つかりません。先に'create_player'を実行してください。";
      }
    
      const hasEquipment = data.player.inventory.length > 0;
      const hasItems = (data.player.itemInventory?.length || 0) > 0;
    
      if (!hasEquipment && !hasItems) {
        return "インベントリは空です。";
      }
    
      let output = `=== インベントリ ===\n\n`;
    
      // 装備インベントリ
      if (hasEquipment) {
        output += `【装備】 (${data.player.inventory.length}個)\n\n`;
    
        const groupedByType: { [key: string]: Equipment[] } = {};
    
        for (const item of data.player.inventory) {
          if (!groupedByType[item.type]) {
            groupedByType[item.type] = [];
          }
          groupedByType[item.type].push(item);
        }
    
        const typeNames: { [key: string]: string } = {
          weapon: '武器',
          shield: '盾',
          armor: '防具',
          accessory: 'アクセサリ'
        };
    
        for (const [type, items] of Object.entries(groupedByType)) {
          output += `${typeNames[type] || type}:\n`;
          for (const item of items) {
            output += `  [${item.id}] ${item.name} [${item.rarity}]\n`;
            output += `    攻撃+${item.stats.attack} 防御+${item.stats.defense} 速度+${item.stats.speed} 運+${item.stats.luck}\n`;
          }
          output += '\n';
        }
      }
    
      // 持ち物インベントリ
  • src/index.ts:77-88 (registration)
    Tool registration for `view_inventory` with its schema definition in `src/index.ts`.
    name: 'view_inventory',
    description: 'インベントリ内のすべてのアイテムを表示します。',
    inputSchema: {
      type: 'object',
      properties: {
        save_key: {
          type: 'string',
          description: 'セーブキー',
        },
      },
      required: ['save_key'],
    },
  • The switch-case handler in `src/index.ts` that dispatches the `view_inventory` request to the implementation in `playerTools`.
    case 'view_inventory':
      return {
        content: [
          {
            type: 'text',
            text: await playerTools.viewInventory(args.save_key as string),
          },
        ],
      };
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states what the tool does ('display all items in inventory') without mentioning whether it's read-only, if it requires authentication, any rate limits, or what the output format might be. For a tool with no annotations, this is insufficient to inform the agent about key behavioral traits.

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, clear sentence in Japanese that directly states the tool's function without any unnecessary words. It is front-loaded and efficiently conveys the core purpose, making it highly concise and well-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?

Given the complexity of a tool that likely returns inventory data, the description is incomplete. It lacks details on output format, error handling, or behavioral context, and with no annotations or output schema, the agent has minimal information to work with. This makes it inadequate for effective tool selection and invocation.

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?

The schema description coverage is 100%, with the parameter 'save_key' fully documented in the schema as 'セーブキー' (save key). The description adds no additional meaning or context about this parameter, such as why it's needed or how it relates to inventory viewing. Since the schema does the heavy lifting, the baseline score of 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 ('表示します' - display/show) and resource ('インベントリ内のすべてのアイテム' - all items in inventory), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'shop_inventory' or 'equip_item', which might also involve inventory items, so it doesn't reach the highest score.

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 no guidance on when to use this tool versus alternatives. It doesn't mention context like viewing player inventory versus shop inventory, or prerequisites such as needing a save_key, which is required per the schema. This lack of usage instructions leaves the agent with minimal direction.

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