Skip to main content
Glama

complete_receipt

Finalize a pending receipt by recording execution results, costs, and output data. Updates status to completed, failed, or timeout and re-signs with Ed25519.

Instructions

Finalize a pending receipt by recording execution results, costs, and output data. Updates the receipt status to completed, failed, or timeout and re-signs with Ed25519. Use after create_receipt when you need to record results separately from creation (two-phase tracking). Cannot complete an already-completed receipt. Returns the updated signed receipt.

Input Schema

NameRequiredDescriptionDefault
errorNoError details if status is "failed" (e.g., {"code": "TIMEOUT", "message": "..."})
modelNoAI model used during execution
statusYesFinal status: "completed" (success), "failed" (error occurred), or "timeout" (timed out)
cost_usdNoTotal cost in USD
tokens_inNoInput tokens consumed
confidenceNoConfidence score for output quality, 0.0 to 1.0
latency_msNoTotal execution time in milliseconds
receipt_idYesThe receipt ID to complete — must be a pending receipt (status: "pending")
tokens_outNoOutput tokens generated
tool_callsNoNames of tools called during execution
output_hashNoPre-computed SHA-256 hash of the output in format "sha256:hexstring"
output_summaryNoHuman-readable summary of the execution result
callback_verifiedNoWhether an external callback verified the result

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removedv0.2.11
  3. Changed13 schema fields changedv0.2.10
    • changedInput schema / properties / callback_verified / description
      Previous value: -"Whether callback was verified"New value: +"Whether an external callback verified the result"
    • changedInput schema / properties / confidence / description
      Previous value: -"Confidence score 0-1"New value: +"Confidence score for output quality, 0.0 to 1.0"
    • changedInput schema / properties / cost_usd / description
      Previous value: -"Cost in USD"New value: +"Total cost in USD"
    • changedInput schema / properties / error / description
      Previous value: -"Error details if failed"New value: +"Error details if status is \"failed\" (e.g., {\"code\": \"TIMEOUT\", \"message\": \"...\"})"
    • changedInput schema / properties / latency_ms / description
      Previous value: -"Latency in milliseconds"New value: +"Total execution time in milliseconds"
    • changedInput schema / properties / model / description
      Previous value: -"AI model used"New value: +"AI model used during execution"
    • changedInput schema / properties / output_hash / description
      Previous value: -"Hash of the output data"New value: +"Pre-computed SHA-256 hash of the output in format \"sha256:hexstring\""
    • changedInput schema / properties / output_summary / description
      Previous value: -"Human-readable summary"New value: +"Human-readable summary of the execution result"
    • changedInput schema / properties / receipt_id / description
      Previous value: -"The receipt ID to complete"New value: +"The receipt ID to complete — must be a pending receipt (status: \"pending\")"
    • changedInput schema / properties / status / description
      Previous value: -"Final status"New value: +"Final status: \"completed\" (success), \"failed\" (error occurred), or \"timeout\" (timed out)"
    • changedInput schema / properties / tokens_in / description
      Previous value: -"Input tokens"New value: +"Input tokens consumed"
    • changedInput schema / properties / tokens_out / description
      Previous value: -"Output tokens"New value: +"Output tokens generated"
    • changedInput schema / properties / tool_calls / description
      Previous value: -"Tools called"New value: +"Names of tools called during execution"
  4. First observedv0.2.8

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses behavioral traits: updates status, re-signs with Ed25519, and cannot complete an already-completed receipt. It does not mention potential side effects or immutability, but the disclosed traits are sufficient for the tool's purpose.

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?

The description is three sentences long, each serving a distinct purpose: stating the action, providing usage context, and adding constraints/return info. It is front-loaded with the key verb and resource, with no superfluous words.

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?

Given 13 parameters (schema-documented), no output schema, and no annotations, the description covers the core functionality, usage context, constraints, and return value. It could mention the optional parameters for detailed tracking, but the schema covers them, so completeness is adequate.

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

Parameters3/5

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

Schema description coverage is 100%, so the baseline is 3. The description does not add meaning beyond the schema, merely stating the tool records results and outputs. No param-specific enrichment is provided, but the schema already handles parameter semantics well.

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 clearly states the verb 'Finalize' and resource 'pending receipt', detailing that it records execution results, costs, output data, updates status, and re-signs with Ed25519. It explicitly distinguishes from 'create_receipt' by mentioning two-phase tracking, making it distinct from its sibling tools.

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?

The description gives explicit usage guidance: 'Use after create_receipt when you need to record results separately from creation (two-phase tracking).' It also includes a constraint: 'Cannot complete an already-completed receipt.' This provides clear when-to-use and when-not-to-use information.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.