Skip to main content
Glama

Finalize document upload

finalize_document_upload

Step 2: call AFTER the file has been PUT to the upload_url from create_document_upload_url. Confirms the object landed in storage, backfills real file_size/mime_type, and sets status to 'current'. Throws if the upload hasn't landed yet — retry once the PUT has actually completed.

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
agent_idNo
document_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Annotations only declare the mutation/read flags; the description goes well beyond them by disclosing the side effects (confirms storage landing, backfills real file_size/mime_type, sets status to 'current') and the error behavior ('Throws if the upload hasn't landed yet') with a retry rule. That is exactly the behavioral context an agent needs before invoking a non-readOnly, non-idempotent tool.

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?

Three short sentences, front-loaded with the ordering cue 'Step 2', then the effect, then the failure mode. No restatement of the name or title and no wasted clauses.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a two-parameter mutation with no output schema, the description covers sequencing, side effects, and error handling, which is the bulk of what an agent needs. The only shortfall is that neither parameter is explained, leaving the caller to infer that document_id is the record created earlier.

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

Parameters2/5

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

Schema description coverage is 0% for two parameters, and the description never mentions 'document_id' or 'agent_id' — it only speaks of 'the file' and 'the upload_url'. With no schema-level documentation to fall back on, the description should have said which document record the ID identifies and what agent_id scopes, so the gap is real rather than absorbed elsewhere.

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 and resource ('finalize_document_upload' → confirm the object landed, backfill metadata, set status to 'current') and explicitly positions itself as 'Step 2' relative to the sibling 'create_document_upload_url'. An agent can distinguish it from create_document_upload_url and add_document without opening any 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?

It states the precise precondition ('call AFTER the file has been PUT to the upload_url from create_document_upload_url'), names the producing sibling, and gives failure/retry guidance for the case where the precondition is not yet met. When-to-use, dependency ordering, and the negative case are all covered.

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