Skip to main content
Glama

Process Document

document.process

Submit a document for processing — this is always the first step (Step 1 of 5).

Downloads the file from file_url, then submits it to FlexOrch for automatic
classification, structured field extraction, PII detection/masking, and quality
scoring. Processing is asynchronous — this tool returns immediately with a
job_id. You MUST call job.status(job_id) every 3–5 seconds until
status='completed' before calling job.result.

Args:
    file_url: Publicly accessible URL of the document (http/https only, max 50 MB).
              Supported: PDF, DOCX, TXT, XLSX, HTML, XML, EML, JPG, PNG, TIFF.
    mask_pii: Replace detected PII (names, IDs, emails, phone numbers) with
              [MASKED_TYPE] placeholders in all output. Default: true.
    document_type: Optional classification hint — FlexOrch auto-detects if omitted.
                   Values: invoice, expense_report, purchase_order,
                   sales_proposal, bank_statement, payroll.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_urlYes
mask_piiNo
document_typeNoauto

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNo
job_idNo
statusNo
isErrorNo
poll_hintNo

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations are minimal (readOnlyHint=false, idempotentHint=false), so the description carries the burden — and it delivers: it discloses async behavior (returns immediately with job_id), a REQUIRED polling protocol with cadence, file constraints (http/https, 50 MB, supported formats), and the masking default. These are exactly the non-obvious behaviors that would trip an agent.

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?

Each paragraph earns its place: purpose and step position up front, then pipeline mechanics, then the mandatory async protocol, then parameter docs required by the 0% schem coverage. No rdundncy; the most actionable information (polling cadence, call ordering) is front-loaded.

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?

Complete for a complex async tool: pipeline stages, job_id return, explicit next-step workflow, parameter semantics, and file constraints are all covered. An output schema exists so crediting return details is correctly left to it; the only trivial gap is that document_type's value list omits the 'auto' default from the schem.

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?

Schema coverage is 0% (only titles and defaults), so the description fully compensates: it annotates the meaning of each param, the URL access and size/sformat constraints for file_url, the [MASKED_TYPE] placeholder behavior for mask_pii, and the auto-detection fallback plus value list for document_type. It adds meaning far beyond the schem.

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?

States a specific verb and resource ('Submit a document for processing') and anchors it as Step 1 of 5, immediately separating it from mid- and post-processing siblings like job.status and document.reprocess. The pipeline description (classification, extraction, PII masking, quality scoring) makes the tool's function unmistakable.

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?

Gives clear when-to-use context: this is always the first step, and spells out the mandatory follow-on flow of polling job.status every 3–5 seconds before job.result. However, it never names exclusions or an alternative for already-processed documents (document.reprocess), leaving the when-not-to-use case implicit.

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.

TDQS

A4.7/5.0
Disambiguation5/5

Each tool maps cleanly to a distinct pipeline stage or resource: document submission, reprocessing, job polling, result retrieval, dataset build, export, index, search, and chunk retrieval. Even the similar document.process and document.reprocess are clearly separated by whether a new file is involved or an existing stored document is re-queued.

Naming Consistency4/5

Most tools follow a consistent noun.action dot-namespace pattern like document.process, dataset.build, and job.status. dataset.chunks and job.result deviate by using nouns rather than action verbs, and one description references get_job_status/build_dataset instead of the actual tool names, creating minor inconsistency.

Tool Count5/5

Nine tools is well within the ideal range and each tool earns its place in the document processing and dataset export lifecycle. There are no redundant or filler tools, and the count matches the complexity of the workflow.

Completeness5/5

The full documented pipeline is covered: submit, poll, read results, build dataset, export, index, search, and retrieve chunks, with reprocessing available as an alternative to re-upload. No described workflow step dead-ends, and optional RAG features are supported through dataset.index and dataset.chunks.

Resources