Send a query
| Field | Type | Required | Description |
|---|---|---|---|
query | string | Yes | The user’s question |
session_id | string | No | Session identifier for multi-turn conversations |
history | array | No | Prior message history ([{role, content}]) |
What happens during a query
- Load workspace config: model, system prompt, max tool rounds
- Find or create conversation: uses
session_idor creates a new conversation - Load conversation history: prior messages for context
- Connect to MCP servers: establish connections to all workspace MCP servers
- Discover tools: call
tools/liston each connection - Agent loop: send query + tools to the language model; execute tool calls; repeat until text response
- Record: save messages to conversation, create audit log entry
- Return: answer, tools called, cost, duration
Errors
If a query fails, theerror field contains the error message. The answer field may still contain a partial response.