Skip to main content
Glama

get_context_bundle

Read-onlyIdempotent

Retrieve a symbol's source code along with its import dependencies and optional callers within a token budget. Supports batch queries with shared-import deduplication to minimize tokens.

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
fqnYesAlternative: look up by FQN
symbol_idYesSingle 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. Dates show when Glama detected each change.

  1. Changed1 schema field changedv3.3.0
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
  2. Added
  3. Removedv1.38.0
  4. Changed2 schema fields changedv1.35.1
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / required
      Added value: +[
      +  "symbol_id",
      +  "fqn"
      +]
  5. 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 declare read-only, idempotent, and non-destructive behavior; the description reinforces 'Read-only' and adds useful context about shared-import deduplication, token-budget packing, and the JSON shape. It does not explain truncation or error behavior when the token budget is exceeded, but this is a minor gap given the annotation coverage.

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?

The description is compact, front-loaded with the core function, and every sentence earns its place—covering scope, batch behavior, sibling routing, safety, and return format without 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?

With no output schema, the description provides a useful JSON skeleton and clear invocation guidance. It leaves some edge behavior implicit, such as how include_callers alters the response shape and what happens when the token budget is insufficient, but the schema and annotations cover most invocation details.

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 description coverage is 100%, so the baseline is 3. The description adds meaning beyond the schema by explaining why batch queries and token_budget matter: they enable shared-import deduplication within a packed token budget.

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 operation (get) and resource (a symbol's source code, imports, and optional callers packed within a token budget). It also clearly distinguishes itself from get_symbol, naming the sibling and the difference in scope.

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?

Explicitly says to use this instead of chaining get_symbol calls and gives the lighter-alternative condition: for a single symbol without imports, get_symbol is better. This is concrete, actionable routing guidance.

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

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