Skip to main content
Glama

finalize_document_upload

Destructive

Step 2 of the create_document_upload_url flow: call this AFTER your shell has PUT the file to the upload_url. Confirms the object actually landed in storage, backfills its real file_size/mime_type, and (unless analyze:false) runs AI analysis the same way upload_document does. Required: document_id (from create_document_upload_url). Throws a clear error if the upload hasn't landed yet — retry after confirming the PUT succeeded. Returns { document_id, storage_path, mime_type, file_size, analyzed, description? }.

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": {
      "document_id": "<document_id>"
    },
    "name": "finalize_document_upload"
  }
}

Input Schema

NameRequiredDescriptionDefault
analyzeNoRun AI text-extraction + summary after confirming the upload (default true).
document_idYesID of the document

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / document_id / description
      Added value: +"ID of the document"
  2. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Beyond the annotations, it discloses the side effects (storage confirmation, size/mime backfill, AI analysis gated by analyze:false), the error condition when the upload hasn't landed, and the return shape. It does not repeat the destructiveHint/idempotentHint flags, but its account of the mutation is concrete enough that an agent knows what it writes.

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 flow position and precondition are front-loaded, and every sentence carries information (precondition, effects, error handling, return shape). It is a dense multi-clause sentence, but no clause is 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?

With no output schema, the description supplies the return fields ({ document_id, storage_path, mime_type, file_size, analyzed, description? }) and covers the error/retry path. For a 2-parameter step tool, 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; the description earns above that by adding provenance for document_id ('from create_document_upload_url') and by clarifying that the analyze flag defaults to true and what happens on analyze:false, which the schema only states tersely.

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?

The description names a specific verb+resource ('finalize_document_upload') and pins its position in a multi-step flow ('Step 2 of the create_document_upload_url flow'), explicitly distinguishing it from the sibling upload_document while stating what it actually does: confirm storage landing, backfill file_size/mime_type, run AI analysis.

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?

It gives an explicit precondition ('call this AFTER your shell has PUT the file to the upload_url'), points to the prerequisite tool for the required id, and names an alternative (upload_document) for the same analysis behavior. It also handles the failure path: 'retry after confirming the PUT succeeded.'

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.