Skip to main content
Glama

sarup_compress

Compress Thai, English, JSON, or log content to reduce token usage while preserving full recoverability. Returns compressed text with retrieval hash and token-saving metrics.

Instructions

Compress content for context efficiency. Supports Thai prose, English prose, mixed Thai+code, JSON, and logs. Returns compressed text, a retrieval hash, and token-saving metrics. Use sarup_retrieve(hash=...) to recover the original when needed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoProse strategy. 'extractive' (default): offline TF-IDF, verbatim subset, ~1ms. 'semantic': embedding centrality, best ratio (needs Ollama). 'abstractive': local-LLM rewrite (needs Ollama, slow). 'pipeline': cascade semantic -> abstractive for maximum savings. 'auto': semantic if Ollama is up, else extractive. All modes stay 100% recoverable via sarup_retrieve.extractive
queryNoOptional context query. Sentences relevant to this query are scored higher and more likely to be kept.
contentYesContent to compress
losslessNoOnly apply lossless transforms (whitespace/JSON compact). Default false.
target_ratioNoFraction of prose to keep (0.3–0.7). Default 0.5.
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses the return values and the recoverability of the original through sarup_retrieve. It does not mention side effects or performance, but the schema covers behavioral details for the modes. The description provides sufficient transparency for safe usage.

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 highly concise: two sentences that front-load the primary verb and resource, list supported types, mention return values, and reference the sibling tool. Every sentence serves a clear purpose without redundancy.

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 absence of an output schema, the description correctly mentions the return values (compressed text, retrieval hash, metrics). The input schema is comprehensive, so the description does not need to repeat parameter details. However, it could briefly note that mode selection is covered by the schema. Overall, it is mostly complete for an agent to understand the tool's role and output.

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 baseline is 3. The description adds general context (supported content types, recoverability) but does not elaborate on specific parameters like 'mode' or 'target_ratio'. Since the schema already thoroughly describes each parameter, the description adds minimal extra value beyond stating the overall purpose.

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: 'Compress content for context efficiency.' It specifies supported content types (Thai prose, English prose, mixed Thai+code, JSON, logs) and mentions the return values (compressed text, retrieval hash, token-saving metrics). It also distinguishes itself from its sibling by referencing sarup_retrieve for recovery.

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 indicates when to use the tool (compression for context efficiency) and how to recover the original using sarup_retrieve. However, it does not explicitly state when not to use it or provide alternative tools beyond recovery. Given the context of siblings (sarup_retrieve, sarup_stats), the usage context is clear but lacks exclusions.

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/PHUICMT/sarup'

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