Skip to main content
Glama

Send a chat request

chat

Sends messages to any chat model id through POST /v1/chat/completions and returns the answer, the token usage and what the request cost. system adds instructions, image_urls lets a model that sees images look at them (a file generate made works), web_search lets the model search while it answers. Billed to the key in the MCP request's Authorization header (Bearer sk-relay-live-...); without one it fails.

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"
  }
}

Input Schema

NameRequiredDescriptionDefault
modelYesA chat model id from list_models.
systemNoInstructions placed ahead of the conversation as a system message.
messagesYesThe conversation, OpenAI chat format.
image_urlsNoImage URLs attached to the last user message, for the chat models that take images (input_modalities in list_models). A file generate made works.
max_tokensNoCap on completion tokens.
web_searchNoTrue: the model may search the web while it answers (billed per search, the price in GET /v1/catalog server_tools).
temperatureNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior5/5

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

Goes well past the annotations (which only say non-read-only, open-world, non-idempotent) by disclosing billing (charged to the Authorization header key, per-search billing for web_search, price discoverable via GET /v1/catalog) and the concrete failure mode when no key is supplied. These are exactly the operational facts an agent needs before spending money.

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 sentences, front-loaded with purpose and endpoint, then per-feature notes, then billing/auth. Efficient overall, though the per-parameter sentences largely restate schema descriptions and could be trimmed without losing meaning.

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?

No output schema exists, yet the description covers return content (answer, usage, cost), authentication, and billing — the main gaps an agent would otherwise hit. Minor omissions like streaming behavior or model-capability checks are partly delegated to list_models, so the definition is close to complete for a 7-parameter tool.

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 description coverage is 86%, so the schema already documents model, system, messages, image_urls, max_tokens, and web_search. The description adds little beyond the schema except the cross-tool hint that a file produced by generate works as an image_url and the billing note for web_search; max_tokens and temperature are untouched, which is acceptable given the schema.

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 plus the exact endpoint: sends messages to any chat model id via POST /v1/chat/completions, and names what comes back (answer, token usage, cost). It never contrasts itself with sibling tools such as generate or search, so an agent must infer that chat is for conversational models rather than image generation or retrieval.

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 only implied through the optional features: system for instructions, image_urls for vision-capable models, web_search for live search. There is no explicit when-to-use/when-not-to-use guidance or routing to alternatives like generate or search, leaving the agent to derive selection from feature mentions.

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.