Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
agent_idYesThe 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

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • 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())
  • 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:
Behavior4/5

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

No annotations, so description carries full burden. States cost ('Free') and return format ('JSON-formatted list'). As a read operation, no side effects need disclosure. Additional behavioral details (e.g., performance, limits) not needed for this simple tool.

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

Conciseness5/5

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

Three sentences, each earning its place: purpose, usage hint, cost and return type. No fluff, well-structured.

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?

Output schema exists, so return details are covered. Description mentions JSON list format. Missing potential error info or pagination, but for a simple listing tool, it's sufficient.

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 description coverage is 100% for the only parameter (agent_id). The description adds value by advising to use this tool before memory_get, which is not in schema.

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?

Clear verb+resource: 'List all stored memory keys for a given agent.' Distinguishes from siblings memory_get and memory_store by focusing on listing keys only.

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?

Explicit usage scenarios: inspect stored keys or check key existence before retrieval. Lacks explicit when-not-to-use, but adequately guides selection among siblings.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/babyblueviper1/invinoveritas'

If you have feedback or need assistance with the MCP directory API, please join our Discord server