Skip to main content
Glama

Chat completions

chat_completions

OpenAI-compatible LLM chat completion (gpt-oss-120b, gpt-oss-20b, llama-3.3-70b, llama-3.1-8b, qwen3-30b on Cloudflare Workers AI). $0.002 per call over x402 (Base, Solana or X1). Call once without payment for terms, then pass payment.

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

Input Schema

NameRequiredDescriptionDefault
modelNoModel id (default gpt-oss-120b): gpt-oss-120b, gpt-oss-20b, llama-3.3-70b, llama-3.1-8b or qwen3-30b
paymentNosigned x402 payment payload (PAYMENT-SIGNATURE).
messagesYesArray of {role, content} chat messages (or JSON string of messages).
max_tokensNoOptional max completion tokens (up to 1024).
temperatureNoOptional sampling temperature.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does well: it discloses price ($0.002 per call), the x402 payment protocol, the accepted chains (Base, Solana, X1), the two-step terms-then-pay handshake, and the upstream provider. It does not cover streaming, token/rate limits, or failure modes for missing payment, which keeps it below a 5.

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?

Three dense sentences, front-loaded with what the tool is, then price/protocol, then the call sequence. The parenthetical model roster duplicates the `model` parameter description, a small redundancy, but nothing else is wasted.

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 5-parameter inference tool with a fully documented schema and no output schema, the definition covers identity, cost, payment flow, and model options. An agent can call it correctly; only return shape and limits (max_tokens cap, temperature range) are left entirely to the schema, which is acceptable.

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?

Schema coverage is 100%, so baseline is 3; the description goes beyond it by explaining the workflow role of the `payment` parameter (first call returns terms, subsequent calls must include the signed payload). The model list is repeated from the schema, adding little, but the payment semantics genuinely add meaning.

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?

States a concrete verb and resource ('OpenAI-compatible LLM chat completion') and enumerates the exact models and hosting provider. An agent immediately knows this is an LLM inference endpoint, which is unmistakable against the arc_*/address_* blockchain siblings.

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?

Gives an explicit operating procedure: 'Call once without `payment` for terms, then pass `payment`.' That tells the agent how to start a paid session. It stops short of stating when-not-to-use or naming alternatives (e.g. a cheaper/other model endpoint), so it is clear context rather than full when/when-not guidance.

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.