Skip to main content
Glama

responses_input_tokens

Read-only

OpenAI Responses input token count — OpenAI-compatible POST /v1/responses/input_tokens: send the same body you would send to /v1/responses (model, input as a string or message items with input_text / input_image / input_file parts, instructions, tools, text.format schema) and get {object:'response.input_tokens', input_tokens} plus a breakdown, before paying for a model call. Offline estimate, no model call, no data stored. Price: $0.001 USDC (Base, via x402).

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>",
      "input": "<input>"
    },
    "name": "responses_input_tokens"
  }
}

Input Schema

NameRequiredDescriptionDefault
inputYesTell me a three sentence bedtime story about a unicorn.
modelYesgpt-4.1

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the annotations (readOnlyHint=true, destructiveHint=false, openWorldHint=true), the description discloses that this is an offline estimate with no model call and no stored data, gives the exact response shape, and states a concrete price ($0.001 USDC on Base via x402) — payment/authorization details an agent cannot get from any structured field. Nothing here contradicts the read-only annotations; it reinforces them with specifics.

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?

It is a single front-loaded description with the endpoint and purpose first, then request-body detail, then return shape, then cost and side-effect notes — a sensible ordering. The long parenthetical enumerating body parts is dense but each element carries information; slightly tighter phrasing would improve it.

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 two-parameter tool with no output schema, the description is close to self-sufficient: it explains the request body, the returned fields, the absence of side effects, and the payment requirement. The only gap is that the referenced body fields (instructions, tools, text.format) are not representable in the shown schema, leaving an agent unsure whether it may pass them.

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?

With 100% schema coverage the baseline is 3, and the description earns above that by explaining that `input` accepts either a plain string or message items with input_text / input_image / input_file parts, which is far more useful than the schema's bedtime-story placeholder. However, it also mentions body fields (instructions, tools, text.format schema) that do not appear in the declared two-parameter schema, creating ambiguity about whether extra properties are accepted — a minor semantic mismatch.

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

Purpose5/5

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

The description names a specific verb and resource — counting input tokens for OpenAI Responses requests via POST /v1/responses/input_tokens — and returns a concrete payload shape ({object:'response.input_tokens', input_tokens}). The 'OpenAI Responses' framing plus the explicit endpoint cleanly separates it from the sibling `responses` (a real model call) and `messages_count_tokens` (Anthropic-style messages).

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

Usage Guidelines4/5

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

The phrase 'before paying for a model call' gives a clear use context: pre-flight cost estimation prior to invoking /v1/responses. 'Send the same body you would send to /v1/responses' further instructs the agent on input construction. It stops short of an explicit when-not or a named alternative for non-OpenAI message formats, so it falls one step below the top.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources