Skip to main content
Glama

Search inside a PDF

pdf_search

Find text in a local PDF and return matching pages with surrounding context. Use it first on long documents to avoid costly full-text extraction.

Instructions

Find text inside a local PDF and return matching pages with surrounding context. Much cheaper than pdf_extract when you only need to locate something — use this first on long documents, then pdf_extract with the pages it reports.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path, or path relative to an allowed root, of a .pdf file
queryYesLiteral text to find, or a regular expression when `regex` is true
regexNoTreat `query` as a JavaScript regular expression. Defaults to false.
maxMatchesNoMaximum matches to return. Defaults to 25.
contextCharsNoCharacters of surrounding context per match. Defaults to 200.
Behavior4/5

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

No annotations are provided, so the description carries the burden. It discloses the return behavior (matching pages with surrounding context) and an efficiency trait (cheaper). It does not explicitly state it is read-only, but the search nature and usage guidance imply this. The gap is minor given the additional context provided.

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?

Two sentences, no wasted words. The first sentence states the purpose, and the second gives usage guidance with a specific alternative. Exceptionally concise and 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?

Given no output schema, the description sufficiently explains the return value (matching pages with context). It also provides usage context and links to a sibling tool (pdf_extract). For a search tool with 5 params, this is complete.

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 baseline is 3. The description adds minimal param-related meaning (e.g., 'surrounding context' hints at contextChars), but the schema already fully documents all parameters. No significant extra value is provided beyond the schema.

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 the tool's function: 'Find text inside a local PDF and return matching pages with surrounding context.' It uses specific verbs and resources, and contrasts with pdf_extract, distinguishing it from sibling tools.

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?

Explicitly instructs when to use this tool: 'use this first on long documents, then pdf_extract with the `pages` it reports.' Also notes it is 'much cheaper than pdf_extract when you only need to locate something,' giving clear alternative guidance.

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/vishalmeena2211/pdf-triage-mcp'

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