Skip to main content
Glama

Ask an AI model

create_chat_completion
DestructiveIdempotent

Generate a reply from an AI model. Use when the app needs generated text. Before: a model id from list_ai_models and enough project balance. Returns the reply message, the tokens used and the amount charged (X-Galon-Charge-USD-Micro). Spends money: billed per token to the project balance at the price shown by get_pricing; the key's spending limit applies. Scope: ai:inference. Cost: paid, reserved on the prepaid balance before the call (released if it fails); prices: get_pricing. Short balance or limit: next_action top_up_balance or raise_app_spend_limit.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "model": "gpt-oss-20b",
      "messages": [
        {
          "role": "user",
          "content": "Summarize this order in one sentence."
        }
      ],
      "max_tokens": 200,
      "idempotency_key": "chat-summary-0001"
    },
    "name": "create_chat_completion"
  }
}

Input Schema

NameRequiredDescriptionDefault
seedNoSame seed and input for a repeatable reply.
stopNoUp to 4 strings that end the reply.
modelYesA model id from list_ai_models.
top_pNoNucleus sampling, 0 to 1. Change this or temperature.
messagesYesThe conversation so far, oldest first (1 to 256 messages).
max_tokensNoMost tokens to generate (1 to 8192).
temperatureNoRandomness, 0 to 2. Lower is more focused.
idempotency_keyYesUnique per request; reuse it on retry to get the same reply without paying twice.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only flag readOnly=false, destructive=true, idempotent=true, openWorld=true; the description goes well beyond by disclosing that this spends money per token, that funds are reserved on the prepaid balance before the call and released on failure, that a key-level spending limit applies, the required scope ai:inference, and the returned charge header. Idempotency behavior is reinforced with the note that retries avoid double payment.

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?

Cost and side effects are front-loaded right after the purpose, and the telegraphic form ('Before:', 'Scope:', 'Cost:') packs a lot of value per word. Some sentences are clipped to the point of being terse and the multiple restatements of pricing/balance in adjacent sentences are slightly redundant.

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

Completeness5/5

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

For a paid, side-effecting mutation tool with no output schema, the description covers prerequisites, cost model, reservation/release semantics, required scope, retry safety, expected return contents, and recovery paths for insufficient funds or limits. An agent has everything needed to call it correctly and to handle failure.

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?

With 100% schema description coverage, the schema already defines every parameter including seed, stop, top_p, temperature, max_tokens and idempotency_key. The description's only parameter-adjacent contribution is pointing at list_ai_models for the model field and get_pricing for per-token price, so baseline 3 is right.

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 opens with a specific verb and resource ('Generate a reply from an AI model') and immediately scopes its domain ('generated text'), which cleanly separates it from sibling tools such as list_ai_models and get_pricing that supply inputs or prices rather than perform inference.

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

Usage Guidelines5/5

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

It states when to use it ('when the app needs generated text') and names concrete prerequisites (a model id from list_ai_models, sufficient project balance) plus explicit alternative routes when preconditions fail (top_up_balance, raise_app_spend_limit). The dependency chain to get_pricing for cost is also spelled out.

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