Skip to main content
Glama

usage_link

Destructive

Link Codex/Claude Code session transcripts to a Task Passport so usage_report can report tasks by ID. Lists candidates, links confirmed sessions, and manages unlink/coverage.

Instructions

Link Codex/Claude Code session transcripts to a Task Passport so usage_report can report the task by id. Without pick, file, remove or coverage it only lists candidate sessions of the task worktree with requests while the task was current. Show candidates to the user and link only what they confirm: pick links sessions by session id (numbers can shift between calls); client/file/turns links an explicit one. Re-linking a file replaces its selection; remove unlinks a linked file by path or session id (traced sessions are always included). Writes .agentpack/usage/.json only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNoExplicit local JSONL path; relative paths resolve from the pack root.
jsonNoReturn JSON instead of human-readable text.
noteNoCoverage note; requires coverage.
pickNoCandidate session ids (preferred) or numbers from the listing to link.
taskNoTask Passport id; omit for the current task.
phaseNoPhase label for the linked sources. Default main.
turnsNoInclusive N, N: (to the end) or N:M turn selection for file.
clientNo
removeNoLinked JSONL path or session id to unlink; exclusive with other link options.
coverageNoDeclared coverage; requires note.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.9.0

TDQS

A4.5/5.0
Behavior5/5

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

Annotations declare destructiveHint=true and idempotentHint=false, and the description adds real substance beyond them: the exact persistence target (.agentpack/usage/<task id>.json), that re-linking a file replaces its prior selection, that traced sessions are always included, and that session numbers can shift between calls so ids are safer. This is precisely the mutation-behavior detail annotations cannot express.

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 the default no-flag behavior and the write target, and nearly every clause carries decision-relevant information. The middle sentences are dense run-ons (client/file/turns, remove) that could be split for faster scanning.

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 10-parameter, zero-required, destructive mutation tool with no output schema, the description covers the operating modes, defaults, exclusivity rules, and side effects well. It is slightly thin on what the candidate listing contains and on the phase/task defaulting behavior, but nothing critical for correct invocation 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 description coverage is already 90%, so the baseline is 3, but the description adds mode-selection meaning the schema lacks: remove is exclusive with other link options, turns applies to file, and note/coverage are coupled. It stops short of documenting every parameter's edge cases (e.g. task default, phase default main).

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?

States a specific verb+resource (link session transcripts to a Task Passport) and the downstream payoff (usage_report can report the task by id). The listing-vs-linking mode split makes it clearly distinguishable from siblings like usage_report and record_source.

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 clear operational context: with no pick/file/remove/coverage it only lists candidates, and the agent is told to show candidates to the user and link only what they confirm. It does not explicitly name an alternative tool or say when not to use this one, so it falls just short of the top band.

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