Skip to main content
Glama

Chat (LLM)

xbrush_chat

Send chat messages to an XBrush-hosted LLM and receive the completion text directly, without polling. Supports OpenAI-compatible models like GLM 5.2.

Instructions

Chat with an XBrush-hosted LLM (OpenAI-compatible chat completions, e.g. GLM 5.2). SYNCHRONOUS — returns the completion text directly; no request_id polling needed. The platform gateway cuts responses at ~30s, so keep outputs short: prefer the default reasoning_effort (none) or 'minimal' and a modest max_tokens. On a 504 gateway timeout the request usually STILL completes and bills server-side — recover the text with xbrush_list_requests + xbrush_get_request (failed requests are auto-refunded).

Args: model (string, required): e.g. z-ai/glm-5.2. See xbrush_list_models(category='text'). messages (array, required): 1-1000 of {role: system|user|assistant, content: string ≤1M chars}. max_tokens (int, optional): 1-65536, includes reasoning tokens. temperature (float, optional): 0-2. top_p (float, optional): 0-1. frequency_penalty / presence_penalty (float, optional): -2 to 2. reasoning_effort (string, optional): none/minimal/high/max. Default: none (fastest).

Billed per token (input/output/cached rates via xbrush_list_models). OpenAI params not listed above (tools, stop, n, seed, response_format, stream) are not supported.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYesLLM model ID (e.g. z-ai/glm-5.2). Use xbrush_list_models with category='text' to see options and per-token pricing.
top_pNoNucleus sampling probability mass (0-1).
messagesYesConversation so far, oldest first (1-1000 messages). The completion answers the last user message.
max_tokensNoUpper bound on generated tokens (1-65536), reasoning included. Keep modest — the response must finish within the ~30s gateway limit.
temperatureNoSampling temperature (0-2). Higher = more random.
presence_penaltyNoPenalize tokens already present (-2 to 2).
reasoning_effortNoReasoning budget for reasoning-capable models. Server default: none (fastest). Higher efforts can exceed the ~30s gateway limit — prefer none/minimal here.
frequency_penaltyNoPenalize frequent tokens (-2 to 2).
Behavior5/5

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

Beyond the annotations (readOnlyHint=false, idempotentHint=false, etc.), the description discloses critical behavioral traits: synchronous execution, 30s gateway cutoff, 504 timeout behavior where the request still completes and bills, automatic refunds for failed requests, and unsupported OpenAI parameters. This adds significant value and gives the agent a realistic model of the tool's side effects and failure modes.

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 front-loaded with purpose and the most critical behavioral caveat (synchronous, 30s limit). The Args section does repeat some schema constraints (types, ranges), but each repetition often carries added context (e.g., 'keep modest' for max_tokens). It is somewhat long but every section serves a purpose; still, a slightly tighter version could omit the redundant parameter constraints.

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

Completeness5/5

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

For a tool with 8 parameters, no output schema, and non-trivial runtime behavior, this description is thorough. It covers invocation, billing, error recovery, unsupported parameters, and practical usage constraints. The agent has enough context to select the tool, set parameters sensibly, and handle timeouts without needing additional lookup.

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 100%, so the baseline is 3. The description adds extra meaning beyond the schema: it notes that max_tokens includes reasoning tokens, that server default reasoning_effort is 'none (fastest)', and explicitly lists unsupported OpenAI parameters (tools, stop, etc.). This enriches parameter understanding beyond raw schema definitions.

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 clearly states the tool's function: 'Chat with an XBrush-hosted LLM (OpenAI-compatible chat completions)'. It uses a specific verb and resource, and the focus on chat completions distinguishes it from the many image/video/audio generation siblings. The 'SYNCHRONOUS' note further differentiates it from request-based tools.

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

Usage Guidelines4/5

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

The description provides strong contextual guidance: it explicitly states this is synchronous with no polling needed, warns about the ~30s gateway limit, and advises on reasoning_effort and max_tokens. It also directs users to xbrush_list_models for model selection and mentions using xbrush_list_requests/get_request for timeout recovery. It does not explicitly name alternative chat tools because none exist among siblings, so exclusion guidance is less critical.

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/lweight/xbrush-api-mcp'

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