Skip to main content
Glama

devanvil_llm_tokens

Estimate offline BPE token counts and multi-model API costs for prompts across English, Arabic, CJK, and code, then optionally compact redundant whitespace and comments.

Instructions

Estimate offline BPE tokens & multi-model API costs across English/Arabic/CJK/code, and optionally compact redundant whitespace/comments.

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": {
      "input": "<input>"
    },
    "name": "devanvil_llm_tokens"
  }
}

Input Schema

NameRequiredDescriptionDefault
inputYesPrompt or context text.
compactNoAlso run Smart Context Compactor.
stripLineCommentsNoStrip // and # comments when compacting.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

Without annotations, the description carries the full burden. It discloses 'offline' operation and optional compaction, which are useful behavioral traits, but it omits whether the tool is read-only, what the output contains, and whether compaction alters the input or just the estimate.

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?

The description is a single, front-loaded sentence that states the core function first and adds the optional compaction at the end with zero wasted words.

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 a three-parameter estimation tool with no output schema, the description covers purpose and language scope but leaves the return values unexplained (e.g., token counts, cost breakdowns). It also lacks guidance on when to enable compaction, leaving a moderate gap.

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 all three parameters. The description loosely maps 'compact' and 'stripLineComments' to 'compact redundant whitespace/comments' but adds no detail beyond the schema's own descriptions.

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?

The description uses a specific verb ('Estimate') and resource ('offline BPE tokens & multi-model API costs') with clear scope across languages and code. It also mentions the optional compaction, making the tool's function fully distinct from siblings like log analysis or data conversion.

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

Usage Guidelines2/5

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

There is no explicit when-to-use guidance, no prerequisites, and no comparison to alternatives. The purpose implies its use, but an agent gets no instructions on when this tool is appropriate versus another.

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