Skip to main content
Glama
Nizoka

pdfnative-mcp

Extract plain text from PDF

extract_text
Read-onlyIdempotent

Extracts plain text from non-encrypted PDFs by walking each page's content stream. Returns extracted text and a flag indicating whether extraction was successful, with an explanation.

Instructions

Best-effort plain-text extraction from a non-encrypted PDF. Walks each page's content stream and pulls the operands of Tj/'/"/TJ text operators. The result.extractable boolean is FALSE when one or more pages have non-empty content but yielded no text (this is EXPECTED for PDFs using subset fonts without /ToUnicode CMaps — it is not an error). The accompanying extractableReason field explains why. Encrypted PDFs are rejected with EXTRACTION_UNSUPPORTED. Tagged-mode structure-tree extraction (cleaner output for tagged PDFs) is tracked on the roadmap.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pagesNoOptional 0-based page indices to extract. When omitted, every page is extracted.
fieldsNoOptional dot-path projection applied to the structured result (e.g. ['fullText'] or ['extractable']). Composes after verbosity. Unknown paths are omitted.
passwordNoPassword to open an encrypted source PDF (user or owner — both are tried). Omit for unencrypted documents. Never logged or echoed back.
pdfBase64YesBase64-encoded PDF bytes.
verbosityNoResponse verbosity. 'full' (default) returns the per-page pages[] array and fullText; 'summary' returns a token-frugal { pageCount, extractedPageCount, extractable, charCount } and drops the text payloads.full
includeRunsNoWhen true, each page also carries `runs[]` — positioned text-showing operations `{ text, x, y, fontSize, fontName }` in device space (content-stream order). Useful for layout-aware extraction; larger responses.
maxTextLengthNoHard cap on total extracted characters across all pages (memory bound for adversarial input). Default 16000000. Exceeding it fails with OUTPUT_TOO_LARGE.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
pagesYes
fullTextYes
pageCountYes
extractableYesFalse when one or more requested pages produced text that is entirely U+FFFD replacement characters — a font with no usable /ToUnicode CMap or base encoding. Blank pages are still considered extractable.
extractableReasonNoHuman-readable explanation when extractable=false. Absent when extractable=true.
extractedPageCountYes
Behavior5/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint. The description adds significant context: best-effort approach, walking content stream, handling of encrypted PDFs, extractable boolean and reason, and future roadmap. No contradiction with annotations.

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?

The description is well-structured with front-loaded core purpose. Each sentence adds value, covering process, edge cases, and roadmap. Could be slightly more concise but overall efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (7 params, 1 required, output schema exists), the description is highly complete. It explains error handling, expected behaviors, and future enhancements. The output schema covers return values, so no need for additional detail.

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 baseline is 3. The description adds minimal parameter-specific detail beyond what the schema provides, though it does mention password security and verbosity effects in context.

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 it extracts plain text from a non-encrypted PDF using specific content stream operators. It distinguishes from siblings like encrypt_pdf or annotate_pdf by focusing solely on text extraction.

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?

The description explains when to use (non-encrypted PDFs) and conditions like extractable=false is expected for certain PDFs. It does not explicitly state when not to use or provide direct alternatives, but the context is clear.

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/Nizoka/pdfnative-mcp'

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