Registration
internal/cli/mcp.go opens the SQLite session store, constructs a NewCronStore, wraps both in mcp.NewStoreBackend, and calls mcp.RegisterRousseauTools(s, backend). The four tools below are attached in insertion order — tools/list returns them in this exact order.
Every tool is read-only. There is no write surface over MCP today; that is by design so an MCP host cannot mutate rousseau's state.
rousseau_search_sessions
Description (surfaced to hosts): Full-text search across every recorded rousseau session. Uses SQLite FTS5 syntax (phrases in double quotes, AND/OR/NOT, prefix wildcards).
Input schema:
{
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "FTS5 query"
},
"limit": {
"type": "integer",
"description": "Cap hits returned. Default 20."
}
},
"required": ["query"]
}
Behaviour. Passes query verbatim to SQLite's FTS5 engine (Store.Search in internal/state/sqlite/search.go). Results are ordered by BM25 rank (lower = more relevant). Each hit renders as three lines:
session <id> (rank 0.42)
title: <session title>
snippet: <~200-char snippet with … ellipses>
Errors. An empty query returns query is required. FTS5 syntax errors bubble up as SQLite errors and surface via isError: true.
rousseau_list_sessions
Description (surfaced to hosts): List rousseau sessions newest-first.
Input schema:
{
"type": "object",
"properties": {
"limit": {
"type": "integer",
"description": "Cap rows returned. Default 20."
}
}
}
Behaviour. Calls Store.List which uses the idx_sessions_updated_at DESC index. Each row:
<session-id> <title> msgs=<count> updated=<iso-8601>
Returns (no sessions) when the store is empty.
rousseau_read_session
Description (surfaced to hosts): Return the full transcript of a rousseau session by id.
Input schema:
{
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Session id"
}
},
"required": ["id"]
}
Behaviour. Calls Store.Load to fetch the full agent.Session. Renders as:
id: <session-id>
title: <session title>
created: <iso-8601>
updated: <iso-8601>
messages: <count>
[0] user
<text content>
[1] assistant
<text content>
...
Only text content is rendered — tool_use blocks and tool_result blocks are elided in the MCP surface (the CLI rousseau session show includes them; MCP intentionally does not).
Errors. id is required on empty input. state.ErrNotFound on unknown id.
rousseau_cron_list
Description (surfaced to hosts): List rousseau's scheduled cron jobs (name, schedule, prompt, delivery target).
Input schema:
{
"type": "object",
"properties": {}
}
Behaviour. Calls CronStore.List — one row per cron_jobs row:
<name> [<on|off>] <cron-expr> → <deliver-to> prompt="<prompt>" deliver=<deliver-to>
Returns (no jobs) when the cron table is empty. Also returns (no jobs) if the CronStore is nil at construction time (a defensive path in storeBackend.CronList).
What is NOT exposed
Deliberate omissions:
| Surface | Why not |
|---|---|
rousseau_write_session / rousseau_delete_session |
Mutation over MCP would let an untrusted host reshape rousseau's audit trail. |
rousseau_add_cron |
Same reason — mutation. Add cron jobs via rousseau cron add. |
The built-in tools (read, write, edit, grep, bash) |
These are agent-facing tools for the LLM inside rousseau's own loop, not host-facing. Exposing them would give the MCP host the ability to shell out on the host running rousseau — precisely the trust flip we don't want. |
| JID map lookup | Exposes PII (phone numbers). If you need it, query SQLite directly on the machine where the daemon runs. |
Error surface
MCP handlers return ([]Content, error). On error, the server (internal/mcp/server.go handleToolsCall) surfaces the error as ToolsCallResult{Content: text of err, IsError: true}. This is per the MCP convention: tool failures flow through the content channel with isError=true, not through the JSON-RPC error channel. Hosts should render the text and continue.
Related
- MCP — the umbrella reference.
- MCP: Compatibility — tested clients.
- MCP: Exposed resources — roadmap.
- Reference: Tool schemas — the different agent-facing tool set.