Skip to main content
Glama

Compress a batch of messages

pack_batch
Read-onlyIdempotent

Pack several messages into ONE compressed packet instead of packing them one at a time. REQUIRES A KEY. Worth it for many small/medium messages (the per-message header cost is paid once per batch, and zstd shares context across them) — for a single message this has no advantage. Returns packet_b64 (hand it to unpack_batch to get the messages back) plus the measured byte savings versus packing each message separately. SECURITY: only batch messages that already share the SAME trust boundary (same tenant/agent — nothing attacker-influenced mixed in with a secret). Batched messages share one compression context, which can leak size-based information between them (a CRIME/BREACH-style side channel). There is no padding mitigation on this endpoint today, so trust-boundary separation is the only protection — don't rely on padding.

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": {
      "texts": "<texts>"
    },
    "name": "pack_batch"
  }
}

Input Schema

NameRequiredDescriptionDefault
textsYesThe messages to batch together, in order. Two or more — a single message gets no benefit.
dict_idNoWhich trained dictionary to compress against. Call list_packages to see the options.finance
agent_idNoOptional. A label for audit/metrics.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations cover only read-only/idempotent semantics; the description goes well beyond them with a key requirement, the exact return payload (packet_b64 plus measured savings), and an explicit security model: shared compression context creates a CRIME/BREACH-style size side channel and there is no padding mitigation today.

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

Conciseness4/5

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

Dense and front-loaded: benefit, key requirement, return shape, then security caveat. Minor redundancy in the closing sentences restating that padding is unavailable before repeating that trust-boundary separation is the only protection.

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

Completeness5/5

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

No output schema exists, yet the description names the return field and the savings metric, and the optional audit label and dictionary choice are covered by the schema. Nothing needed to call it safely or correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds real constraint semantics for 'texts' — messages must share the same trust boundary and nothing attacker-influenced may be mixed with a secret — plus the cardinality rule (two or more, no benefit for one).

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?

States a specific verb and resource ('Pack several messages into ONE compressed packet') and immediately contrasts with the per-message alternative. An agent can distinguish this from unpack_batch and the assemble_* siblings without opening the schema.

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

Usage Guidelines5/5

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

Explicit when-to-use ('many small/medium messages', with the reason: one header cost per batch plus shared zstd context) and when-not ('for a single message this has no advantage'). It also names the follow-up tool, unpack_batch, for recovering the messages.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.