Skip to main content
Glama

Search within a book

search_in_book

Search a book's text by keyword, returning snippets with chapter, character offset, and reading position to help pinpoint passages.

Instructions

Keyword search inside one book's text. Returns short snippets with the chapter index, character offset, and approximate position (percent through the book). Use the returned chapter + offset with get_chapter to read the surrounding text.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesWord or phrase to find (case-insensitive by default).
bookIdYesThe book's id.
maxResultsNoMax hits (default 20).
caseSensitiveNoMatch case exactly (default false).
Behavior3/5

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

With no annotations provided, the description carries the full burden of explaining behavior. It discloses the return format (short snippets with chapter index, character offset, and approximate position) and suggests how to use the result. It does not mention potential side effects, ordering of results, or edge cases, but for a read-only search tool, this is adequate. The description adds value beyond the schema by describing the output structure.

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 two sentences, front-loaded with the core purpose, and followed by a practical usage tip. Every word earns its place, with no redundancy. It is concise and well-structured.

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

Completeness4/5

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

For a simple search tool with no output schema, the description covers the essential aspects: what it does, what it returns, and how to follow up. It does not explicitly state that it is read-only, but that is implied by 'search.' It could mention default result ordering or case-insensitivity, but these are covered in the schema. Overall, the description is complete enough for an agent to use the tool correctly.

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

Parameters3/5

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

The schema descriptions cover 100% of the parameters (bookId, query, maxResults, caseSensitive), so the description does not need to compensate. The description does not add additional meaning to the parameters; it only references the returned 'chapter + offset,' which relates to output rather than input. Therefore, a baseline score of 3 is appropriate.

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 'Keyword search inside one book's text,' which specifies the action (search), the resource (one book's text), and the scope (single book). This differentiates it from sibling tools like search_books, which likely searches across multiple books. The additional detail about returning snippets further clarifies the tool's purpose.

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

Usage Guidelines4/5

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

The description provides clear context that this tool is for searching within a single book, implying it's the right choice when you need to find text in a specific book rather than across a library. It also gives explicit follow-up guidance: 'Use the returned chapter + offset with get_chapter to read the surrounding text.' However, it does not explicitly mention when not to use it or name alternatives, so it misses the top tier.

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/joshstrange/bookorbit-mcp'

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