Skip to main content
Glama

compact_context

Assemble minimal, token-efficient context for concepts or entities by combining function bodies, structural summaries, domain concepts, and logic clusters into compact text blocks suitable for LLM prompt injection.

Instructions

Assemble minimal, token-efficient context for a concept, entity, or file — combines function body + structural summary + domain concepts + logic cluster into a compact text block suitable for LLM prompt injection. Much smaller than full source while preserving behavioral and structural information. Use when assembling context for another LLM, when asked to 'summarize X compactly', or when building prompts about codebase entities.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scopeYesConcept name, entity name, or file path
max_tokensNoToken budget (default: 500)
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses key behavioral traits: the tool creates 'compact text block suitable for LLM prompt injection' that is 'much smaller than full source while preserving behavioral and structural information.' However, it doesn't mention potential limitations (e.g., accuracy trade-offs with compression), processing time, or error conditions.

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 efficiently structured in three sentences: first states the core purpose, second contrasts with alternatives, third provides usage guidelines. Every sentence adds value without redundancy, and it's front-loaded with the main function.

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's moderate complexity (2 parameters, no output schema, no annotations), the description is reasonably complete. It explains what the tool produces (compact context block), when to use it, and how it differs from full descriptions. However, without an output schema, it could benefit from more detail about the return format or examples of the compact context structure.

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 schema already documents both parameters thoroughly. The description doesn't add specific parameter semantics beyond what's in the schema (e.g., it doesn't clarify format expectations for 'scope' or practical ranges for 'max_tokens'). The baseline of 3 is appropriate when the schema does the heavy lifting.

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's purpose: 'Assemble minimal, token-efficient context for a concept, entity, or file' with specific components (function body, structural summary, domain concepts, logic cluster). It distinguishes from siblings like describe_file or describe_symbol by emphasizing compactness and token efficiency for LLM prompt injection.

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 explicit usage scenarios: 'Use when assembling context for another LLM, when asked to 'summarize X compactly', or when building prompts about codebase entities.' This gives clear guidance on when to choose this tool over alternatives like describe_file (which might provide full details) or list_concepts (which might list without summarization).

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/EtienneChollet/ontomics'

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