Skip to main content
Glama

Ask a text model

chat_completion

One chat completion on a text model: give the model (a text model id from list_models, modality text, or auto) and the messages; the answer is the model's message and the usage, with the credits charged. The most the request may cost is held first and the rest refunded. max_tokens bounds the answer and the hold: name it. Prices are per model in list_models. Text models are zero data retention except where marked: a model whose data_retention is not none keeps requests as that field says (for example 30 days by the model maker), and auto never picks one.

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>",
      "messages": "<messages>"
    },
    "name": "chat_completion"
  }
}

Input Schema

NameRequiredDescriptionDefault
modelYesA text model id from list_models (modality text), or auto.
messagesYesThe conversation, oldest first: objects with role (system, user, assistant) and content (text).
max_tokensNoThe most tokens the model may write. Default: the model's max_output_tokens.
temperatureNo
reasoning_effortNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Beyond the annotations it discloses genuinely non-obvious behavior: a cost hold is placed up front and the remainder refunded, max_tokens also bounds the hold, and zero data retention applies except for models whose data_retention is set (e.g. 30 days), with auto excluded. It does not cover failure modes, retries, or idempotency implications, which matters given idempotentHint=false and a credit-charging write path.

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?

Dense and mostly front-loaded, opening with the action and then covering cost, retention, and limits; nearly every sentence carries distinct information. A few constructions are convoluted ('a model whose data_retention is not none keeps requests as that field says'), which costs some readability.

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 paid, open-world completion call with no output schema, the description covers input requirements, return payload, billing holds, and data-retention caveats — the highest-risk areas. Gaps are the unexplained sampling parameters (temperature, reasoning_effort) and any error or partial-failure behavior.

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

Parameters3/5

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

Schema coverage is 60%, and the description does add real meaning for the covered ones — model must be a text-modality id or auto, and max_tokens bounds both output and the credit hold. But temperature and reasoning_effort have no description in either the schema or the description, leaving two of five parameters unexplained.

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 and resource — 'One chat completion on a text model' — and spells out the required inputs (model id, messages) plus the return shape ('the model's message and the usage'). It only lightly differentiates from siblings (pointing at list_models for ids and prices) and never contrasts with estimate_run or start_run, so it is clear but not fully sibling-routed.

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?

Usage is implied rather than stated: it tells the caller to 'name' max_tokens and warns that 'auto never picks' a retention-marked model, which is practical guidance for choosing arguments. However, there is no explicit when-to-use or when-not-to-use versus alternatives such as estimate_run or start_run, so the agent must infer the context.

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.