Skip to main content
Glama

Extract fields from an attached document

dokyumi_extract_document

Extract an authorized attached PDF or image using a saved Dokyumi schema. Prefer the host-provided file download_url/file_id. If unavailable, file_inline accepts canonical base64 computed from exact user-uploaded bytes with original file_name and matching supported mime_type, at most 32 KiB. Supply exactly one of file or file_inline; never reconstruct a document from text. This stores the document/result. For subscription workspaces, obtain user agreement to use existing credits before setting use_existing_credits=true (one credit per up-to-five pages). BYOK lifetime workspaces have no monthly extraction cap: first run preflight, obtain agreement to separate OpenRouter charges, and set confirm_provider_charges=true. BYOK supports PDF, JPEG, PNG and WebP within the workspace storage limit, with 30-day retention. Reuse the same request_key for a retry; never automatically start a new extraction after a timeout. Review confidence and validation errors before using fields.

Input Schema

NameRequiredDescriptionDefault
fileNo
file_inlineNo
request_keyYes
schema_slugYes
use_existing_creditsNo
confirm_provider_chargesNo

Output Schema

NameRequiredDescriptionDefault
dataYes
statusYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / file_inline / properties / mime_type / enum
      Previous value: -[
      -  "application/pdf",
      -  "image/jpeg",
      -  "image/png",
      -  "image/tiff",
      -  "image/webp"
      -]New value: +[
      +  "application/pdf",
      +  "image/jpeg",
      +  "image/png",
      +  "image/webp"
      +]
  2. Changed2 schema fields changed
    • addedInput schema / properties / confirm_provider_charges
      Added value: +{
      +  "const": true,
      +  "type": "boolean"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "schema_slug",
      -  "request_key",
      -  "use_existing_credits"
      -]New value: +[
      +  "schema_slug",
      +  "request_key"
      +]
  3. Changed3 schema fields changed
    • addedInput schema / oneOf
      Added value: +[
      +  {
      +    "not": {
      +      "required": [
      +        "file_inline"
      +      ]
      +    },
      +    "required": [
      +      "file"
      +    ]
      +  },
      +  {
      +    "not": {
      +      "required": [
      +        "file"
      +      ]
      +    },
      +    "required": [
      +      "file_inline"
      +    ]
      +  }
      +]
    • addedInput schema / properties / file_inline
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "data_base64": {
      +      "maxLength": 43692,
      +      "minLength": 4,
      +      "type": "string"
      +    },
      +    "file_name": {
      +      "maxLength": 200,
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "mime_type": {
      +      "enum": [
      +        "application/pdf",
      +        "image/jpeg",
      +        "image/png",
      +        "image/tiff",
      +        "image/webp"
      +      ],
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "data_base64",
      +    "file_name",
      +    "mime_type"
      +  ],
      +  "type": "object"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "file",
      -  "schema_slug",
      -  "request_key",
      -  "use_existing_credits"
      -]New value: +[
      +  "schema_slug",
      +  "request_key",
      +  "use_existing_credits"
      +]
  4. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Annotations only declare readOnly/openWorld/idempotent/destructive flags; the description adds substantial context beyond them: the call "stores the document/result," consumes credits ("one credit per up-to-five pages"), requires user agreement for use_existing_credits, carries separate OpenRouter charges on BYOK lifetime workspaces, has a 30-day retention window, and is subject to a workspace storage limit. That is exactly the side-effect and cost disclosure an agent needs for a paid mutation.

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 purpose is front-loaded and the paragraph is dense with operating rules rather than filler; nearly every clause carries an actionable constraint. It is a long, undivided block, though, and splitting the input-source rules from the credit/retention rules would improve scanability.

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 complex, multi-mode, paid extraction tool with nested input objects and 0% documented schema, the definition still covers input sourcing, exclusivity, consent gating, retention, storage limits, retry semantics, and even points at reviewing confidence and validation errors. An output schema exists, so it correctly does not attempt to document return values.

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?

With 0% schema description coverage, the description carries the burden and does so for the risky parts: it frames file vs file_inline as mutually exclusive ("Supply exactly one"), explains the 32 KiB base64 ceiling, requires original file_name and matching supported mime_type, and explains the const-constrained use_existing_credits and confirm_provider_charges flags as consent switches. It leaves schema_slug's origin unstated (nothing about list_schemas or how a saved slug is obtained), which is the remaining gap.

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 opens with a specific verb+resource: "Extract an authorized attached PDF or image using a saved Dokyumi schema." That is enough to distinguish it from list/get/export siblings, which are read-oriented. It does not explicitly name a sibling tool, so it stops short of 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?

Clear precedence rules are given: "Prefer the host-provided file download_url/file_id" and fall back to file_inline, plus an explicit prohibition ("never reconstruct a document from text") and a retry rule ("Reuse the same request_key... never automatically start a new extraction after a timeout"). It also points at preflight for BYOK first runs. It does not explicitly contrast itself with named sibling tools, keeping it at 4.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources