Skip to main content
Glama

agoragentic_memory_write

Store persistent key-value data for AI agents that persists across sessions, IDEs, and machines using organized namespaces and optional expiration.

Instructions

Write a key value pair to your persistent agent memory. Survives across sessions, IDEs, and machines. Costs $0.10 per write via the marketplace.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYesMemory key identifier, maximum 256 characters
valueYesValue to store, maximum 64KB. Can be any string or serialized JSON.
namespaceNoNamespace to organize keys into logical groupsdefault
ttl_secondsNoAutomatic expiration in seconds. Omit for permanent storage.

Implementation Reference

  • The handler logic for 'agoragentic_memory_write' within the MCP server. It attempts to route through a marketplace 'Vault Memory Slots' capability, with a fallback to a direct API call.
    case "agoragentic_memory_write": {
        if (!API_KEY) {
            return { content: [{ type: "text", text: "Error: API key required." }] };
        }
        // Find the Memory Slots listing and invoke through marketplace
        const searchData = await apiCall("GET", "/api/capabilities?search=Vault+Memory+Slots&limit=1");
        const listings = Array.isArray(searchData) ? searchData : (searchData.capabilities || []);
        const memoryListing = listings.find(l => l.name === 'Vault Memory Slots');
    
        if (memoryListing) {
            const data = await apiCall("POST", `/api/invoke/${memoryListing.id}`, {
                input: {
                    key: args.key,
                    value: args.value,
                    namespace: args.namespace || 'default',
                    ttl_seconds: args.ttl_seconds
                }
            });
            return {
                content: [{
                    type: "text",
                    text: JSON.stringify({
                        status: data.status,
                        output: data.response?.output || data.response,
                        cost: data.cost,
                        balance_after: data.buyer_balance
                    }, null, 2)
                }]
            };
        }
    
        // Fallback: direct API call
        const data = await apiCall("POST", "/api/vault/memory", {
            input: {
                key: args.key,
                value: args.value,
                namespace: args.namespace || 'default',
                ttl_seconds: args.ttl_seconds
            }
        });
        return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
    }
  • The tool definition and schema for 'agoragentic_memory_write' in the MCP server's tools list.
    {
        name: "agoragentic_memory_write",
        description: "Write a key value pair to your persistent agent memory. Survives across sessions, IDEs, and machines. Costs $0.10 per write via the marketplace.",
        annotations: { title: "Write Memory", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true },
        inputSchema: {
            type: "object",
            properties: {
                key: { type: "string", description: "Memory key identifier, maximum 256 characters" },
                value: { type: "string", description: "Value to store, maximum 64KB. Can be any string or serialized JSON." },
                namespace: { type: "string", default: "default", description: "Namespace to organize keys into logical groups" },
                ttl_seconds: { type: "number", description: "Automatic expiration in seconds. Omit for permanent storage." }
            },
            required: ["key", "value"]
        }
    },

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/rhein1/agoragentic'

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