Skip to main content
Glama

fit_context

Read-onlyIdempotent

Shrink long text, logs, or tool output to a token budget while preserving parts relevant to a query in original order; text that already fits is unchanged.

Instructions

Shrink a long text (a document, log or tool output) to a token budget, keeping the parts that answer the query, in their original order. Text that already fits comes back unchanged.

    Args:
        text: The text to shrink.
        budget: Most tokens to return.
        query: Optional question; the parts that answer it are kept first.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes
queryNo
budgetNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent and non-open-world, so the safety profile is covered. The description adds genuine behavior beyond that: output preserves original ordering, query-relevant spans are prioritized, and short input is returned verbatim rather than truncated. It stops short of saying what happens when the budget is too small to hold even the highest-priority content.

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?

The behavioral sentence is front-loaded and the Args block is tight, with no filler. The Args block restates the schema property names, but each line adds semantic meaning (optionality, prioritization) rather than padding.

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?

With an output schema present, return-shape explanation is unnecessary, and the annotations cover the read-only/idempotent profile. The remaining gap is the query-less selection strategy: since query is optional, an agent cannot tell from the description which content survives when no question is supplied.

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

Parameters4/5

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

Schema description coverage is 0%, so the description carries the full burden and largely delivers: text is "the text to shrink", budget is "most tokens to return", and query is explicitly optional with a stated effect ("the parts that answer it are kept first"). The budget default of 2000 is left to the schema, and no unit/counting caveats are given.

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 gives a concrete verb and resource ("shrink a long text ... to a token budget") plus the selection rule (keep query-answering parts, preserve order), which is far more specific than the tool name alone. It never names or contrasts with the sibling memory tools (remember/recall/list_memories/forget), so an agent gets no explicit routing help even though the purpose is distinct.

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

Usage Guidelines3/5

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

Usage context is implied well enough — long documents, logs, or tool output that exceed a budget — and the no-op case ("text that already fits comes back unchanged") is stated. However there is no explicit when-not guidance, no named alternative, and no hint about how this relates to the memory siblings, so the agent must infer routing.

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

Deploy Server

Other Tools