Skip to main content
Glama
PSPDFKit

Nutrient DWS MCP Server

extract_fields

Destructive

Extract specific fields from PDFs, images, or Office files into a custom JSON schema, returning only the values you define with per-field citations for verification.

Instructions

Pull specific named fields out of a document into a JSON shape you define, using the Nutrient DWS Data Extraction API. Reads the input file from the local file system or sandbox (if enabled), or fetches it directly from a URL — provide exactly one of filePath or url.

Unlike parse_document, which parses a whole document into elements or Markdown, extract_fields takes a JSON schema (root type: "object", with properties) and returns only the values matching it — e.g. { invoiceNumber, total, lineItems: [...] } — each with a per-field citation (bounding box, confidence, and match quality) tying it back to where it was found.

Processing modes (cost per page, parse component only — no text mode here): structure = OCR spatial parse (1.5 credits); understand = AI-augmented, default (9 credits); agentic = VLM-augmented (18 credits). Total cost per page is this parse component plus a fixed extract component, billed in Data Extraction credits — a separate balance from the Processor API credits reported by check_credits.

output.data (the extracted values) is always returned inline. Per-field citations and page geometry are large and are only kept when outputPath is provided; otherwise a note says they were omitted.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoURL of the document to extract from — fetched directly by the API instead of uploading a local file. Exactly one of filePath or url is required.
modeNoParse mode feeding the extraction (cost/quality trade-off). No text mode — schema-guided extraction needs the structural parse (OCR/layout) that text mode skips. structure: OCR-based spatial parse (1.5 credits/page). understand: AI-augmented, the default (9 credits/page). agentic: VLM-augmented for the most complex documents (18 credits/page). Total cost per page is this parse component plus a fixed extract component, in Data Extraction credits.understand
schemaYesJSON Schema describing the fields to extract. Root must be type: "object" with properties. Schemas are closed — do NOT set additionalProperties yourself, the API rejects a schema that sets it. Limits: 32 KB serialized, 500 fields, 50 properties per object, 5 nesting levels, enum values capped at 50.
strictNoFail the extraction if a required field cannot be found, instead of returning a partial result. Server default: false.
filePathNoPath to the document to extract from (PDF, image, or Office file). Exactly one of filePath or url is required. Resolves to sandbox path if enabled, otherwise resolves to the local file system.
languageNoOCR language(s) — full name (e.g. "german"), ISO code (e.g. "deu"), or array for multilingual docs. Leave unset for auto-detection.
maxScriptsNoMaximum number of scripts to auto-detect. Only valid when language is left unset. Server default: 2.
multimodalNoUse multimodal (vision) extraction for higher accuracy on visual fields. Increases cost and latency. Server default: false.
outputPathNoWhere to write the full response (data, per-field citations, and pages). Resolves to sandbox path if enabled. output.data is always returned inline regardless of this option; set it to also keep the citations.
instructionsNoFree-text guidance for the extraction, e.g. clarifying an ambiguous field. Max 10000 characters.
maxLanguagesNoMaximum number of languages to auto-detect. Only valid when language is left unset. Server default: 2.
includeCitationsNoInclude per-field citations (bounding box, confidence, match quality) in output.metadata. Server default: true. Leave unset to keep that default — passing false here disables citations.
Install Server

TDQS

A4.7/5.0
Behavior4/5

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

The description adds meaningful behavioral context beyond the annotations: input can come from local files, sandbox paths, or URLs; output.data is always inline; citations and page geometry are retained only when outputPath is set; and cost/billing behavior is explained. It does not explicitly reconcile the destructiveHint:true annotation with specific destructive side effects, but it does not contradict the annotation either, and the annotations keep the disclosure burden lower.

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?

The description is dense but every sentence earns its place: core purpose, sibling differentiation, input-source constraint, mode/cost guidance, and output-storage behavior. The most decision-relevant information is front-loaded, and the detail is proportional to the tool's complexity.

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?

For a 12-parameter tool with nested schema and no output schema, the description covers the essential invocation knowledge: how to choose it, what input it needs, what output it returns, how citations are retained, and the billing model. The remaining details are already present in the 100%-covered parameter schema, so the description is complete enough for an agent to call the tool correctly.

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?

The input schema already has 100% description coverage, so the baseline is 3. The description still adds value beyond the schema by giving an illustrative extraction shape ({ invoiceNumber, total, lineItems: [...] }), clarifying the exactly-one input rule, and explaining mode-specific cost and output-persistence semantics that are not fully obvious from schema text alone.

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 opens with a specific verb and resource: 'Pull specific named fields out of a document into a JSON shape you define.' It clearly differentiates from parse_document by stating that extract_fields takes a JSON schema and returns only matching values with citations, so an agent can immediately tell what this tool does.

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?

The description explicitly contrasts with parse_document: 'Unlike parse_document, which parses a whole document into elements or Markdown, extract_fields takes a JSON schema...' It also tells the agent to provide exactly one of filePath or url and explains that there is no text mode. This is clear when-to-use and when-not-to-use guidance.

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

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/PSPDFKit/nutrient-dws-mcp-server'

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