Skip to main content
Glama

smart_context_gate

Read-only

Purpose: Compress long prompts/context (LLMLingua) before the host LLM call. When to use: Context is too large for the model budget and text is already available. When NOT to use: Short messages or already small context. Optional purpose: Pass a short goal (step intent, user query) to pre-filter paragraphs by relevance before compression — e.g. "API rate limits", "pricing tables". Returns: JSON string with compressed text and ratio metadata. Composes with: downstream host LLM; often follows smart_fetch or smart_search.

Input Schema

NameRequiredDescriptionDefault
textYesLong text to compress before the host LLM call.
ratioNoTarget compression ratio (e.g. 0.3–0.7).
purposeNoOptional goal to pre-filter paragraphs (step intent, user query).

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=true, so the description does real work: it discloses that the optional purpose parameter pre-filters paragraphs by relevance before compression, and that the output is a JSON string with compressed text and ratio metadata. It omits edge-case behavior such as what happens on very short text or failed compression, but for a read-only compression utility the coverage is good.

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?

Uses labeled sections that front-load purpose and usage, and every sentence adds actionable information. Nothing is padded or redundant enough to distract from the key routing signals.

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?

For a three-parameter, read-only compression tool with an output schema, the description covers purpose, usage boundaries, parameter intent, return shape, and composition with downstream/sibling tools. An agent has everything needed to invoke it correctly.

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 coverage is 100%, so the schema already documents text, ratio, and purpose. The description largely restates those semantics, with only the concrete purpose examples ('API rate limits', 'pricing tables') adding marginal value beyond the schema. Baseline 3 is appropriate when the schema carries the load.

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 ('Compress long prompts/context') and even names the underlying technique (LLMLingua) plus the timing relative to the host LLM call. An agent can distinguish this from siblings like smart_fetch or smart_search because the description clarifies it operates on already-available text.

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?

Provides explicit 'When to use' (context too large, text already available) and 'When NOT to use' (short messages, small context) sections, plus a composing relationship with smart_fetch/smart_search. No inference is required to decide whether this tool is the right choice.

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.