Skip to content

Missing project on one-project tools returns a raw pydantic error instead of a refusal #1984

Closed

Description

@groksrc

Calling a one-project tool without project returns a raw pydantic validation error, not a Basic Memory refusal. The model gets no hint that project is required or how to find one.

What happens

Found in a 1.0 live MCP test (post-1.0), against v1.0.0 (c9bd187).

bm_list(path="/") with no project returned:

1 validation error for call[bm_list]
project
  Missing required keyword only argument [type=missing_keyword_only_argument, input_value={'path': '/'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.13/v/missing_keyword_only_argument

Why

Requiring project is intended. #1934 made it required on bm_read, bm_write, bm_edit, bm_move, bm_delete, bm_list, bm_find, bm_context and bm_schema (src/basic_memory/mcp/tool_params.py:51-63; src/basic_memory/mcp/tools/listing.py:62-63, keyword-only with no default). When project is missing, FastMCP's argument validation fails before the tool body runs, so the tool never gets to refuse in its own words.

A client with an outdated tool list makes this worse. The client in this test still showed the pre-#1934 schema: project optional, and the old bm_list text "bm_list('/') with no project lists the projects you can address". So it called the tool in a way the description said would work. (Hypothesis: the client cached tools/list from before the upgrade. Reconnecting should confirm it.)

Expected

A missing or blank project gets the standard refusal, for example:

INVALID_ARGUMENTS: bm_list needs a project.
Try instead: bm_project(command='list') to see the projects you can address.

Proposed fix

  • Make project default to None in the signature (still required in the advertised schema if possible), and refuse with INVALID_ARGUMENTS plus try_instead inside the tool. Or add a small validation-error handler that turns missing_keyword_only_argument on project into that refusal.
  • Consider sending notifications/tools/list_changed after an upgrade, so connected clients refresh the tool list.

🤖 Generated with Claude Code

Activity

  1. added
    bug
    on Oct 30, 2026
  2. claude commented on Oct 30, 2026

    @claude
    Contributor

    Claude finished @groksrc's task in 14s —— View job


    Triage

    • Type: Bug (labeled bug)
    • Component: MCP tools (no repository label; cloud not applicable)
    • Priority: Medium. It's a usability problem with a clear workaround. The model can't recover from the raw pydantic error, and stale client tool lists make it more likely.
    • Complexity: Simple to Medium. Either option in the issue works:
      • Default project to None in the nine tool signatures and refuse with INVALID_ARGUMENTS plus try_instead inside the tool body. This needs a way to keep project marked required in the advertised schema.
      • Add a validation-error handler that maps missing_keyword_only_argument on project to the same refusal.
      • The tools/list_changed notification after an upgrade is a separate, optional follow-up.
    • Duplicates: A search for similar issues found none.

    The report is complete and includes the failing call, the cause, and the expected output. I haven't asked for more reproduction steps.

    Suggested acceptance check: calling each of the nine one-project tools with project missing or blank returns the standard refusal. A regression test should cover this against the real FastMCP validation path.

    Per the triage scope, I haven't made any code changes.

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

    bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions