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

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