Skip to main content
Glama

chain_code_stream

Extract contract-first code streams along an architectural chain to get symbols, signatures, source status, line ranges, and contracts. Use slice mode for bounded implementation slices.

Instructions

Extract a contract-first stream along an architectural Chain. The default returns symbols, signatures, source status, line ranges, and contracts; use mode=slice only for an explicit bounded implementation slice.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNocontract
chainIdYes
projectRootNo
maxTotalCharsNo
taskContextIdNo
includeStructuredNo
maxLinesPerSymbolNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.3.3
    • addedInput schema / properties / maxLinesPerSymbol
      Added value: +{
      +  "maximum": 40,
      +  "minimum": 4,
      +  "type": "integer"
      +}
    • addedInput schema / properties / mode
      Added value: +{
      +  "default": "contract",
      +  "enum": [
      +    "contract",
      +    "slice"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / taskContextId
      Added value: +{
      +  "minLength": 1,
      +  "type": "string"
      +}
  2. First observedv0.1.0

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations, the description carries the burden of disclosing behavior. It explains the default return content and restricts mode=slice, which is useful. However, it does not mention side effects, read-only status, output format, or how the limit-related parameters affect behavior.

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 sentences with no filler; the main action is front-loaded, the default behavior is summarized, and the mode caveat is placed last. Every sentence contributes information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 7 parameters, no output schema, and no annotations, the description is too sparse to fully prepare an agent. It misses the meaning of most parameters, any prerequisites, and the shape/limits of the returned stream, making it only partially complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate for 7 parameters. It only clarifies the mode enum distinction (contract vs slice) and leave chainId, projectRoot, maxTotalChars, taskContextId, includeStructured, and maxLinesPerSymbol unexplained. Most parameters depend entirely on their schema definitions.

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?

The description uses a specific verb ('Extract') and names a concrete resource ('contract-first stream along an architectural Chain'), with a list of what the default returns. It is clearly about retrieving code/contract information and is distinct from general graph or planning tools, though it does not explicitly name a sibling alternative.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives usage guidance within the tool by distinguishing default contract mode from slice mode, but it does not explain when to choose this tool over siblings like project_map, graph_flow, or architecture_link_suggest. The context for using chain_code_stream is implied rather than explicit.

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