Skip to main content
Glama

get_smart_skeleton_context

Retrieve full source for a focus file or symbol with compact AST signatures for its imports and callers, so LLMs edit code with surrounding context while cutting token use.

Instructions

Focus-aware dynamic skeletonizer. Returns the full, unpruned implementation of the focus file (or specific focus symbol), surrounded by ultra-compact T-3 AST signatures for all 1st-degree outbound imports and inbound callers. Solves the 'Lost in the Middle' problem while saving 95%+ tokens.

Behavior:

  • Read-only: Traverses local AST dependencies; does not mutate files.

  • Idempotent: Returns identical focus + skeleton bundles for the same codebase state.

  • 100% Offline: Local AST parsing and signature reduction.

Usage Guidelines:

  • When to use: Run when editing a specific file to provide the LLM with full implementation context plus compact interface skeletons of adjacent modules.

  • Sibling Routing: For repository-wide context, use 'get_project_context_tree'. For symbol index without file contents, use 'generate_repo_map'.

Returns: Structured Markdown with full focus file source code and 1st-degree AST skeletons for imported and caller modules.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
focus_fileYesTarget file path to focus on and retain with full implementation.
focus_symbolNoOptional specific function or class name within focus_file to isolate.
project_rootNoRoot directory of the repository (default: current directory)..

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.1.1
    • addedInput schema / properties / focus_file / description
      Added value: +"Target file path to focus on and retain with full implementation."
    • addedInput schema / properties / focus_symbol / description
      Added value: +"Optional specific function or class name within focus_file to isolate."
    • addedInput schema / properties / project_root / description
      Added value: +"Root directory of the repository (default: current directory)."
  2. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it declares read-only, idempotent, and 100% offline behavior, plus the token-efficiency trait. It does not address failure modes (missing file, non-parseable syntax, side effects of the focus_symbol filter), which prevents a 5.

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 behavior in the first sentence and organized under Behavior/Usage/Returns headings. Some marketing phrasing ('Lost in the Middle', 'saving 95%+ tokens') adds flavor at the cost of a little density, but overall structure is tight.

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?

An output schema exists, so the description needn't explain return values, yet it still summarizes them as structured Markdown. Purpose, usage, siblings, and behavior are all covered; only error/edge-case handling is missing, which is a minor gap for this read-only tool.

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 baseline is 3. The description's parenthetical '(or specific focus symbol)' reinforces the focus_file/focus_symbol relationship, but it adds little syntax or format detail beyond the schema and never addresses the project_root parameter's role.

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: returns the full focus file/symbol plus T-3 AST signatures of its 1st-degree imports and callers. The scope distinction (full implementation vs. compact skeletons) is precise and lets an agent differentiate it from the many other context/repo tools in the sibling list.

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 an explicit 'When to use' line (editing a specific file) and a 'Sibling Routing' section that names get_project_context_tree for repo-wide context and generate_repo_map for symbol-only indexes. This is exactly the when/when-not/alternatives structure.

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