Skip to main content
Glama
headlessherm-creator

Polymath MegaBlaster MCP

count_tokens

Count tokens in any text using the GPT-3.5/4 tokenizer to check context budget before sending large prompts.

Instructions

Count tokens in text using the GPT-3.5/4 (cl100k_base) tokenizer. Useful for managing context budget before sending a large prompt

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

A3.9/5.0
Behavior2/5

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

With no annotations provided, the description must fully disclose behavioral traits. It mentions the tokenizer, but does not state that the operation is read-only, what the return type is (e.g., an integer count), or any edge cases (e.g., handling of empty strings or invalid input). This leaves the agent guessing about the output format and safety profile.

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?

Two short sentences, front-loaded with the action, followed by a practical use case. No redundant words. It is efficient and easy to parse.

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 simple one-parameter tool, the description is reasonably complete. However, it omits the return value and any side effects (though the action implies no mutation). It also doesn't state limitations (e.g., tokenizer applicability to specific model families). Given the absence of an output schema and annotations, these details would improve completeness.

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 must clarify the parameter. It does: 'text' is the input to count tokens. This adds meaning beyond the bare type definition. The description does not go into format or encoding, but for a single-string parameter, the clarity is adequate.

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 clearly states the action (count tokens in text) and the specific tokenizer (GPT-3.5/4 cl100k_base). It is distinct from sibling tools like calc_subnet or format_json, which serve different purposes. The resource (text) and operation are unambiguous.

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 a concrete use case: managing context budget before sending a large prompt. This tells the agent when to apply it. It doesn't explicitly mention when not to use it or list alternatives, but no sibling tool overlaps with token counting, so the guidance is sufficient.

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