Skip to main content
Glama

Typebar (formerly SuperDocs)

process_uploaded_document

Fetches the file uploaded via request_upload_url and runs the same parsing pipeline as upload_document_base64: every paragraph, heading, table, row, and cell gets a unique chunk ID, enabling targeted structural edits via chat ("remove row 3 of the pricing table" works), with tables, borders, shading, alternating row colors, fonts, and inline styling preserved on edit and export. By default the response is compact (metadata only, no document body) to keep your context small — the document is loaded into the session and you edit it via chat; pass return_html=true if you need the parsed HTML inline. Uploading and parsing is NOT itself a billable operation — you are charged only when the AI edits the document. Specify parse_mode='document' to load as the active editable document, or parse_mode='attachment' to load as a read-only AI-searchable reference. A long document can take minutes to load; the call reports progress while it runs. If the call times out or its connection drops, do not upload again: call process_uploaded_document again with the same upload_id and session_id (it joins the load already running and returns its result), or call get_session_jobs and poll the 'document_ingest' job with get_job until it is completed (its result is this call's response) or failed.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "upload_id": "<upload_id>",
      "filename": "<filename>"
    },
    "name": "process_uploaded_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
filenameYesSame filename passed to request_upload_url.
open_modeNoparse_mode='document' only. 'replace' (default): the document replaces the session's focused document. 'new_tab' / 'new_focused': it opens as an additional document and becomes the focused one. 'background': it opens as an additional document without changing which document is focused.replace
upload_idYesThe upload_id returned by request_upload_url.
parse_modeNo'document' = parse and load as the active editable doc; 'attachment' = process asynchronously as AI-searchable reference (returns job_id to poll).document
session_idNoSession ID to load this document/attachment into; omit it to start a new session (the response returns its session_id, reuse it on chat). Must match the chat/async session-id format — letters, digits, '_', '-', '.' only (no ':'); max 256 chars.
return_htmlNoWhen false (default), the response is compact — metadata only (chunks_count, version_id, page_setup), no document body — to keep your context small; the document is loaded into the session and you edit it via chat. Set true only if you actually need the parsed HTML returned inline.

Output Schema

NameRequiredDescriptionDefault
htmlNo
job_idNo
statusYes
filenameYes
warningsNo
page_setupNo
parse_modeYes
session_idYes
version_idNo
document_idNoparse_mode='document': the id of the open document the file was loaded as (use it with document_id on chat, focus and close).
chunks_countNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does: it discloses billing behavior (upload+parse is not billable; only AI edits are), latency ('can take minutes'), progress reporting, the compact default response, and that the document lives in the session for chat-based editing. The timeout/idempotent-retry semantics are exactly the kind of operational behavior an agent could not infer from the schema.

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?

Front-loaded with the core action and the editability payoff, then operational details, then the recovery procedure — a sensible ordering. It is dense and earns most of its length, but the return_html and parse_mode explanations partially duplicate the schema descriptions, costing some redundancy.

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?

An output schema exists so return values need not be explained, and the description still covers the parts structured data can't: session loading, billing, latency, and failure recovery. For a 6-parameter async ingest tool with no annotations, nothing an agent needs to call it correctly is missing.

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?

Schema coverage is 100%, so the baseline is 3, but the description adds rationale the schema does not: why return_html defaults to false (context size), what parse_mode means for editability versus searchability, and that session_id should be reused on subsequent chat calls. It repeats some schema text rather than going much beyond it, so it stops short of a 5.

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+resource: fetches a file uploaded via request_upload_url and runs the same parsing pipeline as upload_document_base64, with chunk IDs for structural edits. It explicitly positions itself relative to request_upload_url and upload_document_base64, so an agent can distinguish it from the sibling upload tools without opening either schema.

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?

Gives explicit selection criteria: parse_mode='document' for an editable doc vs 'attachment' for a read-only AI-searchable reference, and return_html=true only if HTML is actually needed inline. It also names the recovery path on timeout (re-call with the same upload_id/session_id, or poll get_session_jobs + get_job), which is the rare case where 'when to use alternatives' is fully spelled out.

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.