MCP Tool Token Counter

Every tool you expose through an MCP server is sent to the model as part of the context on <em>every</em> request — its name, description, and full input schema — before the user has typed a word. With a handful of servers connected, those definitions can quietly consume a large share of the context window and degrade the model's ability to pick the right tool. Paste your tool definitions here to see exactly how many tokens each one costs and what percentage of the window they take. It runs entirely in your browser.

0
Total tokens
0
Tools
% of context
0
Avg / tool

    How to Use This Tool

    1. Pick your model's context window — so the tool can show the tool definitions as a percentage of the space you actually have.
    2. Paste your tool definitions — a tools array, a tools/list JSON-RPC result, or a single tool object. Click "Load sample" to see the expected shape.
    3. Read the breakdown — the total token cost, the share of your context window, and a per-tool bar chart sorted heaviest-first so you can see which definitions to trim.
    4. Trim and re-check — shorten the heaviest descriptions or drop redundant tools, paste again, and watch the percentage fall.

    The MCP Context-Budget Problem

    The Model Context Protocol made it easy to give an AI agent dozens of tools by connecting a few servers. The hidden cost is that every one of those tool definitions — name, description, and full JSON input schema — is loaded into the model's context window and sent on every single request, before the user asks anything. A few connected servers can consume a large fraction of even a generous context window purely on tool definitions, leaving less room for the actual conversation and documents, and inflating the cost of every call.

    Token cost is only half the problem. As the number of available tools grows, the model gets worse at choosing the right one — selection accuracy degrades noticeably with larger tool sets, which is why a focused set of well-described tools usually outperforms a sprawling one. Measuring the token weight of your definitions is the first step to controlling both: it tells you which tools dominate your budget and which descriptions are doing more harm than good.

    The ecosystem responded in late 2025 with structural mitigations — loading tool schemas on demand instead of all upfront, and letting the model invoke tools through generated code rather than one definition-heavy call at a time — both of which sharply cut the upfront token cost. But the cheapest win is still editorial: trim the heaviest descriptions and remove the tools you do not need. This counter shows you where that weight is.

    Frequently Asked Questions

    Why do MCP tool definitions cost tokens?
    When an MCP client connects to a server, it fetches the list of tools and includes each tool's name, description, and inputSchema in the model's context so the model knows what it can call. That context is sent on every request, so the tool definitions are a fixed cost paid before any conversation happens. A single richly-described tool can run from a couple hundred to well over a thousand tokens, and the cost scales with every tool and every connected server.
    How many MCP tools is too many?
    There is no hard limit, but two things degrade as the set grows. First, the fixed token cost climbs — connecting several popular servers can consume a large fraction of even a 200K-token window before the first query. Second, and more importantly, tool-selection accuracy falls: research in 2026 found that model accuracy at choosing the right tool drops sharply as the number of available tools increases, and practical agent setups start to struggle past roughly a few dozen tools. Fewer, well-described tools usually beat many overlapping ones.
    How do I reduce MCP tool token usage?
    Tighten descriptions to the essential 'what it does and when to call it,' remove redundant or overlapping tools, and prune verbose input schemas (long enums, deep nesting, repeated boilerplate). Beyond editing, the ecosystem added structural fixes in late 2025: loading tool definitions on demand instead of all upfront (tool search), and having the model call tools through generated code rather than individual tool calls — both cut the upfront token cost dramatically. This tool helps you find the heaviest definitions to trim first.
    Which tokenizer does this use?
    It uses OpenAI's o200k_base tiktoken encoding via the open-source gpt-tokenizer library, which gives exact counts for GPT-4o, GPT-4.1, GPT-5 and the o-series. Claude, Gemini, and other models use different tokenizers, so for those the numbers are a close estimate — typically within about 10–20% — which is more than accurate enough for budgeting how much of your context window the tools consume.
    Is my data uploaded anywhere?
    No. Parsing and tokenizing happen entirely in your browser — your tool definitions are never sent to Janeer or any server. Tool schemas often describe internal systems and unreleased capabilities, so keeping the analysis client-side means none of that leaves your machine.