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-uplink-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.8/5.0
Behavior4/5

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

Annotations already mark this non-read-only, open-world, non-idempotent and non-destructive, so the safety profile is covered. The description adds genuinely new context: billing to the key in the Authorization header, hard failure without one, per-search billing for web_search, and the returned cost figure — though it says nothing about rate limits or error modes beyond missing auth.

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?

Purpose and return values are front-loaded in the first sentence, followed by the three notable parameter behaviors and the auth/billing note. It is dense but each sentence carries information; the run-on construction and parentheses make it slightly harder to scan than it could be.

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?

With 7 parameters, no output schema, and a mutation/paid operation, the description covers what an agent most needs: what comes back (answer, usage, cost), the auth requirement and failure mode, and the notable optional features. Remaining gaps like pricing magnitude and error handling are minor for a single-call chat endpoint.

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 86%, so the baseline is 3; the description earns an extra point by explaining intent for system and image_urls (vision models only, accepts files produced by generate) and for web_search (model may search mid-answer, billed per search at the catalog price). It leaves temperature and max_tokens entirely to 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?

The description names a specific verb and resource (send messages to a chat model) plus the underlying endpoint POST /v1/chat/completions, and states the return payload (answer, token usage, cost). It is clearly distinguishable from image/audio siblings like generate or transcribe, though it never names an alternative explicitly.

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 context is implied through parameter behaviors (system for instructions, image_urls for vision-capable models, web_search for online lookups) and the hint that a generate-produced file can be fed in as an image URL. There is no explicit when-to-use/when-not guidance and no routing to siblings such as compare or generate.

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.