Skip to main content
Glama

chat_completions

OpenAI-compatible chat completions, flat $0.002 a call: the same request and response as OpenAI's /v1/chat/completions (messages, model, max_tokens, temperature, response_format json_object, stream), so an OpenAI SDK works by changing the base URL. Models: llama-4-scout (default), gpt-oss-20b, gemma-4-26b, glm-4.7-flash. Up to 10,000 characters in, 1,024 tokens out. Costs $0.002 USDC on 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": {
      "messages": "<messages>"
    },
    "name": "chat_completions"
  }
}

Input Schema

NameRequiredDescriptionDefault
modelNoModel (default llama-4-scout; other names run on the default)
streamNotrue answers as Server-Sent Events chunks
messagesYesOpenAI-style messages
max_tokensNoMost tokens to generate (above 1,024 is capped)
temperatureNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / max_tokens / type
      Previous value: -"string"New value: +[
      +  "number",
      +  "string"
      +]
    • changedInput schema / properties / stream / type
      Previous value: -"string"New value: +[
      +  "boolean",
      +  "string"
      +]
    • changedInput schema / properties / temperature / type
      Previous value: -"string"New value: +[
      +  "number",
      +  "string"
      +]
  2. Changed1 schema field changed
    • changedInput schema / properties / model / enum
      Previous value: -[
      -  "llama-4-scout",
      -  "gpt-oss-20b",
      -  "qwen3-30b",
      -  "glm-4.7-flash"
      -]New value: +[
      +  "llama-4-scout",
      +  "gpt-oss-20b",
      +  "gemma-4-26b",
      +  "glm-4.7-flash"
      +]
  3. Added

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral burden well: it discloses the flat $0.002 per-call cost, the x402/USDC-on-Base payment mechanism (an auth prerequisite), 10,000-character input and 1,024-token output caps, and SSE behavior for streaming. Gaps remain on error/over-limit behavior and the fact that unknown model names silently fall back to the default.

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?

Front-loaded with the identity and compatibility statement, then models, limits, and price — every clause carries information and nothing is filler. It is a single dense block rather than structured lines, which slightly hurts scanability for a spec-heavy tool.

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?

There is no output schema, but the description compensates by declaring the response is identical to OpenAI's /v1/chat/completions, so return shape is understood without further detail. Combined with models, limits, cost, and payment path, an agent has everything needed to call this correctly.

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 80%, so the baseline is 3; the description adds real meaning by naming the default model, the capped max_tokens, streaming chunk format, and the OpenAI-equivalent meaning of each field. It also mentions response_format json_object, which adds context beyond the schema — though that property is absent from the schema with additionalProperties=false, which could mislead.

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 specific resource and compatibility contract: 'OpenAI-compatible chat completions ... the same request and response as OpenAI's /v1/chat/completions'. It names the exact endpoint semantics, enumerates the available models with a default, and gives price, so an agent knows precisely what capability this exposes.

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 a clear selection signal: 'so an OpenAI SDK works by changing the base URL', which tells an agent this is the drop-in OpenAI-shaped option and implicitly the cheap flat-rate one. It stops short of stating when NOT to use it (e.g. long-context needs beyond 10,000 characters or 1,024 output tokens).

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