Skip to main content
Glama

pack_context

Read-onlyIdempotent

Pack project context into a single document for external LLMs. Uses intelligent graph-based selection to fit within token budgets.

Instructions

Pack project context into a single document for external LLMs. Intelligent selection by graph importance, fits within token budget. Better than Repomix for focused context. Strategies: most_relevant (default — feature/PageRank ranked), core_first (PageRank always wins, surfaces architecturally central code), compact (signatures only — drops source bodies, lets outlines cover much more of the repo per token). Read-only. Use when sharing project context with external tools. Returns XML/Markdown/JSON with selected code within budget.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scopeYesScope: project (whole repo), module (subdirectory), feature (NL query)
pathYesSubdirectory path (for module scope)
queryYesNatural language query (for feature scope)
formatNoOutput format (default: markdown)
max_tokensNoToken budget (default: 50000)
includeNoSections to include (default: outlines + source + routes)
compressNoStrip function bodies, keep signatures (default: true)
strategyNoPacking strategy (default: most_relevant). core_first = PageRank always wins. compact = drops source bodies, allows much wider outline coverage.
include_budget_reportNoInclude per-section token breakdown + headroom in result (default false)
Behavior4/5

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

Annotations declare readOnlyHint=true, destructiveHint=false, idempotentHint=true, and the description confirms 'Read-only'. It adds behavioral details like strategies ('most_relevant', 'core_first', 'compact'), compression, and output format. No contradictions.

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?

The description is informative and front-loaded with the main purpose. Each sentence adds value, though it could be slightly more concise by avoiding some redundancy. Still, it efficiently conveys essential details.

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?

Given the tool has 9 parameters with full schema descriptions, no output schema, and annotations covering safety, the description sufficiently explains use cases, strategies, and output format. It could mention more about the output structure but is adequate for an AI agent.

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%, but the description adds value by explaining the strategies in detail (e.g., core_first = PageRank always wins) and the effect of compress. Some parameters (like format, include) are not elaborated beyond schema, but overall it enhances understanding.

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 clearly states the tool packs project context into a single document for external LLMs, using intelligent selection by graph importance and token budget. It compares itself to Repomix and lists specific strategies, making it distinct from siblings that retrieve specific context pieces.

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

Usage Guidelines4/5

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

The description explicitly says 'Use when sharing project context with external tools' and provides a comparison to Repomix. However, it does not explicitly list alternatives among the many sibling tools or state when not to use it, which would enhance guidance.

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