Skip to main content
Glama

extract_streaming

Stream PDF extraction events as NDJSON for large documents, receiving page results as they become available without waiting for full extraction.

Instructions

Stream extraction events for a PDF as NDJSON.

Use for large documents (100+ pages) where waiting for the full extraction is impractical. The response body is newline-delimited JSON with one object per line:

{"type":"classified","data":{"page_count":N,"page_types":[...]}}
{"type":"page","data":{"page_num":0,"text":"...","confidence":0.92,...}}
{"type":"warning","data":{"message":"..."}}        (zero or more)
{"type":"complete","data":{"total_confidence":0.94,"ocr_pages":[...],...}}

The first event is always classified; the last is always complete. Each page event arrives as soon as that page is extracted, including OCR re-extraction in standard/high quality modes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
qualityNostandard

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Since no annotations are provided, the description carries the full burden. It details the streaming format (NDJSON), event types (classified, page, warning, complete), and ordering. It also mentions OCR re-extraction in standard/high quality. However, it does not cover error handling or authorization, which would improve transparency.

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 front-loaded with the main purpose and includes a detailed event format example. While the code block is somewhat lengthy, it provides essential context. Every sentence adds value, making it appropriately sized.

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 streaming tool, the description covers event types, ordering, and use case. It implicitly defines the output schema through examples. It does not cover error scenarios or timeouts, but given the tool's nature, it is largely complete.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate. It mentions quality modes but does not explicitly explain the file_path parameter or possible quality values beyond 'standard/high'. The description adds little meaning beyond the schema's names and defaults.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool streams extraction events for a PDF as NDJSON, with a specific use case for large documents. However, it does not explicitly distinguish itself from sibling tools like extract_structured, which would have earned a 5.

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 explicitly recommends use for large documents (100+ pages) where waiting is impractical, providing clear context. However, it does not mention when NOT to use it or suggest alternatives, so it stops short of a 5.

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/NameetP/pdfmux'

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