Skip to main content
Glama

grep_pdf

Search text content within PDF files using regex or literal patterns, returning matching lines with page numbers and context, without page limitations.

Instructions

Search text in PDFs. Standard grep/rg does NOT work on PDFs (binary format). Use this tool instead. Returns matching lines with page numbers. NOTE: No page limit (unlike read_pdf's 10-page limit).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patternYesSearch pattern (regex by default)
file_pathNoSpecific PDF file. If not provided, searches ALL PDFs in working_directory
working_directoryNoBase directory for search (only used when file_path is not provided).
ignore_caseNoCase-insensitive search
fixed_stringsNoTreat pattern as literal string, not regex
contextNoLines of context before/after match (0-5, default: 2)
max_countNoMaximum matches to return (1-100)
recursiveNoInclude subdirectories when searching directory
start_pageNoStart page (1-indexed, inclusive)
end_pageNoEnd page (1-indexed, inclusive). None = last page
Behavior4/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 behavioral disclosure. It successfully describes key behavioral traits: that it returns 'matching lines with page numbers' and has 'No page limit (unlike read_pdf's 10-page limit).' However, it doesn't mention performance characteristics, error conditions, or what happens with invalid PDFs. For a tool with no annotations, this is good but not comprehensive.

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 extremely concise (3 sentences) and front-loaded with the core purpose. Every sentence earns its place: first states what it does, second explains why to use it over alternatives, third distinguishes from sibling tool. Zero wasted words.

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?

Given the tool's complexity (10 parameters, no output schema, no annotations), the description does well by explaining the core behavior and key differentiators. However, it doesn't describe the return format in detail (beyond 'matching lines with page numbers') or error handling. For a search tool with rich parameters but no output schema, this is good but could be more complete about results structure.

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 the schema already documents all 10 parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema. According to scoring rules, with high schema coverage (>80%), the baseline is 3 even with no param info in description.

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 purpose: 'Search text in PDFs' (verb+resource). It explicitly distinguishes from standard grep/rg tools that don't work on PDFs, and distinguishes from sibling 'read_pdf' by noting the lack of page limit. This is specific and clearly differentiates from alternatives.

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 provides explicit guidance on when to use this tool: 'Standard grep/rg does NOT work on PDFs (binary format). Use this tool instead.' It also distinguishes from sibling 'read_pdf' by noting 'No page limit (unlike read_pdf's 10-page limit).' This gives clear when-to-use and when-not-to-use guidance with named alternatives.

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/PyJudge/pdf4vllm-mcp'

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