Skip to main content
Glama

tokendiet_prune_tool_output

Prune noisy CLI, pytest, tsc, or build logs to a token budget while preserving error and traceback anchors for downstream analysis.

Instructions

Prune noisy CLI, pytest, tsc, or build logs to a token budget using the C++20 Order-Preserving Salience Knapsack while keeping error/traceback anchors.

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": "tokendiet_prune_tool_output"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYes
halo_radiusNo
budget_tokensNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.1/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden. It does disclose two real behavioral traits — output is order-preserving and error/traceback anchors survive pruning — but leaves open whether input text is mutated, what the return shape is, and what happens to content dropped by the budget.

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?

A single front-loaded sentence with no filler; the log-type list earns its place. The algorithm branding ("C++20 Order-Preserving Salience Knapsack") is implementation jargon that consumes attention without helping an agent decide or call.

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

Completeness2/5

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

For a 3-parameter tool with zero schema descriptions, no annotations, and no output schema, the description does too little: halo_radius is entirely unexplained and the return value/pagination behavior is unstated. It covers only the headline purpose.

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

Parameters2/5

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

Schema coverage is 0%, so the description must compensate. It explains the token budget concept but says nothing about `halo_radius` (presumably context lines around anchors) or the `text` input's expected form, leaving a required and a behaviorally significant optional parameter undefined.

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?

States a specific verb ("Prune") plus a concrete resource domain ("noisy CLI, pytest, tsc, or build logs") and the goal (fit a token budget, keep error/traceback anchors). It is clearly distinguishable from skeletonizing code or routing finops, though it never names a sibling to route against.

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?

The input types named imply when the tool applies (verbose logs needing compaction), but there is no explicit when-to-use/when-not guidance, no mention of prerequisites, and no pointer to siblings like tokendiet_compress_session for non-log content. Usage must be inferred.

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