Skip to main content
Glama

phone_run_end

Closes a live task run and returns HTTP call, batch, action, flow, failure, and p50/p95 latency metrics for the same run_id and session.

Instructions

Close a live task opened with phone_run_start and return its metrics: HTTP calls (not model turns), batches, observed actions, flows, stale/unknown outcomes, failures and p50/p95 call time. Use the same run_id and session; a missing or already-closed run cannot produce a new live summary. Supply turn_ids only for a complete_trace declaration, including every model generation; otherwise model_round_trips remains unknown. This ends accounting only, not a video recording or the owner lease: use phone_record(stop) and phone_release_owner for those.

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": {
      "run_id": "<run_id>"
    },
    "name": "phone_run_end"
  }
}

Input Schema

NameRequiredDescriptionDefault
run_idYes
instanceNodaemon instance name
turn_idsNoEvery model turn id of the task, when phone_run_start declared a complete trace; `[]` for a task that used no model turns.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.29.2
    • removedInput schema / description
      Removed value: -"Parameters for [`PhoneHandler::phone_run_end`]."
  2. Changed4 schema fields changedv0.29.0
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedInput schema / properties / instance / description
      Previous value: -"Installed local instance name, such as i13 or default. Omit to use the configured daemon. No fallback on failure."New value: +"daemon instance name"
    • removedInput schema / properties / turn_ids / default
      Removed value: -null
    • changedInput schema / properties / turn_ids / type
      Previous value: -[
      -  "array",
      -  "null"
      -]New value: +"array"
  3. Changed1 schema field changedv0.27.3
    • addedInput schema / properties / instance
      Added value: +{
      +  "description": "Installed local instance name, such as i13 or default. Omit to use the configured daemon. No fallback on failure.",
      +  "type": "string"
      +}
  4. First observedv0.21.0

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the annotations, it discloses non-idempotent behavior explicitly (an already-closed run yields no new live summary), clarifies that the "HTTP calls" metric excludes model turns, explains that model_round_trips stays unknown unless every turn id is supplied, and scopes the operation to accounting only, leaving recording and the owner lease untouched. These are exactly the behavioral facts an agent could not derive from readOnlyHint=false / idempotentHint=false alone.

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?

Purpose and return payload are front-loaded in sentence one, with preconditions and scope limits following in logical order; nothing is filler. The metric enumeration and the multi-clause turn_ids caveat make it dense, but each sentence carries distinct operational information.

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?

There is no output schema, and the description compensates by naming the returned metrics (calls, batches, actions, flows, stale/unknown outcomes, failures, p50/p95). For a state-changing close operation with annotations covering safety, the description supplies preconditions, side-effect boundaries, and return content without gaps.

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 67%, and the description compensates by constraining run_id ("same run_id and session") and giving turn_ids rules that the schema only partially states: valid only under a complete_trace declaration, must contain every model generation, and `[]` for a task with no model turns. Only `instance` is left entirely to the schema, so this adds real meaning beyond the structured fields.

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?

"Close a live task opened with phone_run_start and return its metrics" gives a specific verb (close), a specific resource (a run/task previously started), and enumerates the exact metrics returned. It is clearly differentiated from siblings like phone_record and phone_release_owner, which the description explicitly says are separate operations.

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?

It states when to call it (after phone_run_start), the precondition on inputs ("Use the same run_id and session"), the failure condition ("a missing or already-closed run cannot produce a new live summary"), the conditional rule for turn_ids (only for a complete_trace declaration, must include every model generation, `[]` if no model turns), and routes the agent to phone_record(stop) and phone_release_owner for the tasks this tool does not do.

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