Skip to main content
Glama

search_document

Read-onlyIdempotent

Search inside a PDF for any keyword and get page numbers with text snippets, letting you find relevant sections without reading or converting the entire document.

Instructions

Full-text keyword search inside a PDF: returns every match with its page number and a surrounding text snippet. Use it to locate information in large PDFs (manuals, contracts, filings) before reading the exact pages with read_pdf_pages — much cheaper than converting the whole file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoPublic http(s) URL of the document to fetch and convert. Leave empty when passing file_base64 instead.
queryNoCase-insensitive text to search for.
filenameNoOriginal filename with extension (e.g. 'report.docx'). Used as a format hint when content type cannot be detected automatically.
passwordNoPassword for encrypted PDFs. Empty for normal files.
file_base64NoBase64-encoded file content (for documents not reachable by URL). Decoded size limit: 30 MB. Leave empty when passing url instead.
max_resultsNoMaximum matches to return (default 20, max 100).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.2/5.0
Behavior3/5

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

The annotations already cover read-only, idempotent, non-destructive behavior, and the description adds useful return details such as page numbers and snippets. However, it overstates that the tool returns 'every match' even though max_results limits the result count (default 20, max 100), and it does not mention whether scanned PDFs require OCR or a text layer.

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 sentences deliver the core purpose, return values, selection guidance, and cost trade-off with no filler. Key information is front-loaded, and every clause earns its place.

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?

The description covers the main workflow, return shape, and relationship to sibling tools, which is enough for an agent to select and invoke it in typical use. It falls short of a 5 only because it leaves the OCR/text-layer limitation implicit and qualifies 'every match' inaccurately relative to max_results, though the schema covers part of that gap.

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%, and the input schema already documents url, query, filename, password, file_base64, and max_results with meaningful detail. The prose adds no per-parameter meaning beyond the general search behavior, so the baseline 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 first sentence states a specific verb and resource—full-text keyword search inside a PDF—and tells the agent exactly what it returns: matches with page numbers and surrounding snippets. It also distinguishes the tool from read_pdf_pages and conversion tools by framing it as a lookup step, so an agent can tell it apart from siblings.

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

Usage Guidelines5/5

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

The description explicitly says when to use it ('to locate information in large PDFs') and names the alternative workflow: read exact pages afterward with read_pdf_pages. It also warns against the more expensive option of converting the whole file, giving clear selection guidance.

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