Skip to content

MCP server: distinguish answer file read errors from empty recall results #13

Description

@Kaap10

Context

Follow-up from review on PR #10

In examples/mcp_server.py → run_recall(), when temp_ans_file.read_text() raises an exception (e.g. file read/permission error or damaged descriptor), the except Exception: block currently catches it with pass and falls through to "(no matching notes found)", True.

While isError: True is correctly set (preventing the agent from trusting anything), an I/O read failure is masked behind a "no matching notes found" message.

Proposed Fix

  1. In run_recall(), capture except Exception as e: and return an explicit error string:
    return f"Recall error: failed to read answer file: {e}", True
  2. Keep "(no matching notes found)", True strictly for when the answer file was read without errors, but has empty content.
  3. Add a unit test verifying read errors produce distinct error text with isError: True.

Activity

  1. Kaap10 commented on Sep 17, 2026

    @Kaap10
    CollaboratorAuthor

    claiming this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions