thedotmack/claude-mem · warning

recall MCP tool call failed

Error message

recall MCP tool call failed

What it means

The recall MCP server wraps every tool dispatch in a try/catch; when dispatchToolCall throws for any tool invocation, it logs this warning and returns an isError result containing the underlying error message instead of crashing the MCP server.

Solutions

  1. Check the logged err (via logger.warn output) for the root cause
  2. Verify the tool name and arguments against the server's declared tool schema
  3. Ensure the backend (database/index) is running and reachable
  4. Update the MCP client configuration if the tool name changed between versions

Example fix

// before
await mcp.callTool('recall_search', { q: 'text' }); // wrong arg name
// after
await mcp.callTool('recall_search', { query: 'text' }); // match server schema
Defensive patterns

Strategy: try-catch

Validate before calling

const tools = await client.listTools();
if (!tools.some(t => t.name === 'recall_search')) throw new Error('recall_search not offered by server');

Type guard

function isValidToolArgs(args: unknown): args is Record<string, unknown> {
  return typeof args === 'object' && args !== null;
}

Try / catch

try {
  const res = await client.callTool({ name, arguments });
  if (res.isError) console.warn('tool error:', res.content[0].text);
} catch (e) {
  console.error('MCP call failed', e);
}

Prevention

When it happens

Trigger: Any MCP client calls a recall tool (by name from request.params.name) with bad arguments, an unknown tool name, or when the backend throws while processing the query.

Common situations: MCP client sends malformed arguments (missing/incorrectly typed params); backend database unavailable; unknown tool name from a stale client config.

Understand the failure class

Background: "API request failed": what wrapped HTTP errors from external APIs mean and how to find the real cause — this error's family across 29 libraries.

Related errors


AI-assisted analysis of thedotmack/claude-mem@d8bc9755e7 (2026-09-17). Data as JSON: /api/errors/f9a6122209acca8f. Report an issue: GitHub.

Appendix: source

Thrown at src/server/mcp/recall-mcp-server.ts:155

 * Build a read-only recall MCP server bound to `backend`. The caller owns the
 * transport (stdio in the CLI, streamable-HTTP in Server Beta).
 */
export function createRecallMcpServer(backend: RecallBackend, version: string): Server {
  const server = new Server(
    { name: 'claude-mem', version },
    { capabilities: { tools: {} } },
  );

  server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));

  server.setRequestHandler(CallToolRequestSchema, async (request): Promise<CallToolResult> => {
    const name = request.params.name;
    const args = (request.params.arguments ?? {}) as Record<string, unknown>;
    try {
      return await dispatchToolCall(backend, name, args);
    } catch (error) {
      const err = error instanceof Error ? error : new Error(String(error));
      logger.warn('SYSTEM', 'recall MCP tool call failed', { tool: name }, err);
      return { isError: true, content: [{ type: 'text', text: err.message }] };
    }
  });

  return server;
}

export const RECALL_MCP_TOOLS = TOOLS;

View on GitHub (pinned to d8bc9755e7)