transfer_item
Transfer an item to a new character holder in a specified chapter of your book project.
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": {
"item_name": "<item_name>",
"new_holder": "<new_holder>",
"chapter": "<chapter>"
},
"name": "transfer_item"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| item_name | Yes | ||
| new_holder | Yes | ||
| chapter | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/storywright_mcp/app.py:267-272 (handler)FastMCP tool registration and async handler for transfer_item. Decorated with @mcp.tool(), it accepts item_name, new_holder, and chapter, then delegates to workflow.transfer_item().
@mcp.tool() async def transfer_item(item_name: str, new_holder: str, chapter: int) -> str: try: return workflow.transfer_item(item_name, new_holder, chapter) except ValueError as e: return str(e) - Workflow-level orchestration for transfer_item. Loads the project and continuity, calls cont.transfer_item(), saves state, and returns a summary string.
def transfer_item(item_name: str, new_holder: str, chapter: int) -> str: _, cont = require_project() cont.transfer_item(item_name, new_holder, chapter) save_project_and_continuity() return f"{item_name} → {new_holder}" - Core domain logic: ContinuityLog.transfer_item() finds the item by name in the inventory list and updates its current_holder and transferred_chapter.
def transfer_item(self, item_name: str, new_holder: str, chapter: int) -> None: item = self.get_item(item_name) if item: item.current_holder = new_holder item.transferred_chapter = chapter - InventoryItem dataclass schema used by transfer_item. 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