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.7/5 across 4 of 4 tools scored.
Each tool has a distinct purpose: counting tokens, estimating cost, retrieving pricing, and listing models. No overlap in functionality.
All tool names follow a consistent verb_noun pattern: count_tokens, estimate_cost, get_model_pricing, list_models. Clear and predictable.
Four tools are well-scoped for a token counting and cost estimation server, covering the core needs without bloat.
The surface supports counting, cost estimation, pricing lookup, and model discovery. A minor gap is lack of batch token counting across multiple files, but core workflows are covered.
Available Tools
4 toolscount_tokensBInspect
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 carry behavioral transparency. It does not disclose the return format (total count vs per-message), tokenization methodology, or any limitations. The output is unspecified, which is a significant gap.
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, front-loaded sentence that conveys the core purpose without wasted words. It is directly readable and easy to parse.
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 three optional parameters, no output schema, and no annotations, the description is insufficiently complete. It omits return value details, edge cases, and relationship to sibling tools, leaving the agent to infer important behavior.
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 baseline is 3. The description only echoes what the schema already states about text and messages without adding semantic detail about model defaults or input format nuances.
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 tool counts tokens for text or chat messages, and lists specific supported models. This distinguishes it from siblings like estimate_cost and list_models, which focus on cost and model enumeration.
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 implies use when token counting is needed but gives no explicit guidance on when to prefer this over estimate_cost or get_model_pricing, nor any exclusions. The context is clear, but alternatives are not addressed.
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 must carry the full burden. It discloses the core behavior: calculates cost from inputs and returns a breakdown. However, it does not explicitly state that this is a read-only, non-mutating operation, nor does it mention whether it uses live pricing or has edge cases (e.g., both text and input_tokens provided). The term 'Estimate' implies a calculation, but not full transparency.
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 sentence that front-loads the purpose, conveys the inputs and outputs, and mentions the optional projection. No wasted words; every clause contributes.
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?
The description covers the main inputs and outputs, and the schema covers all parameters. However, there is a minor inconsistency: the description says 'optional monthly projection' while the parameter requests_per_day also mentions daily and yearly projections. Still, the tool is simple and the description is largely complete for an estimation tool.
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 coverage is 100% and each parameter has a description. The tool description adds little beyond the schema, though it clarifies the 'or' relationship between text and input_tokens by saying 'token counts or text.' This is useful but not a substantial addition over the schema's own explanation.
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 uses a specific verb ('Estimate') with a clear resource ('cost of an AI API call') and specifies the inputs (model and token counts or text) and outputs (input/output/total cost, optional monthly projection). It clearly distinguishes from sibling tools like count_tokens (token counting) and get_model_pricing (pricing data).
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 implies usage: when you need to estimate cost and have model and token counts or text, use this tool. However, it does not explicitly state when not to use it or mention alternatives (e.g., count_tokens for tokenization, get_model_pricing for raw price lookup). The guidance is implicit rather than explicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_model_pricingBInspect
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?
With no annotations, the description must carry the full burden. It states what the tool does but does not disclose behavioral traits such as whether authentication is required, how errors are handled (e.g., unknown model), or any rate limits. The description adds little beyond the name and schema.
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, focused sentence that conveys the essential information without redundancy. It is front-loaded and appropriately sized for the tool's simplicity.
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?
The description adequately explains what the tool returns (input/output pricing per 1M tokens) but lacks context about how this differs from sibling tools, such as estimate_cost. Given the absence of an output schema, a bit more detail about the response structure or usage scenarios would improve completeness, though the tool is straightforward.
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%, and the parameter 'model' has a clear description with examples. The tool description adds no additional meaning beyond the schema, making it redundant. Since the schema already documents the parameter well, the baseline of 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 ('Get') and resource ('pricing per 1M tokens for a specific AI model'), specifying input/output pricing. This distinguishes it from siblings like count_tokens and estimate_cost, which focus on token counting or cost estimation rather than rate 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?
No guidance is provided on when to use this tool versus alternatives. For example, it does not clarify that estimate_cost is for computing cost based on usage while this tool returns the underlying rate card. The description implies usage only through its purpose statement, but no explicit context or exclusions are given.
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?
With no annotations provided, the description carries the full burden. It discloses the scope ('all supported') and the data returned (pricing, context windows). The verb 'List' implies a read-only operation, and no hidden side effects or external behaviors are suggested, providing adequate transparency for a simple listing tool.
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 that front-loads the main action ('List') and the object ('all supported AI models'), followed by relevant details. There is no filler or redundant information.
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?
For a tool with no parameters and no output schema, the description fully specifies its purpose and what it returns. It mentions the key attributes (pricing and context windows) and is sufficiently complete for its simple scope.
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 tool has zero parameters, so the schema provides no additional constraints. The description adds no parameter info because there are none. According to the rubric, a 0-parameter tool gets a baseline score of 4, which is appropriate here.
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 tool's function with a specific verb ('List'), a clear resource ('all supported AI models'), and includes the specific attributes returned (pricing and context windows). This distinguishes it from sibling tools like count_tokens and estimate_cost, which perform different operations.
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 implies the tool is used when you need an overview of available models with their pricing and context windows. However, it lacks explicit guidance on when to prefer this over get_model_pricing or any exclusions, so the usage context is only implied, not fully defined.
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!
Related MCP Servers
- Flicense-qualityBmaintenanceA remote MCP server deployed on Cloudflare Workers without authentication, allowing users to create custom tools and connect to MCP clients like Cloudflare AI Playground and Claude Desktop.
- Flicense-qualityCmaintenanceA remote MCP server deployed on Cloudflare Workers without authentication, enabling connection to Cloudflare AI Playground or local MCP clients.
- Flicense-qualityCmaintenanceMCP server on Cloudflare Workers with OAuth login, enabling remote tool calls like math operations from MCP clients.
- Flicense-qualityCmaintenanceDeployable MCP server on Cloudflare Workers without authentication, enabling AI agents to use custom tools via SSE endpoint. Supports connection to Cloudflare AI Playground and local clients like Claude Desktop.