Skip to main content
Glama

finish_agent_run

Finishes a Working agent run as Done or Failed. Returns true when the run was finished, false when it was no longer Working - a person cancelled it, so stop working on it. Requires canEdit on the issue.

Input Schema

NameRequiredDescriptionDefault
runIdYesThe run's id, from list_agent_runs.
stateYesDone when the work is finished, Failed when the agent gave up.
reasonNoWhy the run failed, max 4096 characters - kept with a Failed run, ignored for Done. Omit for Done.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4/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 and does fairly well: it discloses the permission requirement (canEdit on the issue), the boolean return semantics including the race condition where the run is no longer Working because a person cancelled it, and that reason is discarded for Done. It doesn't say whether finishing is idempotent or what happens to the run's subsequent state, which keeps it out of 5 territory.

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 tight sentences, front-loaded with the action and its outcomes, then the false-return semantics, then the permission prerequisite. No filler.

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 mutation tool with no annotations and no output schema, the description covers the two things an agent most needs: the permission prerequisite and the meaning of the boolean return value, including the cancellation race. The remaining gap is what the run transitions to after a Done vs Failed finish and whether reason is surfaced anywhere.

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 runId, state, and reason are already fully documented in the schema, including the enum values and the max length. The description adds essentially nothing parameter-specific beyond what the schema says, so the baseline of 3 applies.

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?

States a specific verb ('Finishes') and resource ('a Working agent run') with the two terminal outcomes it can produce (Done or Failed), which is well beyond a restatement of the name. It doesn't explicitly name cancel_agent_run as the sibling that produces the false path, but the reference to a person cancelling the run effectively implies the division of labor.

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

Usage Guidelines4/5

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

Gives real invocation context: the run must currently be Working, and a false return means someone else cancelled it, so the agent should stop working. It lacks an explicit 'do not call this if...' or a direct pointer to cancel_agent_run, but the condition that selects this tool over that one is inferable.

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.