Skip to main content
Glama

search_manuscript

Search across manuscript chapters using substring matching. Input a query and optional file pattern to find specific text in your book.

Instructions

Substring search across manuscript/*.md.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
file_globNo*.md

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Core implementation of search_manuscript: reads manuscript/ directory files matching a glob, performs case-insensitive substring search, returns file:line hits (up to 80, truncated).
    def search_manuscript(query: str, file_glob: str = "*.md") -> str:
        proj, _ = require_project()
        root = proj.base_path / "manuscript"
        if not root.exists():
            return "No manuscript/ directory."
        hits: list[str] = []
        q_lower = query.lower()
        for path in sorted(root.glob(file_glob)):
            text = path.read_text(encoding="utf-8", errors="replace")
            for i, line in enumerate(text.splitlines(), 1):
                if q_lower in line.lower():
                    hits.append(f"{path.name}:{i}:{line.strip()[:200]}")
        if not hits:
            return f"No matches for `{query}`."
        return "\n".join(hits[:80]) + ("\n… truncated …" if len(hits) > 80 else "")
  • Registers search_manuscript as a FastMCP tool, delegates to workflow.search_manuscript.
    @mcp.tool()
    async def search_manuscript(query: str, file_glob: str = "*.md") -> str:
        """Substring search across manuscript/*.md."""
        try:
            return workflow.search_manuscript(query, file_glob)
        except ValueError as e:
            return str(e)
  • Uses require_project() from .session to get the project config and resolve the manuscript directory path.
    proj, _ = require_project()
    root = proj.base_path / "manuscript"
Behavior2/5

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

No annotations provided, so description carries full burden. Only states 'substring search', missing details on case sensitivity, regex support, or side effects. Does not explicitly confirm read-only behavior, though it can be inferred.

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

Conciseness4/5

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

Extremely concise single sentence. No wasted words, but could benefit from slight expansion for clarity. Structure is minimal yet functional.

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?

Despite having an output schema, the description does not mention what the tool returns (e.g., matching files, lines). It omits essential context about the search behavior and the parameters, leaving significant gaps for the agent.

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?

Schema description coverage is 0%. No parameter explanations in the description. The query and file_glob parameters are not described at all, so the description adds no meaning beyond the schema defaults.

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?

Description clearly states it performs substring search on manuscript/*.md files, with a specific verb and resource. No explicit sibling differentiation, but among many manuscript tools, the search function stands out.

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?

No explicit when-to-use or alternative suggestions. The context implies it is for finding text within manuscript files, but lacks guidance on when not to use it or what other tools might be preferable for similar tasks.

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