Skip to main content
Glama
frogr
by frogr

Find in book

find_in_book
Read-onlyIdempotent

Locate every occurrence of a word or phrase in a Project Gutenberg book, returning total counts, per-chapter counts, and sample matches with line numbers and context.

Instructions

Find every occurrence of a word or phrase in a Project Gutenberg book. Returns the total count, per-chapter counts, and the first matches with line numbers and surrounding lines. Ignores case, quote style, dash style and line breaks.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesProject Gutenberg book id, e.g. 2701 (Moby Dick) or 1342 (Pride and Prejudice). Find ids with search_books.
queryYesWord or phrase to find, e.g. "white whale". Case, curly vs straight quotes, dash style and line breaks are ignored.
whole_wordNoOnly match whole words ("whale" will not match "whales"). Default false.
max_resultsNoMatches to return with context (1-20, default 10). total_matches always counts all of them.
context_linesNoLines of context before and after each match (0-5, default 1).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
noteNo
queryYes
matchesYes
returnedYes
by_chapterYesMatch counts per chapter, in book order (chapters with no matches left out).
attributionYesCredit line to keep with any quoted text.
total_matchesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, open world), and the description layers on matching semantics (case, quote style, dash style and line breaks ignored) and truncation behavior (only 'the first matches' are returned while counts are complete). That is real added context, though the normalization claim largely duplicates the query parameter description.

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?

Three tight sentences: purpose first, then what is returned, then matching behavior. Nothing is padding, and the most decision-relevant information is front-loaded.

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

Completeness5/5

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

With an output schema present, the description need only frame the operation, and it does so along with a quick summary of the return payload and matching rules. Nothing an agent needs in order to call it correctly is missing.

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?

Schema description coverage is 100%, so every parameter including whole_word, max_results and context_lines is already fully documented in the schema. The description adds no parameter-level detail beyond the schema, which is the expected baseline of 3.

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?

States a specific verb and resource ('Find every occurrence of a word or phrase in a Project Gutenberg book') plus the result shape, which cleanly separates it from search_books (finds books), get_book/read_passage (retrieves text) and book_stats (aggregates). An agent can tell what this does without opening the schema.

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?

Usage is implied by the purpose — you call it to locate occurrences inside a known book — but the description never states when to use this versus search_books or quote_check, which also operate on book text. No exclusions or conditions are given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.