Skip to main content
Glama

load_last_book_project

Load the last book project by reading the stored file, allowing writers to resume their work exactly where they left off.

Instructions

Load the last successfully opened project from ~/.storywright/last_project.json if valid.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool handler for 'load_last_book_project'. It loads the last project path from session persistence, then delegates to workflow.load_book_project().
    async def load_last_book_project() -> str:
        """Load the last successfully opened project from ~/.storywright/last_project.json if valid."""
        p = load_last_project_path()
        if not p:
            return "No saved last project. Use load_book_project with a path."
        return workflow.load_book_project(str(p))
  • The tool is registered using the @mcp.tool() decorator on the handler function in the FastMCP application.
    @mcp.tool()
    async def load_last_book_project() -> str:
        """Load the last successfully opened project from ~/.storywright/last_project.json if valid."""
        p = load_last_project_path()
        if not p:
            return "No saved last project. Use load_book_project with a path."
        return workflow.load_book_project(str(p))
  • Helper function load_last_project_path() reads the last project path from ~/.storywright/last_project.json and validates it exists with a book_config.json.
    def load_last_project_path() -> Path | None:
        p = state_file()
        if not p.exists():
            return None
        try:
            data = json.loads(p.read_text(encoding="utf-8"))
            path = Path(data["path"])
            if path.is_dir() and (path / "book_config.json").exists():
                return path
        except (json.JSONDecodeError, KeyError, OSError):
            pass
        return None
  • The workflow function that actually loads a book project by calling bind_project() which sets the session and saves the last-project path.
    def load_book_project(project_path: str) -> str:
        bind_project(Path(project_path))
        proj, _ = require_project()
        return (
            f"Loaded **{proj.name}** (`{proj.base_path}`) — "
            f"{len(proj.chapters)} chapters, {len(proj.characters)} characters."
        )
  • The bind_project() helper that actually resolves the path, loads the project config, creates the session, and calls save_last_project().
    def bind_project(path: Path) -> tuple[ProjectConfig, ContinuityLog]:
        """Resolve path, load config + continuity, attach to session."""
        path = path.resolve()
        session.project = ProjectConfig.load(path)
        session.continuity = ContinuityLog.load(path)
        save_last_project(path)
        return session.project, session.continuity
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. It mentions validity condition ('if valid') but does not disclose what happens on failure, side effects, or access permissions. This is insufficient for a tool with no annotation support.

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 focused sentence with no extraneous words. It is perfectly concise and front-loaded with the action and resource.

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

Completeness3/5

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

Given the tool has no parameters and an output schema exists, the description captures the essential purpose. However, it lacks detail on edge cases (e.g., file not found) and behavioral traits, making it only moderately complete.

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

Parameters4/5

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

There are zero parameters, so schema coverage is trivially 100%. The description adds meaning about the file source and validity check, which is valuable beyond the empty schema. Baseline 4 is appropriate given no parameters.

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

Purpose5/5

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

The description clearly states the verb 'load' and the resource 'last successfully opened project', with a specific file path. It distinguishes from sibling tools like load_book_project which likely load by name, making the purpose very clear.

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

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use (to resume the last project) but does not explicitly state when not to use or provide alternatives. The context hints at a convenience function, but explicit guidance is missing.

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