Skip to main content
Glama

gemini_count_tokens_tool

Count tokens in any text content for a specified Gemini model. Get accurate token counts to manage limits and costs.

Instructions

Count the number of tokens in content.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNoModel to count tokens for.flash
contentYesThe text content to count tokens for.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior2/5

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

With no annotations, the description must disclose behavioral traits. It only states the core function without mentioning side effects, model-specific tokenization behavior, or any limitations. The read-only nature is implied but not explicit, and no other behavior is conveyed.

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 with zero irrelevant content. It is as concise as possible while still conveying the core purpose.

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?

The tool is simple and an output schema exists, so return values need not be explained. However, the description is minimal and lacks context about model-specific tokenization or usage scenarios, leaving a moderate gap in completeness.

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%, with both 'model' and 'content' documented. The tool description adds no extra meaning beyond the schema, so the baseline of 3 applies.

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 'count' and clearly identifies the resource 'tokens in content'. It uniquely distinguishes this tool from siblings, none of which mention token counting.

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?

No guidance is provided on when to use this tool versus alternatives. The one-sentence description lacks any context about prerequisites, use cases, or why an agent would choose this over other gemini tools.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/crunchtools/mcp-gemini'

If you have feedback or need assistance with the MCP directory API, please join our Discord server