Skip to main content
Glama

get_context_bundle

Read-onlyIdempotent

Bundle a symbol's source code, import dependencies, and callers within a token budget. Supports batch queries with shared-import deduplication to replace multiple get_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 — deduplicates shared imports across symbols. For a single symbol without imports, get_symbol is lighter. Read-only. Returns JSON: { primary: [{ symbol_id, file, source }], imports: [{ file, source }], token_usage }.

Input Schema

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

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

Annotations already declare readOnlyHint=true and idempotentHint=true. The description adds behavioral context: read-only nature, return structure (JSON with sections), and token budget mechanism. No contradictions. With good annotations, the additional context merits a 4.

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?

Three sentences: purpose, usage guidelines, return structure. Front-loaded, every sentence adds value, no fluff. Excellent conciseness.

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?

Given the tool's complexity (6 parameters, batch queries, token budget), the description covers return structure, deduplication benefit, and differentiation from get_symbol. No output schema makes the return description essential; it is provided. Complete and self-contained.

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% with parameter descriptions. The description adds meaning beyond the schema by explaining that symbol_id and symbol_ids enable batch queries with deduplication, and that fqn is an alternative. It also contextualizes token_budget and include_callers implicitly. This goes beyond a baseline 3.

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 precisely states the tool retrieves source code, imports, and optional callers within a token budget. It distinguishes itself from siblings by explicitly calling out get_symbol and the benetfit of shared-import deduplication.

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?

The description provides clear when-to-use guidance: 'Use instead of chaining get_symbol calls' and when-not-to-use: 'For a single symbol without imports, get_symbol is lighter.' This directly addresses alternatives.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nikolai-vysotskyi/trace-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server