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
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | Same filename passed to request_upload_url. | |
| open_mode | No | parse_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_id | Yes | The upload_id returned by request_upload_url. | |
| parse_mode | No | 'document' = parse and load as the active editable doc; 'attachment' = process asynchronously as AI-searchable reference (returns job_id to poll). | document |
| session_id | No | Session 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_html | No | When 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
| Name | Required | Description | Default |
|---|---|---|---|
| html | No | ||
| job_id | No | ||
| status | Yes | ||
| filename | Yes | ||
| warnings | No | ||
| page_setup | No | ||
| parse_mode | Yes | ||
| session_id | Yes | ||
| version_id | No | ||
| document_id | No | parse_mode='document': the id of the open document the file was loaded as (use it with document_id on chat, focus and close). | |
| chunks_count | No |