Skip to main content
Glama

get_context_bundle

Read-onlyIdempotent

Fetch a symbol's source code, import dependencies, and optional callers within a token budget. Supports batch queries with shared-import deduplication instead of chaining symbol calls.

Instructions

Get a symbol's source code + its import dependencies + optional callers, packed within a token budget. Supports batch queries with shared-import deduplication. Use instead of chaining get_symbol calls. For a single symbol without imports, use get_symbol — lighter. Read-only. Returns JSON: { primary: [{ symbol_id, file, source }], imports: [{ file, source }], token_usage }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fqnNoAlternative: look up by FQN
symbol_idNoSingle symbol ID
symbol_idsNoBatch: multiple symbol IDs
token_budgetNoMax tokens (default 8000)
output_formatNoOutput format (default json).
include_callersNoInclude who calls these symbols (default false)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv3.22.0
    • removedInput schema / required
      Removed value: -[
      -  "symbol_id",
      -  "fqn"
      -]
  2. Changed1 schema field changedv3.3.0
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
  3. Added
  4. Removedv1.38.0
  5. Changed2 schema fields changedv1.35.1
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / required
      Added value: +[
      +  "symbol_id",
      +  "fqn"
      +]
  6. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already carry readOnlyHint=true and idempotentHint=true, and the description's 'Read-only' agrees with them rather than contradicting them. The description adds genuine behavior beyond annotations: token-budget packing, shared-import deduplication for batch queries, and the exact return shape (primary, imports, token_usage). It loses a point because the 'Returns JSON' claim ignores the markdown output_format option, and truncation/error behavior when the budget is exceeded is undisclosed.

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?

Four tight sentences, each earning its place: function, batch/dedup semantics, routing to the sibling tool, and return shape. The core capability is front-loaded in the first clause with zero filler.

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 6-parameter read-only tool with no output schema, the description covers the essentials: return shape, token budget behavior, batch semantics, and the lighter alternative. Gaps remain at the edges — the interplay between fqn/symbol_id/symbol_ids and behavior when the token budget is exceeded — but the per-parameter schema descriptions and rich annotations carry much of that load.

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 coverage is 100%, so the baseline is 3; the schema already documents all six parameters. The description earns an extra point by adding intent behind key parameters: 'packed within a token budget' clarifies the purpose of token_budget, and 'batch queries with shared-import deduplication' gives symbol_ids behavioral meaning beyond its bare listing.

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?

The description opens with a specific verb-object pair — 'Get a symbol's source code + its import dependencies + optional callers' — making the tool's function unmistakable. It also explicitly differentiates itself from get_symbol, its closest sibling, by describing what this tool bundles that get_symbol does not.

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?

Provides explicit routing rules: 'Use instead of chaining get_symbol calls' for import-heavy or batch needs, and 'For a single symbol without imports, use get_symbol — lighter' as the exclusion condition with the alternative named. This is exactly the when/when-not guidance this dimension requires.

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