Skip to main content
Glama

spl_agentic_context

Read-onlyIdempotent

Shrink LLM context extractively before a run: BM25-lite filtering, cross-encoder reranking, and dedup, verified by construction, with a quote on input bytes. Read-only computation; the text is not stored. Use to fit a long context into a run's budget; use spl_agentic_plan to shape the run itself.

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": {
      "text": "<text>"
    },
    "name": "spl_agentic_context"
  }
}

Input Schema

NameRequiredDescriptionDefault
skuNoSKU to quote the context work against.
textYesFull text to compress. Required.
queryNoQuery the kept context must answer; guides the reranker. Omit to keep the most central passages.
rerankerNoReranker tier: MiniLM-L-6-v2 by default, bge-reranker-v2-gemma as the opt-in quality tier.
maxTokensNoMaximum tokens per chunk and in the compressed output.
rerankTopKNoHow many top BM25 candidates the reranker rescores. Omit to rescore every candidate.
used_bytesNoBytes already consumed, counted toward the quote.
targetRatioNoTarget compression ratio between 0.01 and 1, e.g. 0.25 keeps roughly a quarter of the input. Omit for the default.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changed
    • addedInput schema / properties / maxTokens / description
      Added value: +"Maximum tokens per chunk and in the compressed output."
    • addedInput schema / properties / query / description
      Added value: +"Query the kept context must answer; guides the reranker. Omit to keep the most central passages."
    • addedInput schema / properties / rerankTopK / description
      Added value: +"How many top BM25 candidates the reranker rescores. Omit to rescore every candidate."
    • addedInput schema / properties / reranker / description
      Added value: +"Reranker tier: MiniLM-L-6-v2 by default, bge-reranker-v2-gemma as the opt-in quality tier."
    • addedInput schema / properties / sku / description
      Added value: +"SKU to quote the context work against."
    • addedInput schema / properties / targetRatio / description
      Added value: +"Target compression ratio between 0.01 and 1, e.g. 0.25 keeps roughly a quarter of the input. Omit for the default."
    • addedInput schema / properties / text / description
      Added value: +"Full text to compress. Required."
    • addedInput schema / properties / used_bytes / description
      Added value: +"Bytes already consumed, counted toward the quote."
  2. Changed2 schema fields changed
    • addedInput schema / properties / rerankTopK
      Added value: +{
      +  "type": "number"
      +}
    • addedInput schema / properties / reranker
      Added value: +{
      +  "type": "string"
      +}
  3. Added

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already establish readOnly, idempotent, and non-destructive, and the description reinforces this with 'the text is not stored' — a genuine data-handling disclosure beyond the hints. It also introduces the quote/billing mechanic ('with a quote on input bytes'), which the annotations do not cover. It does not describe the shape of the compressed output or what 'verified by construction' actually guarantees.

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?

Two tight sentences, front-loaded with the action and followed by the routing guidance; nothing is padded. The density of jargon ('verified by construction', 'BM25-lite') costs a little readability but each clause carries information.

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

Completeness3/5

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

For an 8-parameter tool with no output schema, the description says nothing about what comes back (compressed text plus metrics? quote only?) or how maxTokens and targetRatio interact. The safety and storage story is complete, but the return-side and parameter-interaction story is not.

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 every parameter including sku, used_bytes, and targetRatio is already documented, making 3 the baseline. The description adds only the connective idea that sku/used_bytes feed the quote, without clarifying units, defaults, or interaction between maxTokens and targetRatio.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource ('Shrink LLM context extractively before a run') and enumerates the pipeline stages (BM25-lite filtering, cross-encoder reranking, dedup). It differentiates from spl_agentic_plan, though it never distinguishes itself from the closer sibling spl_compress, which also compresses text.

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?

It gives an explicit trigger ('Use to fit a long context into a run's budget') and routes the agent away from spl_agentic_plan for shaping the run itself. It lacks any when-not guidance relative to spl_compress/spl_zip, which is the most likely mis-selection an agent could make here.

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.

Resources