Skip to main content
Glama

get_execution_diagnostics

Read-onlyIdempotent

Retrieve full diagnostic traces for an AI execution, including LLM and tool call timelines with tokens, latency, and cache usage to reconcile cost and debug performance.

Instructions

Retorna trace de diagnóstico completo de uma execução: timeline cronológica de LLM calls e tool calls, com tokens, latência, modelo usado e finish_reason. Cada llm_call traz cached (tokens LIDOS do cache, com desconto) e cache_creation (tokens ESCRITOS no cache, cobrados a ~1,25× a entrada); summary.cache_creation_tokens soma a escrita do turno — sem esse campo o cost_usd parece não fechar com a tabela de preços (era a #344). execution.metadata traz a correlação que o caller do /stream mandou (trace_id, correlation_id…), ou null. Use o execution_id (campo id do agent_executions) ou root_execution_id retornado pelo chat_with_agent.

Input Schema

NameRequiredDescriptionDefault
execution_idYesUUID da execução (id do agent_executions ou root_execution_id)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description adds real value on top: the semantics of cached vs cache_creation tokens, the 1.25x write-cost, why summary.cache_creation_tokens matters for cost_usd reconciliation, and that execution.metadata is null when the caller sent no correlation data. This is unusually rich disclosure for a read tool, though it does not cover pagination or result-size limits.

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-loads the purpose in the first sentence, then layers detail in a logical order (timeline contents, cache fields, cost caveat, metadata, id sourcing). It is dense and a touch long, and the internal ticket reference '(era a #344)' is noise an agent cannot act on.

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, so the description must carry the return-shape burden and it does: it names the timeline, per-call fields, cache token fields, summary aggregation, and metadata correlation. An agent has enough to call it and interpret the result without guessing.

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 coverage is 100% and the single parameter is fully documented in the schema, including that it accepts an agent_executions id or a root_execution_id. The description repeats that same guidance rather than adding new syntax or format detail, 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+resource and enumerates exactly what the trace contains (chronological timeline of LLM and tool calls with tokens, latency, model, finish_reason). It is clear what the tool returns, but it never distinguishes itself from the similarly named sibling get_execution_trace, which an agent would reasonably confuse it with.

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 concrete entry context: use the execution_id from agent_executions.id or the root_execution_id returned by chat_with_agent. That is a clear 'when to use' signal. It stops short of any exclusions or pointing to get_execution_trace as the alternative, so it is not a full 5.

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

Deploy Server

Other Tools