PDF processing pipeline
Full PDF processing pipeline - metadata, markdown conversion, and first-page extraction in one call.
3 tools run server-side in one request. You pay once, settle once, and get a single response - no orchestration, no per-step payments, and a partial-success envelope if any step fails. USDC over x402 on any supported chain.
When to use this pack
An agent receives a PDF URL and needs to understand it quickly: what's the page count and metadata, what does the full text say (as markdown), and what's on page 1? Running three separate tools is three payments; this pack does it in one.
Tools in this pack
All 3 run inside the single $0.007 call above. Each is also callable on its own if you only need one part.
- PDF info POST /api/pdf-info Inspect a PDF without downloading the whole thing into your model: page count, title, author, subject, creator, producer, creation/modification dates, encryption flag, and byte size. Body: {"url":"https://…/file.pdf"}.
- PDF to Markdown POST /api/pdf-to-markdown Convert a PDF to clean markdown: headings, paragraphs, and bullets reconstructed from the text layer - ready to drop into a model's context. Body: {"url":"https://…/file.pdf"}.
- Extract / split PDF pages POST /api/pdf-extract-pages Pull a subset of pages into a new PDF (split). Body: {"url":"https://…/file.pdf","pages":"1-3,5"}. Returns the new PDF as base64.
Bought one at a time, these 3 tools cost $0.007 together; the pack is that sum less a 10% bundle discount, rounded up to the $0.001 settlement floor, which is $0.007.
Workflow
- Call pdf-info to get page count, file size, title, author, and other metadata.
- Call pdf-to-markdown to convert the entire PDF to clean markdown text.
- Call pdf-extract-pages with pages='1' to get just the first page as a separate document.
Arguments
| Name | Required | Description | Example |
|---|---|---|---|
url | yes | URL of the PDF to process | https://arxiv.org/pdf/1706.03762 |
What one call returns
A JSON object with pack, args, steps, summary; steps holds one entry per tool (pdf-info, pdf-to-markdown, pdf-extract-pages), each with its own result or error. Full example on the API page.
Call it directly
Any x402 client pays the 402 and gets the whole workflow back in one response. With the agent402-client SDK (npm i agent402-client, an ES module):
import { Agent402 } from "agent402-client";
// payFetch: an x402-wrapped fetch your wallet signs (@x402/fetch).
// Tools on the free tier need no options: new Agent402() pays them by proof-of-work.
// an existing prepaid credits key also works: new Agent402({ creditsKey })
const client = new Agent402({ fetch: payFetch });
const result = await client.call("skill-pdf-pipeline", {"url":"https://arxiv.org/pdf/1706.03762"});
Run it in Claude
claude mcp add agent402 -s user -- npx -y agent402-mcp@latest
Then paste this prompt into Claude:
Process the PDF at https://arxiv.org/pdf/1706.03762 using Agent402's pdf-pipeline skill pack: (1) pdf-info for metadata, (2) pdf-to-markdown for full text, (3) pdf-extract-pages for page 1. Summarize the document structure and first-page content.