Skip to content

MCP Tools

engram exposes its memory API as Model Context Protocol (MCP) tools. All tools require an active MCP session. When OIDC is enabled, every call must carry a valid bearer token; the verified identity becomes the actor and owner of any records created.

ToolPurpose
store_memoryPersist a deliberate, well-formed memory
search_memorySemantic search within a scope
list_memoryMost-recent memories in a scope (no query — session bootstrap)
get_memoryFetch one memory by id
update_memoryReplace a memory’s content in place (re-embeds)
delete_memoryDelete one memory by id
delete_allDelete your own memories in a scope (teardown)
store_discoveryCache citation-backed codebase understanding
search_discoverySemantic search over the discovery pool
set_visibilityShare or unshare a memory you own

actor and owner are always server-set. They come from the validated OIDC token and are never accepted as client input.


Persist a deliberate, well-formed memory. Do not store transient state, secrets, or timestamps.

ArgumentTypeRequiredDescription
contentstringyesThe memory text to persist
scopestringyesrun:tier:repo identifier, e.g. eval-2026-05:project:selfhosted-cluster
sourcestringyesuser-said or agent-inferred
categorystringyesdecision, preference, convention, or gotcha
tagsstring[]noFree-form labels
repostringnoRepository name or URL
workspacestringnoWorkspace identifier
worktree_pathstringnoPath to the git worktree
base_dirstringnoBase directory for the project

Returns the stored record’s id.


Semantic (vector) search within a scope. Embeds query and returns the nearest memories.

ArgumentTypeRequiredDescription
querystringyesNatural-language search query
scopestringyesScope to search within
kuint64noNumber of results to return (default 8)

Returns a list of matching memory records.


List recent memories in a scope without a query. Intended for session-start bootstrap. Results are most-recent first.

ArgumentTypeRequiredDescription
scopestringyesThe scope to list memories from
limituint64noMaximum memories to return (default 20)

Returns a list of memory records.


Fetch one memory by id.

ArgumentTypeRequiredDescription
idstringyesThe UUID of the memory to fetch

Returns the full memory record. Authenticated callers can read their own records plus any shared records. Anonymous callers can only read ownerless records.


Replace a memory’s content in place. The content is re-embedded. Optionally toggle visibility.

ArgumentTypeRequiredDescription
idstringyesThe UUID of the memory to update
contentstringyesThe replacement text (re-embedded)
sharedboolnotrue = shared, false = private; omit to keep current visibility

Only the record owner can update. Returns "updated" on success.


Delete one memory by id.

ArgumentTypeRequiredDescription
idstringyesThe UUID of the memory to delete

Only the record owner can delete. Returns "deleted" on success.


Delete your own memories in a scope (teardown). Never deletes another caller’s records.

ArgumentTypeRequiredDescription
scopestringyesThe scope to clear

Returns "scope cleared" on success.


Cache agent-earned codebase understanding with source citations. Discoveries live in a separate discovery:repo:* scope and are recalled on demand, never at session start.

ArgumentTypeRequiredDescription
contentstringyesThe understanding to cache (embedded and searched); max 64 KiB
kindstringyesmap (orientation/structure) or fact (pinned checkable claim)
citationscitation[]yesAt least one source anchor (max 50)
scopestringyesMust start with discovery:, e.g. discovery:repo:my-repo
tagsstring[]noFree-form labels
summarystringnoShort human-readable summary
idstringnoOmit to create; supply to replace in place

Each citation object:

FieldTypeRequiredDescription
kindstringyesfile, commit, url, or repo
refstringyesPath, repo URL, or doc URL
locatorstringnoE.g. 200-240 line range
pinstringnoCommit SHA, content-hash, @rev, or fetched-at (aging anchor)
excerptstringnoCached substance (max 16 KiB, soft cap ~50 lines)

The source field is always agent-inferred and category is always discovery — both are server-set; do not supply them.

Returns the stored discovery’s id.


Semantic search over the discovery pool. Scope is required unless cross_spine=true.

ArgumentTypeRequiredDescription
querystringyesNatural-language search query
scopestringconditionalDiscovery scope; required unless cross_spine is true
kindstringnomap or fact filter
kuint64noNumber of results to return (default 8)
cross_spineboolnoSpan all discovery scopes; ignores scope when true

Results carry citations and created_at (useful as aging signals).


Share or unshare a memory you own. Does not re-embed; only flips the visibility flag.

ArgumentTypeRequiredDescription
idstringyesThe UUID of the memory
sharedboolyestrue = readable by any authenticated caller; false = private

Only the record owner can change visibility. Sharing grants read, never write. Returns "visibility updated" on success.