ai-token-counter
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.
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.
Tool Definition Quality
Average 3.9/5 across 4 of 4 tools scored.
Each tool has a distinct purpose: counting tokens, estimating cost, getting pricing for a specific model, and listing all models. No overlap.
All tool names follow a consistent verb_noun snake_case pattern: count_tokens, estimate_cost, get_model_pricing, list_models.
4 tools is well-scoped for a focused server on token counting and cost estimation. Not too few, not too many.
Covers the core domain: token counting, cost estimation, model pricing, and model listing. No obvious missing operations for its stated purpose.
Available Tools
4 toolscount_tokensAInspect
Count tokens for a text string or chat messages array for any supported AI model (GPT-4o, Claude, Gemini, Mistral, Llama).
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | Plain text to count tokens for. | |
| model | No | Model ID, e.g. gpt-4o, claude-sonnet-4. Defaults to gpt-4o. | |
| messages | No | Chat messages array in OpenAI/Anthropic format. |
Tool Definition Quality
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.
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.
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.
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.
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.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | Text to tokenize for input (if input_tokens not given). | |
| model | Yes | Model ID, e.g. gpt-4o, claude-opus-4, gemini-2.0-flash. | |
| input_tokens | No | Number of input tokens. | |
| output_tokens | No | Number of output tokens. | |
| requests_per_day | No | If given, adds daily/monthly/yearly cost projection. |
Tool Definition Quality
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.
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.
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.
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.
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.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | Model ID, e.g. gpt-4o, claude-haiku-3, llama-3-70b. |
Tool Definition Quality
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.
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.
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.
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.
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.
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.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Tool Definition Quality
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.
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.
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.
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.
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.
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.
Claim this connector by publishing a /.well-known/glama.json file on your server's domain with the following structure:
{
"$schema": "https://glama.ai/mcp/schemas/connector.json",
"maintainers": [{ "email": "your-email@example.com" }]
}The email address must match the email associated with your Glama account. Once published, Glama will automatically detect and verify the file within a few minutes.
Control your server's listing on Glama, including description and metadata
Access analytics and receive server usage reports
Get monitoring and health status updates for your server
Feature your server to boost visibility and reach more users
For users:
Full audit trail – every tool call is logged with inputs and outputs for compliance and debugging
Granular tool control – enable or disable individual tools per connector to limit what your AI agents can do
Centralized credential management – store and rotate API keys and OAuth tokens in one place
Change alerts – get notified when a connector changes its schema, adds or removes tools, or updates tool definitions, so nothing breaks silently
For server owners:
Proven adoption – public usage metrics on your listing show real-world traction and build trust with prospective users
Tool-level analytics – see which tools are being used most, helping you prioritize development and documentation
Direct user feedback – users can report issues and suggest improvements through the listing, giving you a channel you would not have otherwise
The connector status is unhealthy when Glama is unable to successfully connect to the server. This can happen for several reasons:
The server is experiencing an outage
The URL of the server is wrong
Credentials required to access the server are missing or invalid
If you are the owner of this MCP connector and would like to make modifications to the listing, including providing test credentials for accessing the server, please contact support@glama.ai.
Discussions
No comments yet. Be the first to start the discussion!