Skip to main content
Glama
tsilva
by tsilva

chat

Send chat completion requests to any OpenRouter model. Configure model, system prompt, and sampling parameters like temperature and max tokens.

Instructions

Send a chat completion request to any OpenRouter model.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
seedNoRandom seed for deterministic outputs
stopNoList of stop sequences
modelNoModel identifier (e.g., "anthropic/claude-sonnet-4", "openai/gpt-4o"). If not specified, uses DEFAULT_TEXT_MODEL environment variable.
top_kNoTop-k sampling (number of top tokens to consider)
top_pNoNucleus sampling threshold 0-1
promptNoUser message to send (provide either prompt or messages, not both)
systemNoOptional system prompt to set context
messagesNoMulti-turn conversation as a list of {role, content} dicts (provide either prompt or messages, not both)
providerNoProvider routing control (e.g., {"order": ["Anthropic", "Google"]})
json_modeNoIf True, request JSON-formatted response (backward compat)
max_tokensNoMaximum tokens in response (model default if not specified)
temperatureNoSampling temperature 0-2 (model default if not specified)
response_formatNoResponse format spec, e.g. {"type": "json_schema", ...}. Supersedes json_mode if both provided.
presence_penaltyNoPenalize tokens already present (-2 to 2)
reasoning_effortNoReasoning effort level: "minimal", "medium", or "high"
assistant_prefillNoText to prefill the assistant response with
frequency_penaltyNoPenalize repeated tokens (-2 to 2)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/5

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

With no annotations provided, the description bears full responsibility for disclosing behavioral traits. It only states the action without explaining rate limits, cost implications, error handling, or output format. The schema adds some detail, but the description itself lacks transparency.

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 description is one sentence, front-loaded with the main purpose. It is efficient and to the point, though it could provide a bit more context without becoming overly verbose.

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?

Despite a full output schema, the description is too brief for a tool with 17 parameters. It does not explain parameter interplay (e.g., prompt vs messages) or provide context on typical use cases. An agent would benefit from more guidance.

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 baseline is 3. The description does not add any parameter-specific meaning beyond what the schema already provides, but it does not need to since the schema is thorough.

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?

The description uses a specific verb ('Send') and resource ('chat completion request') and mentions 'any OpenRouter model', which clearly distinguishes it from sibling tools like 'embed' or 'generate_image'. It aligns with common terminology.

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?

No guidance is provided on when to use this tool versus alternatives. There is no mention of criteria for selecting it over other tools like 'embed' or 'find_models', nor any exclusions or prerequisites.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tsilva/mcp-openrouter'

If you have feedback or need assistance with the MCP directory API, please join our Discord server