Skip to main content
Glama

add_location

Add a location to a specific chapter in your book project, with an optional description, to organize settings and track continuity in the writing pipeline.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chapterYes
locationYes
descriptionNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • FastMCP tool decorator registration for 'add_location' - async handler that delegates to workflow.add_location and catches ValueError.
    @mcp.tool()
    async def add_location(chapter: int, location: str, description: str = "") -> str:
        try:
            return workflow.add_location(chapter, location, description)
        except ValueError as e:
            return str(e)
  • Core business logic: loads the current project/continuity, appends a LocationVisit to locations_visited, saves, and returns confirmation string.
    def add_location(chapter: int, location: str, description: str = "") -> str:
        _, cont = require_project()
        cont.locations_visited.append(LocationVisit(chapter=chapter, location=location, description=description))
        save_project_and_continuity()
        return f"Location recorded: {location}"
  • LocationVisit dataclass schema defining the data model used by add_location - chapter (int), location (str), description (str).
    @dataclass
    class LocationVisit:
        chapter: int
        location: str
        description: str = ""
  • Import of LocationVisit from models.continuity used by the add_location function.
    from .revision_queue import append_revision, format_revision_section
    from .models.continuity import (
        CharacterState,
        CharacterStatus,
        ContinuityLog,
        EstablishedFact,
        InventoryItem,
        LocationVisit,
    )
    from .models.project import (
        ChapterStatus,
        Character,
        DeathEntry,
        ProjectConfig,
        RunningGag,
    )
    from .session import bind_project, require_project, save_project_and_continuity
    from .templates.defaults import get_default_comedy_brief, get_default_editor_brief, get_default_writer_brief
    
    
    def create_book_project(
        project_name: str,
        book_title: str,
        genre: str = "",
        authors: list[str] | None = None,
        projects_root: str | None = None,
        third_agents: list[str] | None = None,
    ) -> str:
        root = Path(projects_root).resolve() if projects_root else get_settings().projects_root.resolve()
        base_path = root / "book_projects" / project_name.strip().replace(" ", "-").lower()
        base_path.mkdir(parents=True, exist_ok=True)
        (base_path / "briefs").mkdir(exist_ok=True)
        (base_path / "reports").mkdir(exist_ok=True)
        (base_path / "manuscript").mkdir(exist_ok=True)
    
        agents = ["comedy"] if third_agents is None else list(third_agents)
        proj = ProjectConfig(
            name=book_title,
  • Helper function save_project_and_continuity() that persists project and continuity data after add_location modifies it.
    def save_project_and_continuity() -> None:
        proj, cont = require_project()
        proj.save()
        cont.save(proj.base_path)
Behavior1/5

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

Tool has no description.

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

Conciseness1/5

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

Tool has no description.

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?

Tool has no description.

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?

Tool has no description.

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

Purpose1/5

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

Tool has no description.

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?

Tool has no description.

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