Home / Servers / Developer Toolbox / estimate_tokens

Estimate tokens

An MCP tool from the Developer Toolbox server, hosted on mcp.hjlabs.in.

Estimate how many LLM tokens a piece of text costs, as a range. Explicitly an estimate, not a count — an exact figure needs the target model's tokeniser. Warns when the text is largely non-ASCII, where the estimate is a floor.

Name on the gateway: devtools__estimate_tokens · read-only.

Parameters

NameTypeDescription
text requiredstring

How to call it

Through the Smart Gateway, any client can run it by name with call_tool, or let the gateway find it with search_tools:

call_tool arguments
{
  "name": "devtools__estimate_tokens",
  "arguments": {
    "text": "…"
  }
}

Or connect the Developer Toolbox server directly, which lists 18 tools including this one:

Run in your terminal
claude mcp add --transport http hj-devtools https://mcp.hjlabs.in/mcp/devtools \
  --header "Authorization: Bearer YOUR_API_KEY"

Try asking

Use the estimate tokens tool with text set to ….

More from Developer Toolbox