Skip to main content
Glama

Finalize agent execution

finalize_agent_execution
DestructiveIdempotent

Close an execution with a terminal status and a summary of the projects changed during that run.

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": {
      "executionId": "<executionId>",
      "terminalStatus": "<terminalStatus>",
      "occurredAt": "<occurredAt>",
      "changedProjects": "<changedProjects>",
      "idempotencyKey": "<idempotencyKey>"
    },
    "name": "finalize_agent_execution"
  }
}

Input Schema

NameRequiredDescriptionDefault
summaryNoConcise account of the work or result being recorded.
occurredAtYesTimestamp of the execution event being recorded.
executionIdYesExecution record ID returned when the execution was registered; associates this call with that execution. Not a session or project ID.
idempotencyKeyYesCaller-generated retry key. Reuse the same key and identical payload only to retry the same mutation; use a new key for a new action.
terminalStatusYesFinal status of the execution being closed.
changedProjectsYesProjects whose state changed during this execution.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / executionId / description
      Previous value: -"Execution record.id from begin_agent_execution when associating this call with an existing execution; not a session or project ID."New value: +"Execution record ID returned when the execution was registered; associates this call with that execution. Not a session or project ID."
  2. Changed6 schema fields changed
    • addedInput schema / properties / changedProjects / description
      Added value: +"Projects whose state changed during this execution."
    • removedInput schema / properties / changedProjects / items / properties / projectId / description
      Removed value: -"Execution record.id from begin_agent_execution when associating this call with an existing execution; not a session or project ID."
    • removedInput schema / properties / changedProjects / items / properties / syncId / description
      Removed value: -"Execution record.id from begin_agent_execution when associating this call with an existing execution; not a session or project ID."
    • addedInput schema / properties / occurredAt / description
      Added value: +"Timestamp of the execution event being recorded."
    • addedInput schema / properties / summary / description
      Added value: +"Concise account of the work or result being recorded."
    • addedInput schema / properties / terminalStatus / description
      Added value: +"Final status of the execution being closed."
  3. Changed4 schema fields changed
    • addedInput schema / properties / changedProjects / items / properties / projectId / description
      Added value: +"Execution record.id from begin_agent_execution when associating this call with an existing execution; not a session or project ID."
    • addedInput schema / properties / changedProjects / items / properties / syncId / description
      Added value: +"Execution record.id from begin_agent_execution when associating this call with an existing execution; not a session or project ID."
    • addedInput schema / properties / executionId / description
      Added value: +"Execution record.id from begin_agent_execution when associating this call with an existing execution; not a session or project ID."
    • addedInput schema / properties / idempotencyKey / description
      Added value: +"Caller-generated retry key. Reuse the same key and identical payload only to retry the same mutation; use a new key for a new action."
  4. First observed

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true, idempotentHint=true and openWorldHint=false. The description reinforces this with 'terminal status', which conveys finality and irreversibility, but it does not explain what the destructive effect is, whether the close can be undone, or how retries interact with the terminal transition beyond what the schema's idempotencyKey text says.

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?

A single front-loaded sentence with no padding, naming the action first. The only weakness is that the trailing phrase 'a summary of the projects changed' compresses two distinct parameters into one ambiguous clause.

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 six-parameter mutation with full schema coverage and complete annotations, the description covers what the tool does and its terminal nature. It would be stronger if it noted that an executionId from registration is required and what happens to an execution after finalization, but the structured fields carry most of that burden.

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 all six parameters are already documented, including executionId disambiguation and idempotencyKey retry semantics. The description adds essentially nothing beyond the schema and slightly muddies 'summary' by pairing it with 'the projects changed', which could be read as the summary being about projects rather than the work recorded.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb and resource ('Close an execution') plus the two payload concepts it carries (terminal status, changed projects). It does not differentiate itself from the execution-lifecycle siblings such as finish_agent_session or get_agent_execution_status, so an agent must infer which lifecycle terminator applies.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: 'close an execution ... during that run' suggests this is the end-of-run call, but there is no explicit when-to-use, no statement of prerequisites (an execution must first be registered), and no pointer to alternatives for aborting or checking status.

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