Skip to main content
Glama
topaisaas-dev

Universal Native MCP Server Hub

topai_token_slimmer

Read-onlyIdempotent

Compress HTML, JSON, or plain-text payloads losslessly to cut LLM input tokens by 30% to 70% without losing meaning before sending large API responses, logs, or RAG chunks into a context window.

Instructions

Compresses bloated HTML, JSON, or plain-text payloads losslessly to reduce LLM input token consumption by 30% to 70% without losing semantic meaning. Use before sending large JSON API responses, logs, or RAG chunks into an LLM context window. Do not use for converting a live URL directly into Markdown (use topai_web_to_markdown instead) or for caching full prompt completions (use topai_semantic_cache instead). Stateless, read-only, idempotent compression.

Input Schema

NameRequiredDescriptionDefault
formatNoPayload syntax format: 'html', 'json', or 'text' (default: 'text').
contentYesRaw HTML, JSON, or text payload string to compress for LLM context optimization.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.2

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already cover readOnlyHint, idempotentHint and destructiveHint=false, yet the description adds genuinely new behavioral context: that compression is lossless and preserves semantic meaning, and that the tool is stateless. The trailing 'read-only, idempotent' phrasing largely restates the annotations, so it is not fully additive, but the lossless/stateless claim is real disclosure.

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?

Three tightly packed sentences in a clear order: what it does and why, when to use it, when not to. No filler, no restating of the title, and the highest-value information (lossless 30-70% reduction) is front-loaded.

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 two-parameter tool with no output schema and full annotation coverage, the definition covers purpose, usage, exclusions and safety properties well. The one mild gap is the return shape — it never states that the output is the compressed payload string (or how the reduction is reported), which an agent must infer.

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%, with both parameters documented including the format enum and its default. The description adds no syntax, size limits, or format-specific handling beyond what the schema already states (HTML/JSON/text is essentially the enum), so the baseline 3 applies.

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 (compresses) and resource (bloated HTML, JSON, or plain-text payloads), quantifies the benefit (30%-70% token reduction), and asserts the key property (lossless, semantics-preserving). It explicitly differentiates itself from topai_web_to_markdown and topai_semantic_cache, so an agent can distinguish it from 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?

Gives an explicit when-to-use trigger ('before sending large JSON API responses, logs, or RAG chunks into an LLM context window') and two explicit when-not-to-use cases that name the correct alternative sibling for each. This is exactly the routing guidance an agent needs.

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