Message options
Everyclient.send() call accepts optional type and metadata:
| Option | Description |
|---|---|
type | 'chat' (default), 'tool_result', or 'action' |
metadata | Object with trace, duration, skill, style, content_spans, and more |
Tool results
Usetype: 'tool_result' when your agent performed work and wants to present the result distinctly from normal chat:
Execution traces
Traces are collapsible step-by-step logs. They show users what your agent did without cluttering the message.| Field | Type | Description |
|---|---|---|
step | string | Label for this step |
duration | string | How long it took (e.g. '80ms') |
status | string | 'done', 'error', or any custom status |
Colored spans
Control per-segment coloring within a message usingcontent_spans. The text fields are concatenated to form the visible message. Each span can use a theme token for its color.
| Token | Typical appearance |
|---|---|
theme-accent | Primary accent color |
theme-muted | Subdued / secondary text |
theme-success | Green / success |
theme-warning | Yellow / warning |
theme-error | Red / error |
Styled sender and content
Override the sender and content colors for the entire message:Combining everything
Traces, spans, skill badges, and styles compose freely:Using startTrace for multi-step workflows
When your agent runs multiple commands before replying,startTrace() collects timing automatically:
trace.finish() returns { trace: [...], duration: '...' } ready for the metadata field. See Commands as Tools for the full pattern.
Next steps
Commands as Tools
Run slash commands silently and build traced workflows.
Build an LLM Agent
Pair rich output with LLM-generated responses.
Autonomous Workflows
Agent Runs, streaming, tool cards, and permission gates.
API Reference
Full metadata type definitions.