Skip to main content
Glama

Gate Compress File

gate_compress_file

Compress code, YAML, and Markdown files into AST signatures or structural summaries to reduce token usage before sending content to an LLM.

Instructions

AST/structure file compression. Code: signature. YAML/MD: auto structure. See gate_help recommended_stack.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "filePath": "<filePath>"
    },
    "name": "gate_compress_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
depthNosignature (AST, default), structure (YAML/MD keys), summary (code only), full (raw)signature
filePathYesAbsolute or relative path to the code file
projectRootNoOptional project root (narrows GATE_PROJECT_ROOT; cannot widen). Use for multi-repo workspaces.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.12

TDQS

C2.7/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full disclosure burden and largely drops it. It does not say whether the operation is read-only or writes to disk, how large files are handled, or what the caller receives back. With zero annotation coverage, these omissions are material for a file-touching tool.

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

Conciseness3/5

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

It is short and front-loads the core idea, with no filler sentences. However, the sentence-fragment style sacrifices clarity for brevity, and the cross-reference occupies space that could have been spent defining the compression behavior itself.

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

Completeness2/5

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

There is no output schema, so the description is the only place a caller could learn what the compressed result looks like — and it says nothing about the return shape or token-reduction guarantees. For a transformation tool whose entire value is the output form, that is a significant completeness gap.

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 depth enum and path parameters are already fully documented, establishing a baseline of 3. The description does add one piece of meaning beyond the schema by tying file type to mode selection (code files favor signature, YAML/MD resolve to structure), which is genuinely useful context not present in the field descriptions.

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

Purpose3/5

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

Names the resource (file) and the action (compression), qualified as AST/structure based, so the general intent is inferable. But "compression" is never defined in terms of observable behavior — an agent cannot tell whether this reads a file and returns a reduced representation, or writes something out. The telegraphic fragments ("Code: signature. YAML/MD: auto structure.") only partially resolve this.

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

Usage Guidelines3/5

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

Implies the tool is for shrinking source and markup files, and routes the agent to gate_help's recommended_stack for broader guidance, which is a useful pointer. It never states when not to use it, nor contrasts it with siblings such as gate_graph_query that might also answer questions about code.

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