Skip to main content
Glama

trace_contract

Read-onlyIdempotent

Trace a symbol or path across all layers to get its stack location, contract triangle, cross-layer verification tasks, and active pull-request links in one lookup.

Instructions

Full cross-layer trace: stack location + contract triangle + cross-layer verify tasks + active-PR links.

This is the enriched trace. Use trace_in_stack for a lightweight stack-location-only lookup.

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": {
      "symbol_or_path": "<symbol_or_path>"
    },
    "name": "trace_contract"
  }
}

Input Schema

NameRequiredDescriptionDefault
symbol_or_pathYesSymbol name or path to trace through the stack (e.g. "LowerHostTensorCollectives", "pypto/src/codegen/distributed/foo.cc"). Matched against abstraction cards, path-prefix rules, and contract artifacts.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so safety and repeatability need no restating. The description adds the output composition (contract triangle, verify tasks, PR links) and implicitly signals this is the heavier variant, but says nothing about cost, latency, or what happens when no contract artifacts match — and the output schema already covers return values.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences, front-loaded with the core capability and closing with the disambiguation rule. Nothing is redundant with the name or title.

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 one-parameter read-only lookup with an output schema and full annotation coverage, the description is sufficient: it names the inputs' semantics, the result components, and the alternative. Only the heavier-than-alternative cost expectation is left implicit.

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?

With a single parameter at 100% schema coverage, the schema already documents the symbol-or-path semantics, matching behavior against abstraction cards and path-prefix rules, plus concrete examples. The description adds no further parameter meaning, so the baseline 3 is appropriate.

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?

"Full cross-layer trace" gives a specific operation, and the colon-list enumerates exactly what the trace includes (stack location, contract triangle, cross-layer verify tasks, active-PR links). It also names the sibling trace_in_stack and what it lacks, so an agent can distinguish the two without opening schemas.

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?

It explicitly routes lightweight, stack-location-only lookups to trace_in_stack, which is a real selection rule rather than an implied one. It does not address when a full trace is unnecessary relative to the other explain_* tools, but the core when/then-alternative guidance is present.

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