Skip to main content
Glama

Finish agent run

finish_agent_run
Idempotent

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.

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": {
      "runId": "<runId>",
      "state": "<state>"
    },
    "name": "finish_agent_run"
  }
}

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?

Annotations already declare readOnlyHint=false, idempotentHint=true, destructiveHint=false, so the safety profile is covered; the description adds real value beyond them by explaining the boolean return and its meaning (true = finished, false = no longer Working because a person cancelled). It also discloses the canEdit permission requirement, which annotations do not. It omits what an error response or permission denial looks like, keeping it below a 5.

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?

Two tight sentences with zero filler, front-loading the action and states before the return-value contract and permission caveat. Every clause carries distinct information.

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 three-parameter mutation with no output schema, the definition supplies the return-value contract, the permission requirement, and the failure interpretation an agent needs to act on the result. The only gap is error/exception behavior, which is a modest omission.

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%, with runId's source (list_agent_runs), state's enum semantics, and reason's conditional behavior (kept for Failed, ignored for Done, max 4096) all documented in the schema already. The description adds essentially nothing beyond that, so the baseline 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?

"Finishes a Working agent run as Done or Failed" gives a specific verb, resource, and the two legal terminal states, so an agent knows exactly what the call accomplishes. It also implicitly distinguishes itself from cancellation ("a person cancelled it"), but never names cancel_agent_run explicitly as the alternative sibling.

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?

It supplies a clear prerequisite ("Requires canEdit on the issue") and an operational instruction tied to the result ("false ... so stop working on it"), which tells the agent what to do when the call fails to finish. It does not explicitly state when to prefer this over cancel_agent_run or what to do on error, so it stops short of full when/when-not guidance.

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.