Skip to main content
Glama

Server Details

Cloudflare Workers MCP server: ai-token-counter

Status
Healthy
Last Tested
Transport
Streamable HTTP
URL
Repository
lazymac2x/ai-token-counter-api
GitHub Stars
0

Glama MCP Gateway

Connect through Glama MCP Gateway for full control over tool access and complete visibility into every call.

MCP client
Glama
MCP server

Full call logging

Every tool call is logged with complete inputs and outputs, so you can debug issues and audit what your agents are doing.

Tool access control

Enable or disable individual tools per connector, so you decide what your agents can and cannot do.

Managed credentials

Glama handles OAuth flows, token storage, and automatic rotation, so credentials never expire on your clients.

Usage analytics

See which tools your agents call, how often, and when, so you can understand usage patterns and catch anomalies.

100% free. Your data is private.
Tool DescriptionsA

Average 3.9/5 across 4 of 4 tools scored.

Server CoherenceA
Disambiguation5/5

Each tool has a distinct purpose: counting tokens, estimating cost, getting pricing for a specific model, and listing all models. No overlap.

Naming Consistency5/5

All tool names follow a consistent verb_noun snake_case pattern: count_tokens, estimate_cost, get_model_pricing, list_models.

Tool Count5/5

4 tools is well-scoped for a focused server on token counting and cost estimation. Not too few, not too many.

Completeness5/5

Covers the core domain: token counting, cost estimation, model pricing, and model listing. No obvious missing operations for its stated purpose.

Available Tools

4 tools
count_tokensAInspect

Count tokens for a text string or chat messages array for any supported AI model (GPT-4o, Claude, Gemini, Mistral, Llama).

ParametersJSON Schema
NameRequiredDescriptionDefault
textNoPlain text to count tokens for.
modelNoModel ID, e.g. gpt-4o, claude-sonnet-4. Defaults to gpt-4o.
messagesNoChat messages array in OpenAI/Anthropic format.
Behavior2/5

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

No annotations are provided, so the description must disclose behavioral traits. It only states 'Count tokens' without explaining whether the operation is local/remote, if it has side effects, or any rate limits. The description lacks transparency about potential costs or API dependencies.

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 concise sentence (20 words) that immediately conveys the tool's purpose. No extraneous information, well front-loaded.

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?

Given the tool's simplicity, the description covers the basic purpose and inputs. However, it lacks details on return values (expected token count) and behavioral aspects, which are not compensated by annotations or output schema. Adequate but not complete.

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?

The input schema has 100% description coverage, so the schema already explains parameters adequately. The description adds minor context (lists specific models) but does not significantly enhance understanding beyond the schema. Baseline 3 is appropriate.

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 verb 'Count' and the resource 'tokens', specifies input types (text string or chat messages array), and lists supported models (GPT-4o, Claude, Gemini, Mistral, Llama). This distinguishes it from sibling tools like estimate_cost and list_models.

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 description indicates when to use the tool (to count tokens for text or chat messages) but does not provide explicit guidance on when not to use it or compare it with sibling tools like estimate_cost. No exclusion criteria or alternatives are mentioned.

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

estimate_costAInspect

Estimate the cost of an AI API call given model and token counts or text. Returns input/output/total cost and optional monthly projection.

ParametersJSON Schema
NameRequiredDescriptionDefault
textNoText to tokenize for input (if input_tokens not given).
modelYesModel ID, e.g. gpt-4o, claude-opus-4, gemini-2.0-flash.
input_tokensNoNumber of input tokens.
output_tokensNoNumber of output tokens.
requests_per_dayNoIf given, adds daily/monthly/yearly cost projection.
Behavior4/5

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

With no annotations, the description carries full burden. It discloses that it returns input/output/total cost and optional monthly projection. It hints that it can tokenize text if input_tokens not given (via the text parameter description). No side effects are mentioned, but as a read-only estimate, this is acceptable.

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 two sentences, front-loaded with the primary action and output. Every word adds value; no redundancy or filler. Highly concise.

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?

Given 5 parameters, no output schema, and no annotations, the description covers the input options and output summary well. It lacks explicit details on the return structure (e.g., format of costs) or edge cases (e.g., unsupported models), but for a straightforward estimation tool, it is largely complete.

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 the description adds minimal extra meaning beyond the schema. It groups parameters into token counts or text, but does not elaborate on constraints or usage nuances beyond what the schema already provides.

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 ('estimate'), the resource ('cost of an AI API call'), and the inputs (model, token counts or text). It distinguishes itself from siblings (count_tokens, get_model_pricing, list_models) by focusing on cost estimation rather than tokenization or pricing lookup.

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?

The description implicitly explains when to use this tool (when you need a cost estimate given model and tokens/text) but does not explicitly state when not to use it or name alternatives. The sibling tools provide related but distinct functionality, so the usage context is clear though not exhaustive.

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

get_model_pricingAInspect

Get input/output pricing per 1M tokens for a specific AI model.

ParametersJSON Schema
NameRequiredDescriptionDefault
modelYesModel ID, e.g. gpt-4o, claude-haiku-3, llama-3-70b.
Behavior4/5

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

As a simple read-only operation, the description adequately states what the tool does. No annotations are available, but the description covers the key behavioral aspect of retrieving pricing.

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?

Single sentence efficiently conveys purpose and pricing basis without any wasted words.

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

Completeness5/5

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

Given the tool's simplicity (one required parameter, no output schema), the description fully informs the agent of what to expect: input/output pricing per 1M tokens for a specified model.

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 covers 'model' parameter with example, and description adds 'per 1M tokens' context, providing additional meaning beyond the schema.

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?

Description uses specific verb 'Get' and resource 'input/output pricing per 1M tokens for a specific AI model.' It clearly distinguishes from siblings like count_tokens and list_models.

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?

Description implies usage for obtaining pricing for a specific model but provides no explicit when-to-use or when-not-to-use guidance compared to sibling tools.

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

list_modelsAInspect

List all supported AI models with their pricing and context windows.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Behavior2/5

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

No annotations provided; description does not disclose side effects, auth needs, rate limits, or response format. Only lists purpose without behavioral context.

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?

Single sentence, no redundancy, front-loaded with key action and resource.

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?

No output schema and missing details like return format, ordering, or pagination. For a listing tool with zero annotations, more contextual info is expected.

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?

No parameters exist (100% schema coverage), and description adds value by specifying 'pricing and context windows' beyond the empty schema.

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?

Description uses specific verb 'list' and resource 'all supported AI models', clearly distinguishing from sibling tools like count_tokens or get_model_pricing.

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?

Description implies usage for viewing available models, but no explicit when-not or alternatives mentioned despite siblings existing.

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

Discussions

No comments yet. Be the first to start the discussion!

Try in Browser

Your Connectors

Sign in to create a connector for this server.