Skip to main content
Glama
QuixiAI

AGI MCP Server

by QuixiAI

cleanup_expired_working_memory

Remove expired working memories to optimize system performance and maintain efficient memory management in AI systems.

Instructions

Clean up expired working memories

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function that executes the tool logic: deletes expired working memories from the database where expiry is set and <= current time, returns the deleted records.
    async cleanupExpiredWorkingMemory() { try { const expired = await this.db .delete(schema.workingMemory) .where( and( isNotNull(schema.workingMemory.expiry), lte(schema.workingMemory.expiry, new Date()) ) ) .returning(); return expired; } catch (error) { console.error('Error cleaning up expired working memory:', error); throw error; } }
  • Defines the tool schema with name, description, and input schema (empty object since no parameters required).
    { name: "cleanup_expired_working_memory", description: "Clean up expired working memories", inputSchema: { type: "object", properties: {} } },
  • mcp.js:670-672 (registration)
    Registers and dispatches the tool call in the MCP server's request handler, invoking the memoryManager method and returning formatted response.
    case "cleanup_expired_working_memory": const cleanedMemories = await memoryManager.cleanupExpiredWorkingMemory(); return { content: [{ type: "text", text: JSON.stringify(cleanedMemories, null, 2) }] };
  • Inline tool schema definition used by the MCP server (identical to memory-tools.js, possibly imported).
    { name: "cleanup_expired_working_memory", description: "Clean up expired working memories", inputSchema: { type: "object", properties: {} } },
  • mcp.js:450-457 (registration)
    Tool registration in the server's tools list with schema.
    { name: "cleanup_expired_working_memory", description: "Clean up expired working memories", inputSchema: { type: "object", properties: {} } },

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/QuixiAI/agi-mcp-server'

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