Skip to main content
Glama

ctxstore — memory that follows you across models

Set up or restore memory account

setup_account

Set up or restore your persistent memory connection.

Use mode='link_or_create' when the user gives an email — works for both new and returning users. The server figures out which case applies:

  • If the email exists: sends OTP, attaches this device to the existing account

  • If the email is new: creates a fresh tenant, sends OTP to verify

Either path produces one clean account, no duplicates, no orphans.

Call setup_account(mode='link_or_create', email='their@email.com'). Then ask the user for the 6-digit code from their email and call setup_account(mode='verify', code='123456', email='their@email.com'). Passing email= on verify is required — session IDs rotate between requests on some clients.

mode='restore': use when the user provides an emk_* API key directly.

mode='reveal_key': echo the full emk_* API key. Works directly on an ALREADY-authenticated session; if the session isn't bound (some clients rotate or omit session ids between requests, so this can happen right after a successful verify), pass email= to receive a 6-digit code, then call again with email= and code= — the same rotation-proof lookup as mode='verify'. Success responses only show a key fingerprint (first 8 chars + last 4) — call this mode only when the user actually needs the full key, e.g. to persist it as 'Authorization: Bearer ' in an MCP connector config. Callers who prove neither a bound session nor email ownership are refused.

If no email yet, ask: 'What email should I use for your memory account?'

After setup completes, call search_facts as the first action to load prior context.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "mode": "<mode>"
    },
    "name": "setup_account"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeNo6-digit verification code from email (required for mode='verify').
modeYes'link_or_create' = primary path — user provides email, server handles new vs returning. 'verify' = OTP confirmation step after link_or_create (pass email= and code=). 'restore' = user has emk_* API key from a prior session. 'link_email' = add email to an existing anonymous session. 'reveal_key' = echo the full API key (bound session, or email= + code= to verify by emailed OTP; responses otherwise show only a fingerprint).
emailNoEmail address. Required for mode='link_or_create'. Also pass on mode='verify' — required when session state is lost (common in claude.ai chat due to session ID rotation).
api_keyNoAPI key from a previous session (required for mode='restore')
agent_idNoOptional: bind a sticky agent identity (e.g. 'emily_code_4.7') in the same call. Equivalent to calling bind_agent immediately after a successful setup. Persists to mcp_sessions.agent_id (migration 0008). wake_status and load_context will default to this agent_id when called without an explicit agent_id= arg. Per-call override still works.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare the safety profile (readOnlyHint=false, destructiveHint=false, idempotentHint=false, openWorldHint=true), and the description adds substantial behavior on top: OTP emails are sent, the server resolves new-vs-returning, sessions can rotate between requests, unbound callers are refused, and reveal_key responses normally show only a fingerprint. The only gap is that it doesn't say what the success response contains beyond the key-fingerprint note.

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 primary path and organized by mode, so scanning is easy. There is some redundancy — the session-ID rotation caveat is restated in both the verify and reveal_key sections — which costs a little tightness on an otherwise well-structured description.

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

Completeness5/5

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

For a multi-step, stateful setup flow with no output schema and five parameters, the description supplies the call sequence, the inter-call dependency on email=, the failure/refusal conditions for reveal_key, and the required post-setup action. An agent could execute the flow correctly from this text alone.

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 100%, so a baseline of 3 applies, but the description adds real operational meaning the schema does not: email= must be repeated on verify because session IDs rotate on some clients, and the two-step code flow is spelled out. agent_id is covered only by the schema, which keeps this from a 5.

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?

States a specific verb and resource ('Set up or restore your persistent memory connection') and then enumerates the modes, each tied to a distinct user situation. An agent can tell this apart from bind_agent, accept_invite, or restore-style siblings without opening the schema.

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

Usage Guidelines5/5

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

Gives explicit branching guidance: mode='link_or_create' when the user supplies an email, mode='restore' when they supply an emk_* key, mode='reveal_key' only when the full key is actually needed. It also includes a fallback script for the missing-email case and prescribes the follow-up call to search_facts after setup.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.