Skip to main content
Glama

agentbay_memory_store

Store memories with a full write pipeline: poison detection, dedup, embedding, persist. Control lifetime by setting memory tier (working, episodic, semantic, procedural).

Instructions

Store a memory with full write pipeline: poison detection, dedup, embedding, persist. Set tier to control lifetime.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject ID
titleYesShort descriptive title
contentYesFull content of the memory
typeYes
tierNoMemory tier (default: semantic)
tagsNo
aliasesNoSearch phrases that should map to this entry
confidenceNo
sourceNoWho created this
sourceAgentNoAgent name that created this memory
ttlHoursNoOverride TTL for working-tier (default 24h)
filePathsNo

Implementation Reference

  • src/index.ts:654-685 (registration)
    Registration of the 'agentbay_memory_store' tool on the MCP server via server.tool()
    server.tool(
      'agentbay_memory_store',
      'Store a memory with full write pipeline: poison detection, dedup, embedding, persist. Set tier to control lifetime.',
      {
        projectId: z.string().describe('Project ID'),
        title: z.string().describe('Short descriptive title'),
        content: z.string().describe('Full content of the memory'),
        type: z.enum(['PATTERN', 'PITFALL', 'ARCHITECTURE', 'DEPENDENCY', 'TEST_INSIGHT', 'PERFORMANCE', 'DECISION', 'CONTEXT']),
        tier: z.enum(['working', 'episodic', 'semantic', 'procedural']).optional().describe('Memory tier (default: semantic)'),
        tags: z.array(z.string()).optional(),
        aliases: z.array(z.string()).optional().describe('Search phrases that should map to this entry'),
        confidence: z.number().min(0).max(1).optional(),
        source: z.string().optional().describe('Who created this'),
        sourceAgent: z.string().optional().describe('Agent name that created this memory'),
        ttlHours: z.number().optional().describe('Override TTL for working-tier (default 24h)'),
        filePaths: z.array(z.string()).optional(),
      },
      async ({ projectId, title, content, type, tier, tags, aliases, confidence, source, sourceAgent, ttlHours, filePaths }) => {
        const data = await apiPost(`/api/v1/projects/${projectId}/memory`, {
          title, content, type, tier, tags, aliases, confidence, source, sourceAgent, ttlHours, filePaths,
        });
        if (data.error) return { content: [{ type: 'text' as const, text: `Error: ${data.error}` }] };
        if (data.poisonBlocked) return { content: [{ type: 'text' as const, text: `Blocked: Content failed poison detection.` }] };
    
        let text = data.deduplicated
          ? `Updated existing memory: ${data.id} (deduplication matched)`
          : `Stored new memory: ${data.id}`;
        text += ` | ${data.tokenCount} tokens`;
        if (data.conflictIds?.length) text += `\nPotential conflicts with: ${data.conflictIds.join(', ')}`;
        return { content: [{ type: 'text' as const, text }] };
      }
    );
  • Zod schema defining all input parameters for agentbay_memory_store: projectId, title, content, type, tier, tags, aliases, confidence, source, sourceAgent, ttlHours, filePaths
    {
      projectId: z.string().describe('Project ID'),
      title: z.string().describe('Short descriptive title'),
      content: z.string().describe('Full content of the memory'),
      type: z.enum(['PATTERN', 'PITFALL', 'ARCHITECTURE', 'DEPENDENCY', 'TEST_INSIGHT', 'PERFORMANCE', 'DECISION', 'CONTEXT']),
      tier: z.enum(['working', 'episodic', 'semantic', 'procedural']).optional().describe('Memory tier (default: semantic)'),
      tags: z.array(z.string()).optional(),
      aliases: z.array(z.string()).optional().describe('Search phrases that should map to this entry'),
      confidence: z.number().min(0).max(1).optional(),
      source: z.string().optional().describe('Who created this'),
      sourceAgent: z.string().optional().describe('Agent name that created this memory'),
      ttlHours: z.number().optional().describe('Override TTL for working-tier (default 24h)'),
      filePaths: z.array(z.string()).optional(),
    },
  • Handler function that POSTs to /api/v1/projects/{projectId}/memory and returns result (dedup, poison detection, token count, conflicts)
      async ({ projectId, title, content, type, tier, tags, aliases, confidence, source, sourceAgent, ttlHours, filePaths }) => {
        const data = await apiPost(`/api/v1/projects/${projectId}/memory`, {
          title, content, type, tier, tags, aliases, confidence, source, sourceAgent, ttlHours, filePaths,
        });
        if (data.error) return { content: [{ type: 'text' as const, text: `Error: ${data.error}` }] };
        if (data.poisonBlocked) return { content: [{ type: 'text' as const, text: `Blocked: Content failed poison detection.` }] };
    
        let text = data.deduplicated
          ? `Updated existing memory: ${data.id} (deduplication matched)`
          : `Stored new memory: ${data.id}`;
        text += ` | ${data.tokenCount} tokens`;
        if (data.conflictIds?.length) text += `\nPotential conflicts with: ${data.conflictIds.join(', ')}`;
        return { content: [{ type: 'text' as const, text }] };
      }
    );
Behavior4/5

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

With no annotations, the description adds behavioral context by mentioning the 'full write pipeline: poison detection, dedup, embedding, persist'. This discloses processing steps and implies side effects (e.g., possible rejection). However, it does not mention if the operation is idempotent or reversible.

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?

The description is extremely concise—two short sentences—with no redundant or filler content. Every phrase adds value (pipeline steps, tier control).

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 the tool's complexity (12 parameters, no output schema), the description is too brief. It omits crucial details such as return value, required fields, enum options, and how the memory integrates with other tools like agentbay_memory_query.

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 67%, but the description adds minimal parameter info beyond mentioning 'tier' to control lifetime. It does not explain key parameters like projectId, title, type, or the various enums and optional fields, leaving gaps for the agent.

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?

The description clearly states the tool's purpose: 'Store a memory with full write pipeline'. It specifies the resource (memory) and action (store), and distinguishes from sibling tools like agentbay_memory_recall (retrieve) and agentbay_memory_forget (delete).

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

Usage Guidelines3/5

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

The description implies usage for storing memories but provides no explicit guidance on when to use this tool versus alternatives, nor any prerequisites or exclusions. It is a vague description that relies on tool name for context.

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/thomasjumper/agentbay-mcp'

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