Skip to main content
Glama

ninerouter_count_tokens

Read-onlyIdempotent

Count tokens for an Anthropic Messages request through 9Router to estimate prompt size before sending. Use it to check token limits and plan API usage.

Instructions

Count tokens for an Anthropic Messages request using 9Router.

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": {
      "model": "<model>",
      "request": "<request>"
    },
    "name": "ninerouter_count_tokens"
  }
}

Input Schema

NameRequiredDescriptionDefault
modelYes
requestYesAnthropic token-count fields, including messages.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.7/5.0
Behavior2/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false, and openWorldHint, so the safety profile is fully covered. The description adds only the 'Anthropic Messages request' format constraint and says nothing about return shape, cost, rate limits, or error behavior beyond what structured fields provide.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence with zero filler and no redundancy. It is well-structured for its length, though the brevity contributes to the specification gaps noted elsewhere.

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

Completeness2/5

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

For a two-parameter tool with an opaque nested 'request' object and no output schema, the description should say more about the required request structure and what the tool returns. Annotations cover safety, but an agent still lacks enough context to confidently construct a call without inspecting external Anthropic Messages documentation.

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

Parameters2/5

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

Schema coverage is only 50%, with the 'model' parameter having no description anywhere. The description clarifies that the request body follows Anthropic Messages format, which gives some shape to the opaque 'request' object, but it never mentions the required 'model' argument or what values are valid.

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?

States a specific verb ('Count') and resource ('tokens') plus the request format ('Anthropic Messages request via 9Router'), so the agent knows exactly what operation is performed. It does not explicitly distinguish itself from siblings like ninerouter_chat, but the name and the token-counting scope make its role unambiguous.

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?

There is no guidance on when to call this tool versus alternatives, no prerequisites, and no exclusions. The sentence is a pure capability statement; an agent must infer all usage context from the name alone.

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