Skip to main content
Glama
sandraschi

pdf-mcp

pdf_do

Automate multi-step PDF workflows from a natural-language task, chaining extraction, conversion, annotation, validation, and search tools to deliver a final answer.

Instructions

Chain the PDF tools autonomously to complete a natural-language task.

Requires a local LLM (Ollama or LM Studio) or a client that supports MCP sampling. The LLM plans up to 6 tool calls from the pdf_* surface, the server answer. pdf_do cannot call itself or pdf_shutdown.

Return Format

A dict with keys:

  • success: bool

  • answer: str - final natural-language answer

  • steps: list of {tool, args, result} execution records On failure: {success: False, error}.

Examples

await pdf_do(task="Summarize this report and check it for PII.", path="report.pdf") {"success": true, "answer": "The report covers Q3 results... 3 PII hits found.", "steps": [{"tool": "pdf_export", ...}]}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoPath to a PDF file if the task targets one.
taskYesNatural-language task to perform with the PDF tooling.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageNoHuman-readable summary
successNoWhether the operation succeeded

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

A4.1/5.0
Behavior4/5

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

Adds real behavioral context beyond annotations: it depends on an external LLM to plan, is capped at 6 tool calls, and is explicitly non-recursive (cannot invoke itself or pdf_shutdown). Annotations already flag readOnlyHint=false and openWorldHint=true, and the description's LLM-dependency and planning behavior are non-obvious traits worth disclosing.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the core purpose, then organizes prerequisites, return format, and an example into clear sections with little redundancy. The prerequisite sentence contains a dangling fragment ('the server answer') that slightly hurts polish but doesn't obscure meaning.

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?

For a non-trivial orchestrator this covers the dependency requirements, recursion limits, return structure, and a failure shape, plus a worked example. It is complete enough that an agent can invoke it correctly, though it could say more about what happens when no LLM/sampling is available.

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 coverage is 100%, so both parameters (task, path) are already documented in the schema. The description and example add slight practical context (path targets a PDF, task is a natural-language instruction) but nothing beyond what the schema provides, so the baseline of 3 applies.

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?

States a precise verb and resource: it autonomously chains the pdf_* tools to fulfill a natural-language task. This clearly differentiates it from the individual sibling tools (pdf_export, pdf_extract, etc.) since it is the orchestration layer above them.

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

Usage Guidelines4/5

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

Gives concrete prerequisites (needs a local Ollama/LM Studio LLM or MCP-sampling client) and explicit boundaries (max 6 planned calls, cannot call itself or pdf_shutdown). It does not state when to prefer pdf_do over calling the pdf_* tools directly, so routing guidance is implied rather than explicit.

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