Skip to main content
Glama

openrouter_chat_completion

Execute chat inference on any OpenRouter model using a prompt or role-based messages, with optional token, temperature, and reasoning controls.

Instructions

Execute chat inference on any model available on OpenRouter (e.g. google/gemini-2.5-flash, anthropic/claude-3.7-sonnet, deepseek/deepseek-v4-flash-0731:US, meta-llama/llama-3.3-70b-instruct).

Input Schema

NameRequiredDescriptionDefault
modelNoOpenRouter model ID (default: 'google/gemini-2.5-flash').google/gemini-2.5-flash
promptNoSimple prompt string (fallback if 'messages' is omitted).
messagesNoArray of messages [{role: 'user'|'system'|'assistant', content: '...'}]
reasoningNoThinking / reasoning config (e.g. { effort: 'high' } or { enabled: true }).
max_tokensNoMaximum completion tokens limit.
temperatureNoSampling temperature (0.0 to 2.0).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description carries the full behavioral burden, yet it discloses nothing about cost/credit consumption, API-key requirements, rate limits, timeouts, or whether calls are stateless. For a paid external-inference call this is a meaningful omission.

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?

One tight, front-loaded sentence with no filler. It is appropriately sized, though its brevity comes at the cost of the missing guidance noted elsewhere.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

A six-parameter tool with nested message objects, no output schema, and no annotations needs more than a single sentence. The description omits the fallback relationship between prompt and messages, the response shape, and the cost/auth context an agent needs before invoking.

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 100%, so the baseline is 3. The description's only added value is example model IDs beyond the single default in the schema; it says nothing about how 'messages' interacts with 'prompt' or how 'reasoning' affects output.

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 states a specific verb+resource ('Execute chat inference on any model available on OpenRouter') and the model-ID examples make the scope concrete. It is clearly distinguishable from the sibling tools (list_models, get_credits, manage_keys) by resource, though it never names them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no when-to-use guidance: nothing tells the agent when to prefer 'messages' over 'prompt', when to use this versus other OpenRouter tools, or that it incurs cost/requires an API key. Usage must be entirely inferred.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.