Reference
MCP tool reference
Every memory_* tool exposed by quaid serve, with parameters, returns, and JSON-RPC examples.
quaid serve exposes a stdio MCP server that speaks JSON-RPC 2.0. Twenty-six memory_* tools cover the read, write, graph, intelligence, conversation memory, and namespace surfaces. This page is the canonical catalog.
Version note. The stdio surface grew to 26 tools (adding
memory_gap_resolveandmemory_rehydrate); graph path output, HTTP/SSE transport, andquaid daemonlifecycle commands are all available in the current published release (v0.23.0). Main currently carries the same0.23.0manifest, so there is no separate branch-only MCP surface documented here.
The default transport is stdio. Any MCP-compatible client (Claude Code, Cursor, custom rmcp clients) can connect by spawning quaid serve and exchanging JSON-RPC over stdin/stdout. An opt-in HTTP/SSE transport is also available via quaid serve --http or quaid daemon run --http in v0.23.0. See Connect Claude Code for a worked example.
Platform note.
quaid serveand all MCP tools are cross-platform. Live vault-sync watcher threads (automatic reconcile on file edits) start only on Unix (macOS / Linux) and are simply not started on Windows — MCP tool calls continue to work normally on all platforms.
Conventions
Section titled “Conventions”- Slugs may be collection-qualified (
<collection>::<slug>). Bare slugs resolve to the default collection or fail withAmbiguityif multiple collections expose the same slug. - All timestamps are ISO-8601 strings.
valid_from/valid_untilmay benullto indicate open-start or open-end intervals. - Error responses use extended JSON-RPC codes documented in Errors.
- The MCP server enforces collection write-gates: a
restoringorneeds_full_synccollection rejects mutations withCollectionRestoringErrorbefore any other validation runs.
Tools at a glance
Section titled “Tools at a glance”| Tool | Purpose | Mutates |
|---|---|---|
memory_get | Read a page | – |
memory_put | Create or update a page (OCC) | ✓ |
memory_query | Hybrid semantic + FTS5 query | – |
memory_search | FTS5 keyword search | – |
memory_list | List pages with filters | – |
memory_rehydrate | Reverse outbound redaction tokens (session) | – |
memory_link | Create a temporal link | ✓ |
memory_link_close | Close a temporal link interval | ✓ |
memory_backlinks | List inbound links | – |
memory_graph | N-hop graph neighbourhood | – |
memory_check | Contradiction detection | – |
memory_timeline | Timeline entries for a page | – |
memory_tags | List, add, or remove tags | ✓ |
memory_gap | Log a knowledge gap (privacy-safe) | ✓ |
memory_gaps | List knowledge gaps | – |
memory_gap_resolve | Resolve a gap by its answering page | ✓ |
memory_stats | Memory statistics | – |
memory_collections | List collection status | – |
memory_raw | Store raw structured data | ✓ |
memory_add_turn | Append a turn to a conversation session | ✓ |
memory_close_session | Close a conversation session for extraction | ✓ |
memory_close_action | Mark an action-item page done or cancelled | ✓ |
memory_correct | Start a guided fact-correction dialogue | ✓ |
memory_correct_continue | Advance or abandon an open correction dialogue | ✓ |
memory_namespace_create | Create an isolated namespace | ✓ |
memory_namespace_destroy | Destroy a namespace and its contents | ✓ |
Read tools
Section titled “Read tools”memory_get
Section titled “memory_get”Get a page by slug.
| Param | Type | Required | Notes |
|---|---|---|---|
slug | string | yes | Bare or collection-qualified |
Returns the rendered markdown of the page (compiled truth + timeline).
{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{ "name":"memory_get","arguments":{"slug":"people/alice"}}}Errors: NotFound, Ambiguity.
memory_search
Section titled “memory_search”FTS5 full-text search.
| Param | Type | Required | Default |
|---|---|---|---|
query | string | yes | – |
collection | string | no | – |
namespace | string | no | – |
wing | string | no | – |
limit | u32 | no | 10 |
include_superseded | boolean | no | false |
Returns a JSON array of {slug, title, snippet, score}.
memory_query
Section titled “memory_query”Hybrid semantic + FTS5 query.
| Param | Type | Required | Default |
|---|---|---|---|
query | string | yes | – |
collection | string | no | – |
namespace | string | no | – |
wing | string | no | – |
limit | u32 | no | 10 |
depth | string | no | – (set to "auto" for progressive expansion) |
include_superseded | boolean | no | false |
Returns a ranked, fused result list with optional progressive context up to the active token budget.
memory_list
Section titled “memory_list”List pages with optional filters.
| Param | Type | Required | Default |
|---|---|---|---|
collection | string | no | – |
namespace | string | no | – |
wing | string | no | – |
page_type | string | no | – |
limit | u32 | no | 50 |
memory_rehydrate
Section titled “memory_rehydrate”Reverse this session’s outbound redaction tokens back to their originals.
| Param | Type | Required | Notes |
|---|---|---|---|
text | string | yes | Text containing tokens like <EMAIL_1> to restore |
Reversal uses the redaction map built for this connection by earlier redact: true reads. The substitution happens locally; originals never leave the machine until the agent acts on the rehydrated text. Unknown tokens pass through untouched.
Write tools
Section titled “Write tools”memory_put
Section titled “memory_put”Write or update a page.
| Param | Type | Required | Notes |
|---|---|---|---|
slug | string | yes | – |
content | string | yes | Full page markdown (frontmatter + body) |
expected_version | i64 | no (required for safe updates) | OCC: must match current version |
namespace | string | no | Write into a named namespace; omit for global memory |
Errors: Conflict on OCC violation; CollectionReadOnlyError if the target collection is not writable; CollectionRestoringError while a collection is mid-restore.
{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{ "name":"memory_put", "arguments":{ "slug":"people/alice", "content":"---\ntitle: Alice\ntype: person\n---\n# Alice\n\n…", "expected_version": 7 }}}memory_raw
Section titled “memory_raw”Store raw structured data (API responses, JSON) for a page.
| Param | Type | Required | Default |
|---|---|---|---|
slug | string | yes | – |
source | string | yes | E.g. "crustdata", "exa", "meeting" |
data | object | yes | Must be a JSON object (not array/scalar) |
overwrite | boolean | no | false |
Per (slug, source) only one row is kept active; older rows roll over per the configured retention.
Graph tools
Section titled “Graph tools”memory_link
Section titled “memory_link”Create a typed temporal link between two pages.
| Param | Type | Required |
|---|---|---|
from_slug | string | yes |
to_slug | string | yes |
relationship | string | yes |
valid_from | ISO-8601 | no |
valid_until | ISO-8601 | no |
memory_link_close
Section titled “memory_link_close”Close a temporal link by its database ID.
| Param | Type | Required |
|---|---|---|
link_id | u64 | yes |
valid_until | ISO-8601 | yes |
memory_backlinks
Section titled “memory_backlinks”List inbound backlinks for a page.
| Param | Type | Required | Default |
|---|---|---|---|
slug | string | yes | – |
limit | u32 | no | – |
temporal | string | no | "current" (alt: "all") |
memory_graph
Section titled “memory_graph”N-hop neighbourhood graph from a page, with path explanations.
| Param | Type | Required | Default |
|---|---|---|---|
slug | string | yes | – |
depth | u32 | no | 2 |
temporal | string | no | "current" |
The response carries the usual nodes and edges arrays plus a paths
object keyed by reachable slug. Each value is a list of
(from_slug, relationship, to_slug) triples describing the first path
found to that node during BFS; the value for the root slug is an empty
list. This shape shipped in v0.22.0 and remains part of the current
published release (v0.23.0). There is no compatibility mode.
Intelligence tools
Section titled “Intelligence tools”memory_check
Section titled “memory_check”Run contradiction detection on a page or all pages.
| Param | Type | Required |
|---|---|---|
slug | string | no (omit to scan globally) |
memory_timeline
Section titled “memory_timeline”Show timeline entries for a page.
| Param | Type | Required | Default |
|---|---|---|---|
slug | string | yes | – |
limit | u32 | no | 20 |
memory_tags
Section titled “memory_tags”List, add, or remove tags on a page.
| Param | Type | Required |
|---|---|---|
slug | string | yes |
add | string[] | no |
remove | string[] | no |
memory_gap
Section titled “memory_gap”Log a knowledge gap (privacy-safe: stores
query_hash, not raw query).
| Param | Type | Required |
|---|---|---|
query | string | yes |
slug | string | no |
context | string | no |
The raw query is not persisted unless explicitly approved via the knowledge_gaps approval workflow. See Sensitivity contract.
memory_gaps
Section titled “memory_gaps”List knowledge gaps.
| Param | Type | Required | Default |
|---|---|---|---|
resolved | boolean | no | false |
limit | u32 | no | 20 (max 1000) |
memory_gap_resolve
Section titled “memory_gap_resolve”Mark a logged gap resolved by the page that answered it.
| Param | Type | Required |
|---|---|---|
id | i64 | yes |
slug | string | yes |
Flips the gap’s resolved_at / resolved_by_slug; the slug must resolve to an existing page. Resolved gaps drop out of the default memory_gaps queue.
Stats and collections
Section titled “Stats and collections”memory_stats
Section titled “memory_stats”Memory statistics.
No parameters. Returns counts (pages, links, embeddings, gaps), the active embedding model, and schema version.
memory_collections
Section titled “memory_collections”List collection status for MCP clients.
No parameters. Returns one entry per attached collection with state, ignore-pattern diagnostics, and recovery flags.
Conversation memory tools
Section titled “Conversation memory tools”These tools store and process conversation turns. Turns are batched under a session_id; closing a session queues the conversation for knowledge extraction into pages. Turn content may contain ordinary Markdown horizontal rules (---); Quaid uses an internal turn boundary marker so content delimiters are not confused with stored turn separators.
memory_add_turn
Section titled “memory_add_turn”Append a turn to a conversation session.
| Param | Type | Required | Default |
|---|---|---|---|
session_id | string | yes | – |
role | string | yes | "user", "assistant", or "system" |
content | string | yes | – |
timestamp | ISO-8601 | no | server time |
metadata | object | no | – |
namespace | string | no | – |
{"jsonrpc":"2.0","id":10,"method":"tools/call","params":{ "name":"memory_add_turn", "arguments":{ "session_id":"sess-abc123", "role":"user", "content":"What did we decide about the API rate limits?" }}}memory_close_session
Section titled “memory_close_session”Close a session and queue it for knowledge extraction.
| Param | Type | Required |
|---|---|---|
session_id | string | yes |
namespace | string | no |
Returns the queue position for the extraction job. Calling memory_close_session again on the same session reports the current queue position without re-enqueuing.
memory_close_action
Section titled “memory_close_action”Mark an
action_itempage as done or cancelled.
| Param | Type | Required | Notes |
|---|---|---|---|
slug | string | yes | Must be an action_item page |
status | string | yes | "done" or "cancelled" |
note | string | no | Appended to the page’s truth body |
Errors: KindError if the page is not an action_item; Conflict on OCC violation.
memory_correct
Section titled “memory_correct”Start a guided fact-correction dialogue on a page.
| Param | Type | Required |
|---|---|---|
fact_slug | string | yes |
correction | string | yes |
Returns a correction_id and a prompt asking the agent to confirm or refine the proposed change. Advance or abandon the dialogue with memory_correct_continue.
memory_correct_continue
Section titled “memory_correct_continue”Advance or abandon an open correction dialogue.
| Param | Type | Required |
|---|---|---|
correction_id | string | yes |
response | string | no |
abandon | boolean | no |
Set abandon: true to discard the dialogue without writing changes.
Namespace tools
Section titled “Namespace tools”Namespaces provide isolated scopes within the same database — useful for per-project or per-client memory partitions. Pages written with a namespace are invisible to queries that don’t specify that namespace.
memory_namespace_create
Section titled “memory_namespace_create”Create a namespace.
| Param | Type | Required | Default |
|---|---|---|---|
id | string | yes | – |
ttl_hours | float | no | – (no expiry) |
When ttl_hours is set, the namespace and all its pages are automatically destroyed after the TTL elapses.
{"jsonrpc":"2.0","id":20,"method":"tools/call","params":{ "name":"memory_namespace_create", "arguments":{"id":"project-alpha","ttl_hours":720}}}memory_namespace_destroy
Section titled “memory_namespace_destroy”Destroy a namespace and all pages within it.
| Param | Type | Required |
|---|---|---|
id | string | yes |
This is irreversible. Pages in the namespace are permanently removed.
JSON-RPC envelope
Section titled “JSON-RPC envelope”Every tool call uses the standard MCP tools/call shape:
{ "jsonrpc": "2.0", "id": <request_id>, "method": "tools/call", "params": { "name": "<tool_name>", "arguments": { ... } }}Successful responses contain a result.content array. Errors return an error.code per Errors.