Skip to main content
Glama

Continue a stopped agent run

continue_agent

Carry on an agent run that stopped at its credit limit (status credit_limit) with a new budget. It starts a new run on the same thread that resumes where the stopped one was, keeps the pages it read and answers in full. Use it when run_agent or get_job answered status 'credit_limit' and data.partial is not enough. A run that finished, failed or was cancelled cannot be carried on: ask run_agent again. Inputs: id is the stopped run's id, from its answer. max_credits and max_steps are the new run's own, e.g. max_credits=4000; omitted, they are the stopped run's. Cost: the pages the stopped run read are not paid for again. New pages are charged as they are read, a refused page free, and the model's tokens at the model provider's price plus 20%, within max_credits. Timing: it returns at once with the new run's job, as run_agent does. Call get_job(kind='agent', id=...) with the new id every 30 to 60 seconds; cancel_job stops it. Calling continue_agent again for a run already carried on returns the run that carried it on, not a new one. Refusals: code conflict for a run that did not stop at its credit limit (or was carried on meanwhile, by another call), not_found for an unknown id, expired past its 7-day keep date. Needs write access; a read-only connection is refused with code 'read_only'.

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": {
      "id": "<id>"
    },
    "name": "continue_agent"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesThe id of the run that stopped at its credit limit, from run_agent's or get_job's answer.
max_stepsNoThe most steps the new run may take, 1 to 100; omit for the stopped run's.
max_creditsNoThe most the new run may spend, 1 to 100,000 credits; omit for the stopped run's.

Output Schema

NameRequiredDescriptionDefault
idNoThe run's id: for get_job and cancel_job with kind 'agent'.
jobNoWhile it works: {kind: 'agent', id} for get_job and cancel_job.
codeNoOnly on a failure: a machine-readable reason, e.g. read_only, validation, plan_limit or not_found.
dataNoThe answer: JSON matching the schema, or {text} without one; {partial} at credit_limit. When the answer is too long for 60,000 characters, a string of its JSON text, cut, and the note says where the whole answer is.
noteNoWhat to do next, and what was cut and where to get it whole.
errorNoWhen the call failed, or the run ended in error: what went wrong, in words an assistant can act on.
stepsNoThe steps the agent has taken.
budgetNoThe most the run may spend: max_credits, or less when the workspace had less left (budgetLimited).
detailNoOnly on a failure: the API's own wording, when the error was rephrased.
promptNoThe question as it was asked.
statusNoqueued/running with a `job` while it works; done, credit_limit (stopped at its budget, data.partial holds what it found, continue_agent carries it on), cancelled or error once finished; 'expired' past its keep date. On an error, the HTTP status code.
sourcesNoThe pages the answer rests on, each {url, title, pageId}; the first 50 when the answer had to be cut.
stopReasonNoWhy it stopped early, e.g. credit_limit, step_limit or cancelled; empty when it finished on its own.
creditsUsedNoCredits spent so far: pages read plus the model's tokens.
fieldSourcesNoWhere each value of data came from: its path (e.g. 'plans[0].price', or '[2].name' for a list answer) to {url, pageId}, a page the run read. The first thing left out when the answer is too long for 60,000 characters, and the note says so.
budgetLimitedNotrue when the budget was lowered to what the workspace had left when the run started.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.8/5.0
Behavior5/5

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

Goes well past the annotations: discloses the cost model (already-read pages not re-billed, new pages charged on read, refused pages free, tokens at provider price +20% within max_credits), the async-return behavior, write-access requirement with a 'read_only' refusal, and specific refusal codes (conflict, not_found, 7-day expiry). The retry statement ("calling continue_agent again ... returns the run that carried it on") sits in mild tension with idempotentHint=false, but the description resolves it by distinguishing concurrent calls (conflict) from sequential retries.

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?

Front-loaded with purpose and eligibility, then cleanly sectioned into Inputs, Cost, Timing, Refusals. It is longer than average for a 3-parameter tool, and some cost detail (the 20% token markup) is informational rather than action-guiding, but nearly every sentence eliminates a real ambiguity.

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

Completeness5/5

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

For a mutation tool with an output schema, an async job handoff, and billing implications, it covers everything an agent needs: eligibility, parameter inheritance, polling cadence, cancellation, auth, and named error codes. Nothing required to invoke it correctly is missing.

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

Parameters4/5

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

Schema coverage is 100%, so the schema already documents all three parameters. The description still adds meaning: which id to supply (the stopped run's, from its answer) and, importantly, that max_credits/max_steps are the new run's own budget rather than a cumulative total, with a worked example (max_credits=4000).

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?

"Carry on an agent run that stopped at its credit limit (status credit_limit) with a new budget" states a specific verb, resource, and triggering condition, and the following sentence clarifies the exact semantics: a new run on the same thread resuming the stopped one. This clearly separates it from run_agent (starts runs) and get_job (polls them).

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?

Explicit positive trigger ("Use it when run_agent or get_job answered status 'credit_limit' and data.partial is not enough") and explicit negative cases (finished/failed/cancelled runs → "ask run_agent again"). It also prescribes the follow-up lifecycle: poll get_job with the new id every 30–60s, cancel with cancel_job.

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.