Skip to main content
Glama

compact

Reduce code token usage to extend AI context windows by compressing project files. Also supports editing, beautifying, expanding, and validating code.

Instructions

Compact code operations. Actions: compact_file|edit|compact_all|beautify|expand_file|expand_project|validate_pipeline|get_mode|set_mode

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fixNoFor validate_pipeline: auto-fix all style issues — generates .ctx documentation from readable code, then minifies (headers, imports, indentation, long names). Bidirectional: expand restores from .ctx.
codeNoFor edit: new code for the symbol
modeNoFor set_mode: 1 (compact, recommended) or 2 (full)
pathNoPath to file or directory
actionYesCompact action to perform
dryRunNoPreview without modifying
legendNoFor compact_file: include export legend
strictNoFor validate_pipeline: report fns missing from .ctx
symbolNoFor edit: function/class name to replace
beautifyNoBeautify output (default: true)
stripJSDocNoFor set_mode: strip JSDoc when compacting
autoValidateNoFor set_mode: auto-validate after edits
Behavior1/5

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

With no annotations, the description carries the burden of disclosing side effects, reversibility, and safety. It only states 'Compact code operations' and lists action names, without explaining what changes occur to files or code.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very short but insufficiently structured for a tool with 9 actions; it's a bare list of action names without explanation, so it's under-specified rather than appropriately concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex tool with 9 actions and 12 parameters, no output schema, and no annotations, this description is severely incomplete. It omits what each action does, expected outputs, and usage context.

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?

Input schema covers 100% of parameters with descriptions, so the schema does the heavy lifting. The tool description adds no parameter-level meaning beyond the schema.

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

Purpose2/5

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

The description 'Compact code operations' is vague and nearly restates the tool name without explaining what compacting involves. The list of actions provides some scope but doesn't specify a concrete verb-resource pair or distinguish this from sibling tools.

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

Usage Guidelines1/5

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

No guidance on when to use this tool vs alternatives; no context, prerequisites, or exclusions provided.

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/rnd-pro/project-graph-mcp'

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