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 and consumes existing organization credits: one credit per up-to-five pages. Obtain user agreement to use existing credits before setting use_existing_credits=true. 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

TableJSON Schema
NameRequiredDescriptionDefault
fileNo
file_inlineNo
request_keyYes
schema_slugYes
use_existing_creditsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYes
statusYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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"
      +]
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Goes well beyond the annotations: discloses that the operation stores the document/result and consumes organization credits at one credit per five pages, requires explicit user agreement before use_existing_credits=true, and instructs the agent not to auto-start a new extraction after a timeout. None of this is derivable from readOnlyHint=false/openWorldHint=true.

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?

Front-loads purpose, then flows through input selection, constraints, billing/consent, retry, and result review. Dense but every sentence carries operational weight with no filler.

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 an output schema exists, return values need not be described; the description still directs the agent to review confidence and validation errors. Combined with the coverage of auth, billing, idempotency (request_key), and input constraints, an agent has everything needed to invoke correctly.

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

Parameters5/5

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

Despite 0% schema description coverage, the description supplies real semantics: file vs file_inline selection, the 32 KiB cap, that base64 must be canonical and derived from exact user-uploaded bytes, that file_name/mime_type must match, request_key as the retry key, and the credit/user-agreement meaning of use_existing_credits.

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?

States a precise verb+resource ('Extract ... attached PDF or image using a saved Dokyumi schema') and the two input mechanisms, so an agent knows exactly what the tool does. It does not, however, explicitly name or contrast with sibling dokyumi_get_extraction, leaving sibling differentiation implicit.

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?

Explicit when-to-use and when-not guidance: 'Prefer the host-provided file download_url/file_id. If unavailable, file_inline...' plus 'Supply exactly one of file or file_inline; never reconstruct a document from text.' It also conditions use_existing_credits on user agreement and prescribes request_key reuse on retry.

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