Skip to main content
Glama
deepseek-mcp-server

deepseek-mcp-server

Estimate DeepSeek token count

deepseek_count_tokens

Estimate token counts from text with DeepSeek's published English and CJK character ratios for prompt budgeting; this is an approximation, not an exact tokenizer.

Instructions

Estimate the token count of some text using DeepSeek's published ratios (about 0.3 tokens per English character, 0.6 per CJK character). An estimate for budgeting, not an exact tokenizer.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "text": "<text>"
    },
    "name": "deepseek_count_tokens"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesText to measure.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations supplied, the description carries the behavioral burden and does so reasonably: it discloses the exact ratio model (0.3 tokens/English char, 0.6 tokens/CJK char) and bluntly labels the result approximate. It omits whether the call hits the API, consumes quota, or how the estimate is returned, which are the remaining behavioral unknowns.

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?

Two sentences, no filler: the core action comes first and the caveat follows. Every clause, including the numeric ratios, earns its place by conveying either purpose or precision limits.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a one-parameter, annotation-free, no-output-schema tool, the description covers purpose, method, and the accuracy caveat adequately. It could state what the estimate looks like (a single count vs per-category breakdown) and whether spaces or punctuation are counted, but nothing essential is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There is a single parameter with 100% schema description coverage, so the schema already defines 'text'. The description still adds value by explaining that the character-type ratios are what the input is measured against, implying mixed-language text is handled per-character rather than uniformly.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb and resource ('Estimate the token count of some text') plus the method ('DeepSeek's published ratios'), so the tool's job is unmistakable. It does not name any sibling for contrast, but no sibling in the list plausibly competes with a local token estimator, so the differentiation gap is minor.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

'An estimate for budgeting, not an exact tokenizer' tells the agent the intended use case and its main limitation. However, there is no explicit when-to-use/when-not-to-use routing versus alternatives and no mention of whether it costs API quota or requires auth, leaving usage inference to the agent.

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