Skip to main content
Glama

chat_completion

Generate chat completions from conversation messages using Qwen3-coder with optional model, temperature, and token limits. Returns the model's response.

Instructions

    Generate a chat completion using Qwen3-coder (cloud preferred, local fallback).

    Args:
        messages: List of message objects with 'role' and 'content' keys.
        model: Optional model override (default: auto-selected best available).
        temperature: Sampling temperature (0.0 to 2.0, default: 0.7).
        max_tokens: Maximum tokens to generate.
        **kwargs: Additional parameters for the chat API.

    Returns:
        JSON-serializable dict with the model response.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNo
kwargsYes
messagesYes
max_tokensNo
temperatureNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Install Server

TDQS

B3.3/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full disclosure burden. It adds useful behavioral context: cloud-prefered with local fallback and auto-selected model unless overridden. However, it does not disclose error behavior, side effects, auth requirements, or what happens when the fallback is triggered, leaving notable gaps.

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 a well-structured docstring with a one-line summary, then concise Args and Returns entries. There is little filler and each line contributes information. A minor redundancy is the Returns section, which may duplicate what the output schema already provides.

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

Completeness3/5

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

For a chat completion tool with five params and no annotations, the description covers the core call and most parameters. However, it leaves the required kwargs format unexplained, does not specify when to use this tool instead of search_and_chat, and omits fallback/error behavior. These gaps make it adequate but not fully complete.

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 description coverage is 0%, so the Args block meaningfully compensates. It explains message format (role/content), model override behavior, temperature range and default, and max_tokens purpose. The required kwargs parameter is only described as 'Additional parameters for the chat API' without explaining its string encoding, so the compensation is not complete.

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 'Generate a chat completion using Qwen3-coder', naming a specific verb and resource. It clearly identifies the model and the cloud/local fallback behavior. However, it does not distinguish itself from the sibling tool search_and_chat, so it stops short of full differentiation.

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?

The description provides no when-to-use guidance and does not mention any alternative tools. Given the sibling search_and_chat, an agent could easily be uncertain which completion tool to select, and the description does not resolve that ambiguity. Usage is only implied by the tool name and the verb 'generate'.

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

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/timscodebase/ollamaMCP'

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