Appearance
Tools
"Tools" in Chat means two distinct things. This page disambiguates them.
Slash-command tools
User-side. Typed into chat-input, recognized by ChatApp.handleClientCommand. Maps in ChatApp.ts:131-146. These are Chat-side actions — they don't go through the model.
Provider-driven tool calls
Model-side. When the inference provider (Anthropic, OpenAI, Codex) emits a tool-use block, system.agents forwards it as an $activity frame with phase: 'tool-start' and (later) phase: 'tool-result'. Chat renders both inline.
MatrixChatApp.on$Activity and ConversationSurfaceActor.on$Activity both handle these phases identically:
ts
case 'tool-start': {
const op = payload.op ?? '';
const target = payload.target ?? '';
this.sendToChild('renderer', 'renderer.add-tool', { op, target });
break;
}
case 'tool-result': {
const op = payload.op ?? '';
const summary = payload.summary ?? 'done';
const duration = payload.durationMs;
this.sendToChild('renderer', 'renderer.add-tool-result', { op, summary, duration });
break;
}The renderer (the conversation message list or <conversation-renderer>) shows a small chip for each tool call, with the op name, target, and (on completion) the summary and duration.
Tool inventory is opaque to Chat
Chat does not know what tools the model has access to. Tools are configured on the runtime side:
- Provider-driven tools (file IO, web search, etc.) are owned by the provider driver and
system.agents. - MCP-bridged tools (when MCP is enabled) come through
system.mcp/ChatMcpProxy.
If a tool fails, the failure surfaces as a tool-result with an error summary. Chat does not retry; the model decides whether to retry.
The $activity trace renderer
mx-activity-trace (src/elements/mx-activity-trace.ts) renders the full $activity stream as a debugging trace. Filters by:
phase: 'tool-start'andop: '$prompt'for prompt boundaries.phase: 'tool-result'andop: '$prompt'for prompt completions.- All other tool starts/results.
The intent is operator/developer visibility — you can see exactly which tools the model invoked, when, and how long they took. It's not enabled by default in the user-facing transcript; it's available as /inspector or via direct mount.
What about MCP?
ChatMcpProxy connects Chat to MCP-spec'd tool servers. When configured (and config.features.mcpStatus === true), Chat polls MCP status and shows a small indicator in the sidebar. The MCP proxy is not auto-started — matrix.json declares autoStart: false for the MCP component (chat manifest line 90-94).
To enable MCP tools, configure them on the runtime side; Chat will pick them up via the proxy.
See also
Source:
projects/matrix-3/packages/chat/src/ChatApp.ts(slash command map, on$Activity),src/elements/mx-activity-trace.ts:80-90, 245-260,chat/matrix.json(component declarations).