Skip to main content
Glama
pdf-toolkit-mcp

pdf-toolkit-mcp

by 0xmortuex

search_pdf

Read-only

Find text in a PDF and get each match with page numbers and context. Use it to locate the right pages, then read them; supports regex and page ranges.

Instructions

Find text in a PDF. Returns each match as 'Page N: ...context...' plus the list of pages hit. Use it to locate the right pages, then read_pdf with pages=. A plain query matches across line breaks and ignores case; set regex=true for a regular expression.

pages: optional 1-based ranges like '1-3,5,7-' to limit the search. context_chars: characters of surrounding text on each side of a match. max_results: snippets to return (the total match count is always reported).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>",
      "query": "<query>"
    },
    "name": "search_pdf"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes
pagesNo
queryYes
regexNo
passwordNo
max_resultsNo
context_charsNo
case_sensitiveNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so safety is covered; the description adds real behavioral detail on top: matching spans line breaks, case is ignored by default, regex is opt-in via a flag, and the total match count is always reported even when snippets are truncated by max_results. The only gap is the password parameter, which is never explained in behavioral terms.

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?

Front-loaded with purpose and return format, then a routing sentence, then a compact per-parameter block with no filler. Every sentence carries information an agent needs; nothing is restated from the schema titles.

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?

Despite eight parameters and a sibling set of nine PDF tools, the description covers purpose, chaining, matching semantics, and return shape, and an output schema exists so return values need not be spelled out. The undocumented path and password parameters are the remaining hole in an otherwise complete definition.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage the description must carry the parameters, and it does for most: pages syntax ('1-3,5,7-', 1-based, optional), context_chars as characters per side, max_results as snippet count versus total match count, and query/regex/case semantics. path and password are left undefined, so it stops short of full coverage.

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?

"Find text in a PDF" gives a specific verb and resource, and the return shape ('Page N: ...context...' plus page list) is stated outright. It actively distinguishes itself from the neighboring read_pdf/extract_* tools by positioning itself as the locator step.

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?

Explicit workflow guidance: 'Use it to locate the right pages, then read_pdf with pages='. That tells the agent both when to reach for this tool and which sibling to chain into next, which is exactly the routing decision an agent has to make among nine PDF tools.

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