Skip to main content
Glama

resolve_context_bundle

Read-onlyIdempotent

Compile a token-pruned Markdown context bundle from topological dependency distances around a target file to supply relevant multi-module context before code edits.

Instructions

Calculate topological dependency graph distances (D0 full target_file, D1 interface stubs, D2 nominal symbols) within project_root and compile a token-pruned Markdown context bundle, with optional reactive degradation via breaker_state and session_id. Use this as your primary context builder before editing a file in a multi-module project. For inspecting isolated files, use prune_file instead. Read-only operation.

Input Schema

NameRequiredDescriptionDefault
session_idNoSession identifier (SES-...) to connect with TokenCast budget tracking
target_fileYesPath to the active target file in editing (D0)
project_rootNoRoot directory of the project. Defaults to target file's directory.
breaker_stateNoOptional circuit breaker state (CLOSED, TRIPPED, HALTED) or decision kind

Output Schema

NameRequiredDescriptionDefault
contentYesCompiled topological Markdown prompt context bundle
isErrorYesTrue if dependency resolution or file traversal failed

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv3.8.1
    • addedInput schema / properties / breaker_state
      Added value: +{
      +  "description": "Optional circuit breaker state (CLOSED, TRIPPED, HALTED) or decision kind",
      +  "type": "string"
      +}
    • addedInput schema / properties / session_id
      Added value: +{
      +  "description": "Session identifier (SES-...) to connect with TokenCast budget tracking",
      +  "type": "string"
      +}
  2. Changed1 schema field changedv3.5.6
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "content": {
      +      "description": "Compiled topological Markdown prompt context bundle",
      +      "items": {
      +        "properties": {
      +          "text": {
      +            "description": "Token-optimized Markdown context bundle",
      +            "type": "string"
      +          },
      +          "type": {
      +            "enum": [
      +              "text"
      +            ],
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "type",
      +          "text"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "isError": {
      +      "description": "True if dependency resolution or file traversal failed",
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "content",
      +    "isError"
      +  ],
      +  "type": "object"
      +}
  3. First observedv3.5.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), so the bar is lower. The description still adds substantive behavior: what gets included per tier (full file vs. interface stubs vs. nominal symbols), token pruning, and reactive degradation through `breaker_state`/`session_id`. 'Read-only operation' is redundant with the annotations, and return format is left to the output schema.

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 core operation, then usage guidance, then the alternative. Dense but every clause carries selection value; the trailing 'Read-only operation' duplicates the annotations and is the only wasted sentence.

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?

An output schema exists so return values need no explanation, annotations carry the safety profile, and 100% schema coverage handles parameters. For a four-param read tool, the description covers purpose, routing, and tier semantics fully.

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 description coverage is 100%, so the schema already documents all four parameters, including the D0 mapping for `target_file`. The description reinforces that mapping and frames `breaker_state`/`session_id` as reactive degradation, but adds no syntax, defaults, or formats beyond what the schema states. Baseline 3 applies.

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: 'Calculate topological dependency graph distances ... and compile a token-pruned Markdown context bundle', with the D0/D1/D2 tier scoping spelled out. It explicitly differentiates itself from the sibling `prune_file`.

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

Usage Guidelines5/5

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

Gives an explicit when: 'primary context builder before editing a file in a multi-module project', and names the alternative with its own condition: 'For inspecting isolated files, use `prune_file` instead.' Nothing is left to inference.

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