Skip to main content
Glama

MCP Server Gemini

by gurr-i

count_tokens

Calculate token counts for text using specified Gemini AI models to manage input length and optimize API usage.

Instructions

Count tokens for a given text with a specific model

Input Schema

NameRequiredDescriptionDefault
modelNoModel to use for token countinggemini-2.5-flash
textYesText to count tokens for

Input Schema (JSON Schema)

{ "properties": { "model": { "default": "gemini-2.5-flash", "description": "Model to use for token counting", "enum": [ "gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite", "gemini-2.0-flash", "gemini-2.0-flash-lite", "gemini-2.0-pro-experimental", "gemini-1.5-pro", "gemini-1.5-flash" ], "type": "string" }, "text": { "description": "Text to count tokens for", "type": "string" } }, "required": [ "text" ], "type": "object" }

Other Tools from MCP Server Gemini

Related Tools

    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/gurr-i/mcp-server-gemini-pro'

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