tail_agent_log
Retrieve the tail of a session transcript, including timestamps, tool calls, and token usage, for debugging and cost tracking.
Instructions
Return the tail of a session's transcript, oldest-first.
session accepts a full session UUID, a unique UUID prefix, or
the keyword "latest". By default "latest" excludes the
session currently calling this tool (so it never tails its own
still-being-written log); pass include_current=True to opt in.
Returns up to limit entries (default 100, max 1000) in
chronological order. Each entry reports its type and timestamp;
assistant entries list any tool(s) called and, for entries
carrying usage, per-entry token counts and estimated cost;
tool-result entries report each result's tool_use_id and
whether it was an error. If session is ambiguous (a prefix
matching multiple sessions) or matches no session, returns a
structured {"error": ...} dict instead of raising. Read-only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| session | Yes | ||
| include_current | No |