MCP Tools Reference

July 22, 2026 · View on GitHub

SuperLocalMemory V3 Documentation https://superlocalmemory.com | Part of Qualixar

SuperLocalMemory exposes profile-selected tools and resources through the Model Context Protocol (MCP). The installed profile registry is the source of truth for names and counts; a client still decides when to call a tool.

Optimize tools: slm_compress, slm_retrieve, slm_cache_set, slm_cache_get, and slm_optimize_stats provide explicit compression and routed-result caching. They do not intercept or cache the primary conversation turn without a proxy. See Three Surfaces →

Profile exposure: The active SLM_MCP_PROFILE determines which tools are visible to the connected client. Core tools are in every profile. Code-graph tools require code, full, or power. Mesh tools require full, power, or mesh. See MCP Profiles → and docs/profiles.md.

Connecting

SLM supports two transports — both expose the exact same tools.

HTTP (v3.6.7+, recommended): one shared daemon process, flat RAM.

{ "mcpServers": { "superlocalmemory": { "type": "http", "url": "http://127.0.0.1:8765/mcp/" } } }

stdio (universal fallback): one subprocess per connection.

{ "mcpServers": { "superlocalmemory": { "command": "slm", "args": ["mcp"] } } }

See docs/ide-setup.md for per-IDE configs and the mcp-remote bridge option for stdio-only tools.


Core Tools

remember

Store a new memory.

ParameterTypeRequiredDescription
contentstringYesThe text to remember
tagsstringNoComma-separated tags
projectstringNoProject classification
importanceintegerNoImportance hint (default: 5)
session_idstringNoSession attribution and stable retry input
agent_idstringNoCalling-agent attribution
scopestringNopersonal, shared, or global
shared_withstringNoComma-separated profile IDs for shared scope
idempotency_keystringNoStable identity for safe retries

The result is a durable receipt containing operation_id, fact_ids, materialization_state, and pending. A daemon-backed default call normally returns after the SQLite relational/FTS projection is queryable; enrichment continues on the same operation. The offline compatibility spool preserves the same source and idempotency identity when it is replayed.

recall

Search memories by natural language query.

ParameterTypeRequiredDescription
querystringYesNatural language search query
limitnumberNoMax results (default: 20)

Recall results follow Score Contract v2: relevance_score is query relevance, ranking_score is diagnostic ranking utility, and memory_confidence belongs to the stored assertion. Canonical responses declare calibration_status: "uncalibrated" and answer_confidence: null; retrieval scores are not answer probabilities.

Search memories with filters. More control than recall.

ParameterTypeRequiredDescription
querystringYesSearch query
limitnumberNoMax results (default: 10)
tagsstringNoFilter by tags
beforestringNoFilter by date (ISO format)
afterstringNoFilter by date (ISO format)

fetch

Retrieve a specific memory by ID.

ParameterTypeRequiredDescription
idnumberYesMemory ID

list_recent

List the most recently stored memories.

ParameterTypeRequiredDescription
limitnumberNoMax results (default: 20)

get_status

Returns system status: mode, profile, memory count, health, database path.

No parameters.

build_graph

Rebuild the entity relationship graph from stored memories. Useful after bulk imports.

No parameters.

switch_profile

Switch to a different memory profile.

ParameterTypeRequiredDescription
profilestringYesProfile name to switch to

backup_status

Check the status of automatic backups.

No parameters.

memory_used

Return memory usage statistics: total memories, database size, per-profile counts.

No parameters.

get_learned_patterns

Return patterns the system has learned from your usage (e.g., preferred technologies, coding conventions).

ParameterTypeRequiredDescription
limitnumberNoMax patterns to return (default: 10)

correct_pattern

Correct a learned pattern that is wrong or outdated.

ParameterTypeRequiredDescription
pattern_idnumberYesID of the pattern to correct
correctionstringYesThe corrected pattern text

get_attribution

Return system attribution metadata — product name, author, organization, license, and URLs.

No parameters.

Returns: {success, product, author, organization, license, urls:{product, author, organization}}

forget

Run Ebbinghaus forgetting decay cycle. Computes retention scores and transitions memories between lifecycle zones (active → warm → cold → archive → forgotten) based on access patterns and importance. Run with dry_run=true first to preview changes.

ParameterTypeRequiredDescription
profile_idstringNoProfile to process (default: active profile)
dry_runbooleanNoIf true, compute stats but do not apply transitions (default: true)

delete_memory

Delete a specific memory by exact fact ID. All deletions are logged with agent_id for audit.

ParameterTypeRequiredDescription
fact_idstringYesExact fact ID to delete (from recall or list_recent)
agent_idstringNoCalling-agent identifier for audit log

update_memory

Update the content of a specific memory by exact fact ID. The fact must belong to the active profile.

ParameterTypeRequiredDescription
fact_idstringYesExact fact ID to update
contentstringYesNew content (cannot be empty)
agent_idstringNoCalling-agent identifier for audit log

Active Memory Tools (V3.1)

Three tools for automatic context injection and learning. Call session_init once at the start of every session.

session_init

Initialize session context from stored memories. Returns relevant memories for the project path or query, plus current learning status.

ParameterTypeRequiredDescription
project_pathstringNoWorking directory path — used to derive the search query
querystringNoOverride the search query (overrides project_path when set)
max_resultsnumberNoMaximum memories to return (default: 10)
max_age_daysnumberNoSuppress memories older than N days unless relevance ≥ 0.70 (default: 30; set to 0 to disable)

observe

Send conversation content for automatic memory capture. The system evaluates whether the content contains decisions, bug fixes, or preferences worth storing and captures them when confidence > 0.5.

ParameterTypeRequiredDescription
contentstringYesConversation snippet to evaluate
agent_idstringNoCalling-agent attribution (defaults to SLM_AGENT_ID env var)

report_feedback

Report whether a recalled memory was useful. Trains the adaptive ranker over time.

ParameterTypeRequiredDescription
fact_idstringYesID of the recalled memory
feedbackstringNo"relevant", "irrelevant", or "partial" (default: "relevant")
querystringNoThe original query that surfaced this memory

close_session

Close the current session and create temporal summary events. Aggregates session facts into per-entity summaries.

ParameterTypeRequiredDescription
session_idstringNoSession to close (default: most recent session)

V2.8 Tools

report_outcome

Report the outcome of using a memory (was it helpful?). Feeds the learning system.

ParameterTypeRequiredDescription
memory_idnumberYesID of the memory used
outcomestringYes"helpful", "wrong", or "outdated"
contextstringNoAdditional context about the outcome

get_lifecycle_status

Return lifecycle status for memories (Active, Warm, Cold, Archived).

ParameterTypeRequiredDescription
limitnumberNoMax results (default: 20)
statusstringNoFilter by lifecycle stage

set_retention_policy

Apply a retention policy to the current profile.

ParameterTypeRequiredDescription
policystringYesPolicy name: "indefinite", "gdpr-30d", "hipaa-7y", or "custom"
daysnumberNoDays for custom policy

compact_memories

Merge redundant memories and optimize storage.

No parameters.

get_behavioral_patterns

Return behavioral patterns observed across your usage (e.g., you always check docs before coding).

ParameterTypeRequiredDescription
limitnumberNoMax patterns to return (default: 10)

audit_trail

Return audit log entries. Each entry is hash-chained for tamper detection.

ParameterTypeRequiredDescription
limitnumberNoMax entries (default: 50)
actionstringNoFilter by action type: "store", "recall", "delete"

V3 Tools

set_mode

Switch the operating mode.

ParameterTypeRequiredDescription
modestringYes"a", "b", or "c"

get_mode

Return the current operating mode and its configuration.

No parameters.

health

Return health diagnostics for mathematical layers (Fisher-Rao, Sheaf, Langevin), embedding model, and database.

No parameters.

consistency_check

Run contradiction detection across stored memories. Returns pairs of memories that may conflict.

No parameters.

recall_trace

Recall with a full breakdown of how each retrieval channel scored each result.

ParameterTypeRequiredDescription
querystringYesSearch query
limitnumberNoMax results (default: 10)

V3 Utility Tools

get_version

Return the installed SLM version and build information.

No parameters.

Returns: {success, version, build_info}

prestage_context

Pre-stage a recall query so the result is immediately available when recall or session_init is called next. Reduces perceived latency for known upcoming queries.

ParameterTypeRequiredDescription
querystringYesQuery to pre-stage
max_resultsintegerNoMaximum results to warm (default: 10)

get_retention_stats

Return retention statistics for the active profile: memory counts by lifecycle zone (active/warm/cold/archived) and current retention policy.

ParameterTypeRequiredDescription
profile_idstringNoProfile to query (default: active profile)

consolidate_cognitive

Run the CCQ cognitive consolidation pipeline. Identifies redundant or contradictory memories and proposes consolidations. Does not apply changes unless dry_run=false.

ParameterTypeRequiredDescription
profile_idstringNoProfile to consolidate (default: active profile)
dry_runbooleanNoIf true, propose without applying (default: true)

get_soft_prompts

Return the auto-learned soft prompts for the active profile. Soft prompts capture recurring patterns and preferences observed across sessions.

ParameterTypeRequiredDescription
profile_idstringNoProfile to query (default: active profile)
limitintegerNoMax results (default: 20)

reap_processes

Find and optionally terminate orphaned SLM daemon or MCP processes. Safe to call from inside an agent: uses process metadata to identify orphans rather than killing all matching processes.

ParameterTypeRequiredDescription
forcebooleanNoIf true, terminate found orphans (default: false — dry run)

Code-Graph Tools

Available in profiles code (24 tools), full (42 tools), and power (54 tools). Not available in core or mesh profiles.

These tools build and query a structural code graph over a local repository. The graph maps functions, classes, modules, call sites, imports, and dependencies. It is built on demand from the repository path and persisted in SLM's database.

build_code_graph

Build or rebuild the code graph for a repository.

ParameterTypeRequiredDescription
repo_pathstringYesAbsolute path to the repository root
include_patternsstringNoGlob patterns to include (default: **/*.py,**/*.ts,**/*.js)
changed_filesarrayNoIf set, incremental update for only these files

update_code_graph

Incrementally update the code graph for changed files without a full rebuild.

ParameterTypeRequiredDescription
repo_pathstringYesRepository root
changed_filesarrayYesList of changed file paths (relative to repo root)

get_blast_radius

Given a symbol (function, class, or module), return all code that would be affected by changing it — direct callers, transitive dependents, and reachable test files.

ParameterTypeRequiredDescription
targetstringYesSymbol name or file path
depthintegerNoMaximum traversal depth (default: 3)

get_review_context

Return the code-graph context relevant to a code review: callers, callees, related tests, and recent change history for the changed symbols.

ParameterTypeRequiredDescription
changed_filesarrayYesFiles changed in the review
repo_pathstringYesRepository root

query_graph

Query the code graph with a free-form description or a structural predicate.

ParameterTypeRequiredDescription
querystringYesNatural language or structural query
limitintegerNoMax results (default: 20)

semantic_search_code

Semantic search across code symbols using the same embedding model as memory recall.

ParameterTypeRequiredDescription
querystringYesNatural language description of the code to find
limitintegerNoMax results (default: 10)

list_graph_stats

Return summary statistics for the built code graph: node counts by type, edge counts, last build time.

No parameters.

find_large_functions

Return functions or methods exceeding a size threshold.

ParameterTypeRequiredDescription
min_linesintegerNoMinimum line count (default: 50)
limitintegerNoMax results (default: 20)

detect_changes

Compare the current on-disk state of files against the last-built graph and report which symbols have changed, been added, or been removed.

ParameterTypeRequiredDescription
repo_pathstringYesRepository root
filesarrayNoSpecific files to check (default: all tracked)

get_architecture_overview

Return a high-level summary of the repository's module structure, dependency layers, and largest components.

No parameters.

list_flows / get_flow / get_affected_flows

Inspect call flows through the codebase.

ToolDescription
list_flowsList all named or detected flows in the graph
get_flow(name)Return the full call chain for a named flow
get_affected_flows(target)Return flows that pass through a given symbol

list_communities / get_community

Inspect logical module communities detected by graph clustering.

ToolDescription
list_communitiesList detected communities with size and cohesion score
get_community(id)Return members and edges for a specific community

Search memory facts that are linked to specific code symbols or file paths.

ParameterTypeRequiredDescription
querystringYesQuery (may include symbol names)
limitintegerNoMax results (default: 10)

code_entity_history

Return the memory history for a code entity: all decisions, bugs, and observations linked to a given symbol.

ParameterTypeRequiredDescription
targetstringYesSymbol name or file path

Explicitly link a stored memory to a code symbol. Strengthens code-memory retrieval for that symbol.

ParameterTypeRequiredDescription
fact_idstringYesMemory fact ID to link
targetstringYesSymbol name or file path to link to

enrich_blast_radius

Enrich a blast-radius result with relevant memories: decisions, known bugs, and past observations about the affected symbols.

ParameterTypeRequiredDescription
targetstringYesSymbol to analyze
depthintegerNoTraversal depth (default: 3)

code_stale_check

Check whether stored memories about a symbol are stale relative to recent code changes.

ParameterTypeRequiredDescription
targetstringYesSymbol or file path to check

refactor_preview / apply_refactor

Preview or apply a code refactor using graph-aware rename and dependency tracking.

ToolKey ParametersDescription
refactor_previewtarget, new_name, repo_pathShow all rename sites and impact before applying
apply_refactortarget, new_name, repo_pathApply the rename across the graph (writes files)

apply_refactor writes files. Review the refactor_preview output before applying.


Resources

MCP resources provide read-only data that AI assistants can access passively.

Resource URIDescription
slm://contextActive session context auto-injected on MCP connect. Returns relevant memories + learning status.
slm://recentThe 20 most recently stored memories
slm://statsMemory count, database size, mode, profile
slm://clustersTopic clusters detected across memories
slm://identityLearned user preferences and patterns
slm://learningCurrent state of the adaptive learning system
slm://engagementUsage statistics and interaction patterns

Optimize Tools (v3.6.11 — Surface B)

Proxy-free compression and routed-result caching. All five are fail-open — any internal error returns ok:False with the original content unchanged.

slm_compress

Compress text or tool output to reduce context window usage.

ParameterTypeDefaultDescription
contentstringrequiredText to compress (max 1MB)
modestring"auto""normalize" (lossless whitespace) · "auto" · "aggressive"
reversiblebooleantrueIf lossy, store original in CCR and return ccr_id
ttl_secondsinteger86400CCR original lifetime (seconds)

Returns: {ok, compressed, strategy, tokens_before, tokens_after, ratio, lossy, ccr_id, note}

slm_retrieve

Recover the exact original bytes stored during a lossy slm_compress call.

ParameterTypeDescription
ccr_idstringUUID4 returned by slm_compress when reversible=True

Returns: {ok, content, size_bytes, error}

slm_cache_set

Cache a string result the agent wants to reuse (file reads, bash output, search results, sub-model calls). Does not cache the Claude conversation turn.

ParameterTypeDefaultDescription
keystringrequiredCache key (max 512 chars, namespaced per agent)
valuestringrequiredValue to store (max 1MB)
ttl_secondsinteger86400Time-to-live in seconds

Returns: {ok, stored, note}

slm_cache_get

Retrieve a previously cached result.

ParameterTypeDescription
keystringSame key used in slm_cache_set

Returns: {ok, hit, value, note}

slm_optimize_stats

Return compression and cache statistics for the current session.

No parameters.

Returns: {ok, compress_runs, tokens_saved_compress, cache_proxy_hits, cache_proxy_misses, cache_kv_hits, cache_kv_misses, ccr_note, note}

Note: Proxy stats are daemon-persisted (accurate across restarts). KV stats (cache_kv_hits, cache_kv_misses) are in-module counters for this MCP process session only.


Bounded-Loop Tools (v3.8.0)

Available in the default exposure and in the code, full, and power profiles. Bounded loops ship on three surfaces — the slm loop CLI, the /slm-loop command, and these MCP tools — all driving the same engine and the same durable ledger.

A bounded loop finishes only when an independent gate passes, never when the agent claims it is done. Over MCP the gate is an SLM recall: the loop converges the first lap a memory matching the gate query becomes retrievable with confidence. This makes it a safe, shell-free coordination primitive — one agent can wait, under strict bounds, for a memory another agent will write.

slm_loop_run

Run one bounded, gate-verified loop to a terminal outcome. Blocks (polling the gate every poll_interval_s) until the gate passes or a bound trips. Every lap is persisted to SLM memory (tag loop:<name>) and shows on the dashboard.

ParameterTypeRequiredDescription
namestringYesLoop name and memory tag (1–128 chars).
gate_querystringYesRecall query the independent gate checks each lap.
gate_min_scorenumberNoMinimum top-result score to pass (default 0.0 = any confident hit).
max_iterationsintegerNoHard cap on laps (default 20, max 200).
max_wallclock_snumberNoWall-clock ceiling in seconds (default 15, max 120; 0 disables).
poll_interval_snumberNoSeconds between laps (default 1.0, minimum 0.25).
max_tokensintegerNoToken budget (default 0 = disabled).
no_progress_windowintegerNoHalt after this many consecutive no-change laps (default 0 = disabled).

Returns: {ok, status, reason, passed, laps, run_id, ledger:[{lap, decision, passed, detail}], note} where status is one of DONE / HALT / PAUSE / KILLED / ERROR.

slm_loop_history

List recorded loop runs for a loop name (read-only).

ParameterTypeRequiredDescription
namestringYesLoop name to list runs for.
limitintegerNoMaximum runs to return (default 20, max 200).

Returns: {ok, name, count, runs:[{run_id, laps, final, ts}]}

slm_loop_show

Show every lap of one run, in order (read-only).

ParameterTypeRequiredDescription
run_idstringYesRun identifier returned by slm_loop_run.
limitintegerNoMaximum laps to return (default 200, max 1000).

Returns: {ok, run_id, count, laps:[{lap, ts, decision, passed, detail, agent_claimed_done, tokens}]}

The agent's own agent_claimed_done flag is recorded on each lap for audit but never terminates the loop — only the independent gate can.


SuperLocalMemory V3 — Copyright 2026 Varun Pratap Bhardwaj. AGPL-3.0-or-later. Part of Qualixar.