The following tools in ai/mcp/server/memory-core/services/toolService.mjs lack top-level try-catch blocks to ensure a consistent error shape for the MCP server:
Services to Update:
MemoryService.mjs: addMemory, listMemories, queryMemories
SummaryService.mjs: deleteAllSummaries, listSummaries, querySummaries
DatabaseService.mjs: exportDatabase, importDatabase
DatabaseLifecycleService.mjs: startDatabase, stopDatabase
Required Error Shape:
{
error : 'Description of the error',
message: error.message,
code : 'ERROR_CODE'
}
Note: SessionService.summarizeSessions already implements this pattern. HealthService.healthcheck handles errors internally to return a health status, but should be reviewed to ensure it doesn't throw raw exceptions.
Task:
Wrap the logic of the listed methods in try-catch blocks and return the standardized error object on failure.
The following tools in
ai/mcp/server/memory-core/services/toolService.mjslack top-leveltry-catchblocks to ensure a consistent error shape for the MCP server:Services to Update:
MemoryService.mjs:addMemory,listMemories,queryMemoriesSummaryService.mjs:deleteAllSummaries,listSummaries,querySummariesDatabaseService.mjs:exportDatabase,importDatabaseDatabaseLifecycleService.mjs:startDatabase,stopDatabaseRequired Error Shape:
{ error : 'Description of the error', message: error.message, code : 'ERROR_CODE' // e.g., MEMORY_ADD_ERROR, DATABASE_EXPORT_ERROR }Note:
SessionService.summarizeSessionsalready implements this pattern.HealthService.healthcheckhandles errors internally to return a health status, but should be reviewed to ensure it doesn't throw raw exceptions.Task: Wrap the logic of the listed methods in
try-catchblocks and return the standardized error object on failure.