Skip to main content
Glama

add_inventory_item

Record a new inventory item, specifying its name and initial holder, with optional description and chapter acquired, to maintain continuity across book chapters.

Instructions

Track an inventory item.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
initial_holderYes
descriptionNo
acquired_chapterNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The actual handler/logic for add_inventory_item — creates an InventoryItem and appends it to the continuity log.
    def add_inventory_item(
        name: str,
        initial_holder: str,
        description: str = "",
        acquired_chapter: int | None = None,
    ) -> str:
        _, cont = require_project()
        cont.inventory.append(
            InventoryItem(
                name=name,
                description=description,
                acquired_chapter=acquired_chapter,
                current_holder=initial_holder,
                original_holder=initial_holder,
            )
        )
        save_project_and_continuity()
        return f"Item {name} → {initial_holder}"
  • The InventoryItem dataclass schema with fields: name, description, acquired_chapter, transferred_chapter, current_holder, original_holder.
    @dataclass
    class InventoryItem:
        name: str
        description: str = ""
        acquired_chapter: int | None = None
        transferred_chapter: int | None = None
        current_holder: str | None = None
        original_holder: str | None = None
  • The MCP tool registration via @mcp.tool() decorator that exposes add_inventory_item as a tool.
    @mcp.tool()
    async def add_inventory_item(
        name: str,
        initial_holder: str,
        description: str = "",
        acquired_chapter: int | None = None,
    ) -> str:
        """Track an inventory item."""
        return workflow.add_inventory_item(name, initial_holder, description, acquired_chapter)
  • Helper method get_item on ContinuityLog to look up an InventoryItem by name.
    def get_item(self, name: str) -> InventoryItem | None:
        for item in self.inventory:
            if item.name == name:
                return item
        return None
  • ContinuityLog dataclass holding the inventory list (list[InventoryItem]) where items are stored.
    @dataclass
    class ContinuityLog:
        living_characters: list[CharacterState] = field(default_factory=list)
        inventory: list[InventoryItem] = field(default_factory=list)
        running_gags: list[RunningGagStatus] = field(default_factory=list)
        locations_visited: list[LocationVisit] = field(default_factory=list)
        established_facts: list[EstablishedFact] = field(default_factory=list)
        revision_notes: list[RevisionNote] = field(default_factory=list)
        last_updated: str = field(default_factory=lambda: datetime.now().isoformat())
Behavior1/5

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

With no annotations, the description carries full burden for behavioral disclosure. It fails to mention any side effects, permissions needed, or whether it creates or updates an item. The single word 'Track' is uninformative.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely short but not effectively concise—it sacrifices clarity for brevity. It provides no structured information such as usage examples or parameter hints.

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

Completeness1/5

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

Given the tool has 4 parameters (2 required) and an output schema, the description is grossly incomplete. It fails to explain the tool's purpose or return value, leaving the agent to guess.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 0% description coverage for parameters, and the tool description does not clarify any parameter meanings. For example, 'initial_holder' and 'acquired_chapter' are left undefined.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Track an inventory item' is vague and ambiguous. 'Track' could imply monitoring rather than adding, which contradicts the tool name 'add_inventory_item'. It does not clearly state that the tool creates a new inventory record.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/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 siblings like 'transfer_item' or 'get_inventory'. There is no mention of prerequisites or context.

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/BurgersJackson/storywright-mcp'

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