Skip to main content
Glama

memory

Manage per-user and per-agent stored context and config: list, add, edit, pin, delete, or assign entries, and read or write an agent profile's configuration.

Instructions

Per-user memory + per-agent memory_config (mirrors /admin/memory). action: get_config (agent_kind -> the active profile's memory_config, defaults-merged) | set_config (agent_kind, config: a nested memory_config dict — same shape agent_profiles.memory_config stores; unlike the HTML form this skips the checkbox/flat-field parsing layer since a tool call already supplies structured JSON) | list (agent_kind, user_id: uuid or email -> that user's ai_user_memory rows) | add (user_id: uuid or email, content, agent_kind; business_id where the build's plugin has businesses) | assign (memory_id, agent_kind=custom: — move a custom-kind memory that belongs to no agent yet to that agent) | edit (memory_id, content — re-embeds via the same embedder the runtime uses; proceeds without an embedding if the embed call fails, same as the handler) | pin (memory_id, pinned=true/false) | delete (memory_id, confirm=true — soft-archive, status='archived').

Each generic agent keeps its own memories: pass agent_kind
`custom:<slug>` (the value the Memory screen's picker uses) to list or
add one agent's. `list` for such an agent also returns
`unassigned_memories`: the user's custom-kind rows saved before memories
were kept per agent, which no agent recalls until assigned.

get_config/set_config target "the active profile for agent_kind in env"
by default. Pass `profile_id` to read/write one SPECIFIC profile's
memory_config instead — a draft, a fork, or a voice specialist (the
voice brain's memory_config lives on the specialist row, which the
agent_kind lookup never reaches). list returns at most `limit`
memories (default 50).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "memory"
  }
}

Input Schema

NameRequiredDescriptionDefault
envNoConfig branch: which `environment` rows of the AI config DB to read/write. staging = the editable working set (default); prod = what production serves.staging
limitNolist: maximum memories to return (1-200).
actionNoOperation to run: get_config | set_config | list | add | edit | pin | delete | assign. The tool description lists what each action needs.list
configNoset_config: the nested memory_config dict.
pinnedNotrue = pin, false = unpin.
confirmNofalse (default) = dry run, nothing changes; true = execute.
contentNoMemory text (add/edit).
user_idNoUser id (`user.id` of the portal's user table; memory also accepts an email).
memory_idNoai_user_memory row UUID.
agent_kindNoAgent whose memory/config to use: a kind, or `custom:<slug>` for one custom agent (each keeps its own memories).custom
profile_idNoAgent profile UUID (list_profiles / get_profile).
business_idNoadd: tenant id the memory belongs to, where the build's plugin has tenants (optional).

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does so well: delete is disclosed as a soft-archive (status='archived'), edit re-embeds with the runtime embedder and proceeds without one on failure, get_config is defaults-merged, and list has a default cap. These are the non-obvious side effects an agent must know before mutating memories.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the resource statement followed by a compact action→parameter map that is genuinely useful despite overlapping the enum. A few clauses merely restate schema text (limit default 50, confirm=true), and the run-on parenthetical style makes it denser than necessary.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 12-parameter multiplexed tool with an output schema, it covers action selection, defaults, per-agent scoping, pre-existing unassigned rows, and failure behavior on embed. It omits auth/permission requirements and error modes other than embedding failure, which are the remaining gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 100%, so the baseline is 3; the description still adds meaning the schema lacks — that user_id accepts an email, that agent_kind takes `custom:<slug>` in the picker's format, that profile_id selects a specific profile row, and that business_id is conditional on the build's plugin. Some parameters (env, limit) are only echoed rather than enriched.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific resource statement ('Per-user memory + per-agent memory_config') and then enumerates every action with its verb and required inputs, so an agent knows exactly what each call does. It even clarifies scope boundaries like the profile_id path reaching specialist rows that the agent_kind lookup cannot.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit routing guidance among the tool's own actions: profile_id for a draft/fork/voice specialist, agent_kind `custom:<slug>` for per-agent memories, and the meaning of list's `unassigned_memories`. It does not contrast the tool with sibling admin tools, so it stops short of full when/when-not coverage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.