Skip to main content
Glama
libragik

universal-ai-agent-bridge

by libragik

llm_compress_prompt

Reduce token usage by compressing prompts, code, logs, or stack traces with RTK Smart Compression, removing redundant whitespace and duplicate lines while preserving code semantics and returning token savings metrics.

Instructions

Compress any prompt, code block, log output, or stack trace using RTK Smart Compression to strip redundant whitespace, duplicate lines, and deep library frames while maintaining code semantics. Returns token savings metrics.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesThe text or code to compress.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations provided, the description carries the full behavioral burden and mostly fulfills it: it discloses the exact transformations (strip redundant whitespace, duplicate lines, deep library frames), the semantic preservation guarantee, and that token savings metrics are returned. The precise return payload — whether the compressed text accompanies the metrics — is left implicit, a moderate gap given there is no output schema.

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?

Two sentences with zero filler: the purpose and transformation details are front-loaded, and the return-value hint earns its place as a deliberate second sentence. Technical specificity ('deep library frames', 'token savings metrics') is included without bloat.

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?

For a one-parameter, pure-transformation tool with no output schema and no annotations, the description covers what it processes, how it transforms the input, and what it returns. The only notable gap is the unspecified return format, which is mitigated by the tool's simplicity.

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 description coverage is 100%, so the baseline is 3, but the description adds meaning beyond the schema: it specifies acceptable input forms (prompts, code, logs, stack traces) and the compression strategy, which the schema's bare 'The text or code to compress' does not convey.

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 states a specific verb and resource ('Compress any prompt, code block, log output, or stack trace') and names the mechanism (RTK Smart Compression). None of the 12 sibling tools (llm_generate_image, llm_query, llm_cache, etc.) perform compression, so an agent can immediately distinguish it.

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 enumerates the applicable input types (prompt, code block, log output, stack trace), providing clear context for when to invoke it. It does not name an alternative or state when-not-to-use conditions, but no sibling tool competes for this task, so the context is sufficient.

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