MCP server

MCP tools reference

Complete reference for all seven Spectron MCP tools.

Spectron exposes seven tools over the Model Context Protocol at `/mcp`: **`remember`**, **`recall`**, **`context`**, **`reflect`**, **`forget`**, **`upload`**, and **`inspect`**. All tools use the same **`Authorization: Bearer`** authentication as the REST API. Point the MCP URL at `https:///mcp` on SurrealDB Cloud.

Note

Older docs used names such as memory_store, memory_recall, and knowledge_search. Those prefixes are retired — use the short names above.

Note

REST-aligned responses use camelCase (queryMs, traceId, trace.traceId). Scope arguments are slash paths (for example org/acme/user/alice). Register paths with spectron scopes create before use.

Tool responses correlate with graph-resident traces via **`traceId`** or **`trace.traceId`** (depending on the underlying endpoint). Use `GET .../traces/{traceId}` for the full record, or MCP **`inspect`** with `ref: "trace:"`.

Every tool accepts an optional context_id. When omitted, the server uses the Context bound to the bearer API key. An explicit context_id that does not match that binding returns 401.

Store a conversational exchange or free-text fact. Spectron auto-classifies content, reconciles against existing memory, and persists structured records.

REST equivalent: POST /api/v1/{context_id}/facts

FieldTypeRequiredDescription
textstringYesContent to remember
session_idstringNoExisting session to append to
scopestring[] or nested arraysNoDNF write selector within memory:write
labelsstring[]NoDescriptive key=value labels
infer"full" \| "preview" \| "none"NoDefault full
context_idstringNoOmit to use the bearer key's Context

Structured diff: entities, attributes, relations, instructions, uncertainties, corrections, plus a stand-in trace_id.

Tool: remember
Input: {
  "text": "I just got promoted to VP of Engineering and I'm moving to Singapore next month.",
  "scope": ["org/acme/user/alice"]
}

Unified search over experiential facts and document passages. Returns ranked hits (not a synthesised answer).

REST equivalent: POST /api/v1/{context_id}/query

FieldTypeRequiredDescription
querystringYesNatural-language question
kintegerNoHit count (default 10, max 50)
modestringNovector \| bm25 \| graph \| hybrid
lensstring[] or nested arraysNoDNF read lens
labelsstring[]NoOptional filters
context_idstringNoOmit to use the bearer key's Context
Tool: recall
Input: {
  "query": "What role does Alice have?",
  "k": 10,
  "lens": ["org/acme"]
}

Assemble a markdown context block for prompt injection (profile + relevant facts).

REST equivalent: POST /api/v1/{context_id}/context

FieldTypeRequiredDescription
querystringYesWhat context to assemble
lensstring[] or nested arraysNoDNF read lens
labelsstring[]NoOptional filters
context_idstringNoOmit to use the bearer key's Context

Synthesise insights across memory. Optionally persist with persist: true.

REST equivalent: POST /api/v1/{context_id}/reflect

FieldTypeRequiredDescription
querystringYesSynthesis question
persistbooleanNoDefault false
context_idstringNoOmit to use the bearer key's Context

Soft-delete attributes that match a natural-language query. Use purge: true for permanent erasure including history.

REST equivalent: POST /api/v1/{context_id}/forget

FieldTypeRequiredDescription
querystringYesWhat to stop believing
purgebooleanNoAlso erase supersession history
context_idstringNoOmit to use the bearer key's Context

Upload a document (base64). Processing is asynchronous — poll with inspect or REST.

REST equivalent: POST /api/v1/{context_id}/documents

FieldTypeRequiredDescription
bytes_base64stringYesDocument bytes (RFC 4648)
titlestringNoDisplay title
sourcestringNoProvenance string
mime_typestringNoMIME type
filenamestringNoOriginal filename
scopesnested arraysNoDNF write selector (scope alias accepted)
labelsstring[]NoLabels on the document
context_idstringNoOmit to use the bearer key's Context
Tool: upload
Input: {
  "bytes_base64": "aGVsbG8=",
  "title": "Team handbook",
  "scopes": [["org/acme/team/eng"]],
  "labels": ["team=eng"]
}

Look up an entity, trace, or document by typed reference.

REST equivalents: GET .../entities/..., GET .../traces/{id}, GET .../documents/{id}

FieldTypeRequiredDescription
refstringYesentity:<Type>/<Name>, trace:<id>, or document:<id>
context_idstringNoOmit to use the bearer key's Context
Tool: inspect
Input: {
  "ref": "document:01hx9…"
}

Operation failures return isError: true tool results with structuredContent.error.status mirroring REST (404, 403, 429, 401, 500). JSON-RPC error is reserved for protocol faults (bad params, unknown tool). Auth and missing-Context failures are masked as 401. See MCP tools — error handling.

Was this page helpful?