Skip to main content
Glama

compact_context

Assemble minimal token-efficient context for any concept, entity, or file by combining function body, structural summary, domain concepts, and logic cluster into a compact text block 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?

No annotations are provided, so the description must fully disclose behavior. It explains that the tool combines function body, structural summary, domain concepts, and logic cluster, but does not detail how it handles large scopes, truncation, or errors. The description is adequate but lacks edge-case transparency.

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 a concise two sentences: first sentence defines the purpose and output, second gives usage contexts. Every phrase earns its place, and the action verb 'Assemble' is front-loaded.

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 two parameters with full schema coverage and no output schema, the description explains the tool's purpose, components, and usage. It does not mention output format or limitations, but for a text assembly tool, it is sufficiently complete.

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 coverage is 100%, and the description merely restates the parameter descriptions from the schema (scope as concept/entity/file path, max_tokens as token budget with default). It adds no new meaning beyond what the schema already provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states that the tool assembles a token-efficient context for a concept, entity, or file, combining multiple aspects. It is clear what it does, but it does not explicitly differentiate from siblings like describe_file or concept_map, which also provide summaries.

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 provides explicit use cases: assembling context for another LLM, when asked to summarize compactly, or building prompts. However, it does not mention when not to use this tool or suggest alternative tools among the listed siblings.

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