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-ptl-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

A4/5.0
Behavior5/5

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

Annotations already declare openWorldHint=true and non-read-only, but the description adds material context the annotations cannot: billing is tied to the API key in the Authorization header (Bearer sk-ptl-live-...), the call fails without one, costs are returned, and web_search is billed per search with price discoverable in the catalog. These are exactly the auth, billing, and failure-mode details an agent needs before invoking a metered external call.

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?

The core action and return values are front-loaded in the first sentence, with parameter and billing notes following in a compact block. Three sentences carry a lot of information with little waste, though the parenthetical billing details are slightly dense.

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?

There is no output schema, and the description compensates by naming the return values (answer, token usage, cost). Auth, billing, and the key optional parameters are covered; only secondary details such as error behavior beyond a missing key or rate limits are absent, which is reasonable for a 7-parameter tool.

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, but the description adds genuine meaning beyond the schema: it explains that 'system' is prepended as a system message, that 'image_urls' only work for image-capable models and that a file produced by generate is a valid source, and that 'web_search' incurs per-search billing. That goes beyond the field-level documentation.

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 opens with a specific verb and resource ('Sends messages to any chat model id') and names the underlying endpoint and return payload (answer, token usage, request cost), so the agent knows exactly what the tool does. It does not explicitly differentiate itself from text-oriented siblings such as generate or search, leaving that inference to the caller.

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?

Guidance is implied rather than stated: the description explains what 'web_search' and 'image_urls' enable, which implicitly tells the agent when those options are appropriate, but there is no explicit when-to-use-this-vs-an-alternative guidance or exclusions relative to siblings like generate or compare.

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.