memory_list
List all stored memory keys for an agent to inspect prior stored data or verify key existence before retrieval. Returns a JSON-formatted list of keys.
Instructions
List all stored memory keys for a given agent.
Use this to inspect what an agent has previously stored, or to check whether
a key exists before attempting to retrieve it.
Cost: Free.
Returns: JSON-formatted list of all keys stored under the given agent_id.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent_id | Yes | The agent identifier to list memory keys for. Returns all keys that have been stored under this agent_id. Use this before memory_get to discover available keys. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- server.py:125-142 (handler)MCP tool handler for 'memory_list'. Decorated with @mcp.tool(), it accepts an agent_id parameter, makes an HTTP POST to /memory/list, and returns the JSON response as a string.
@mcp.tool() def memory_list( agent_id: Annotated[str, Field(description="The agent identifier to list memory keys for. Returns all keys that have been stored under this agent_id. Use this before memory_get to discover available keys.")], ) -> str: """ List all stored memory keys for a given agent. Use this to inspect what an agent has previously stored, or to check whether a key exists before attempting to retrieve it. Cost: Free. Returns: JSON-formatted list of all keys stored under the given agent_id. """ r = httpx.post(f"{API_BASE}/memory/list", json={"agent_id": agent_id}, headers=HEADERS, timeout=30) r.raise_for_status() return str(r.json()) - server.py:127-128 (schema)Input schema for the memory_list tool: agent_id is an annotated string with pydantic Field describing its purpose.
agent_id: Annotated[str, Field(description="The agent identifier to list memory keys for. Returns all keys that have been stored under this agent_id. Use this before memory_get to discover available keys.")], ) -> str: