Skip to main content
Glama

read_memory

Retrieve stored data from persistent memory using exact keys to access agent-specific information. This tool enables reading previously saved content for continuity in AI agent operations.

Instructions

Read a persistent memory by exact key. Cost: $0.001 USDC. Service: memex.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agent_idYes
keyYes

Implementation Reference

  • The codebase implements a dynamic MCP server that fetches available tools (including potentially 'read_memory') from a remote registry at runtime. The execution logic for any tool is handled by this generic CallToolRequestSchema handler, which identifies the tool by name and invokes it via the `callTool` helper.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: args } = request.params;
    
      let registry: Registry;
      try {
        registry = await fetchRegistry();
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({ error: "Failed to fetch tool registry", detail: String(error) }),
            },
          ],
        };
      }
    
      const tool = registry.tools.find((t) => t.name === name);
      if (!tool) {
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({
                error: `Tool '${name}' not found`,
                available_tools: registry.tools.map((t) => t.name),
              }),
            },
          ],
        };
      }
    
      try {
        const result = await callTool(tool, args as Record<string, unknown>);
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(result, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({
                error: "Tool call failed",
                tool: name,
                service: tool.service,
                detail: String(error),
              }),
            },
          ],
        };
      }
    });
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses cost ('$0.001 USDC') and service ('memex'), which are useful behavioral traits. However, it lacks details on permissions, rate limits, error handling, or what 'persistent memory' entails. The description doesn't contradict annotations, but could provide more operational context.

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?

Extremely concise and front-loaded: the first sentence states the core purpose, followed by cost and service details. Every sentence earns its place with no wasted words, making it easy to scan and understand quickly.

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

Completeness2/5

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

Given 2 parameters with 0% schema coverage, no annotations, and no output schema, the description is incomplete. It covers basic purpose and cost but misses parameter meanings, return format, error conditions, and operational constraints. For a tool with persistent storage implications, more context is needed.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate. It mentions 'key' but not 'agent_id', leaving half the parameters unexplained. No details on key format, agent_id purpose, or constraints. The description adds minimal value beyond the bare schema.

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

Purpose4/5

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

The description clearly states the verb ('Read') and resource ('persistent memory'), with the specific constraint 'by exact key'. It distinguishes from sibling 'search_memory' by implying exact vs. fuzzy matching, though not explicitly named. However, it doesn't fully differentiate from all siblings, as other tools like 'analyze_call' or 'verify_claim' are unrelated.

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

Usage Guidelines2/5

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

No explicit guidance on when to use this tool versus alternatives. The description implies it's for reading by exact key, but doesn't specify when to choose 'read_memory' over 'search_memory' or other data retrieval tools. No mention of prerequisites, exclusions, or typical use cases.

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/yantrix-ai/yantrix-mcp'

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