Skip to main content
Glama

chat

Read-only

Send prompts to local or cloud LLM providers with optional overrides for model, provider, system prompt, and temperature. Returns structured JSON with content and metadata.

Instructions

Chat with the configured LLM provider (local or cloud).

Uses the unified LLM client which auto-detects local providers (Ollama, LM Studio) and supports cloud providers (OpenAI, Anthropic, Google Gemini) via API keys.

The provider and model can be overridden per-request.

Return Format

{"success": bool, "content": str, "model": str, "provider": str}

Examples

await chat(prompt="What is the capital of Austria?") await chat(prompt="Explain quantum computing in 3 sentences", system="Be concise.") await chat(prompt="Hello", provider="openai", model="gpt-4o") await chat(prompt="Describe Vienna", temperature=0.3)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNoOverride model name.
promptYesThe message or question to send to the LLM.
systemNoOptional system prompt to set context.
providerNoOverride provider: ollama, lmstudio, openai, anthropic, google.
max_tokensNoMax tokens in response.
temperatureNoSampling temperature 0.0-2.0.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so safety is covered. The description adds genuinely useful behavior beyond that: provider auto-detection order for local runtimes, the API-key requirement for cloud providers, and per-request override semantics. It stops short of noting cost, latency, or rate-limit implications of cloud calls.

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?

Purpose is front-loaded in the first sentence, with provider mechanics second and examples last. The 'Return Format' block partially duplicates the output schema and is the one section that does not fully earn its place, but the examples themselves are compact and instructive.

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?

With an output schema present, explaining return values is optional and the restated format is a minor redundancy rather than a gap. The description covers provider resolution, overrides, and parameter usage sufficiently; only failure modes (no provider configured, invalid API key, provider unreachable) are left unaddressed.

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, but the examples meaningfully add value by showing how parameters compose (system prompt alongside prompt, provider+model override together, temperature tuning). That demonstrates the override precedence described in prose but not spelled out per-parameter in the schema.

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 states a specific action (send a prompt to the configured LLM) and resource, then explains the underlying mechanism: a unified client that auto-detects local providers (Ollama, LM Studio) and supports cloud providers via API keys. Sibling tools (status, help, ops, workflow) are unrelated utility endpoints, so no sibling differentiation is required for an agent to pick correctly.

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?

Usage is demonstrated through four concrete examples rather than stated explicitly; there is no 'use this when...' guidance or exclusion of alternatives. The mention of API keys for cloud providers is the only implicit prerequisite, and nothing tells the agent what happens when no provider is reachable. Adequate but with clear gaps for a tool whose behavior varies by environment.

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