Skip to content

fix(mcp): prevent get_bank from creating banks#2393

Open
Sanderhoff-alt wants to merge 1 commit into
vectorize-io:mainfrom
Sanderhoff-alt:fix-mcp-get-bank-read-only
Open

fix(mcp): prevent get_bank from creating banks#2393
Sanderhoff-alt wants to merge 1 commit into
vectorize-io:mainfrom
Sanderhoff-alt:fix-mcp-get-bank-read-only

Conversation

@Sanderhoff-alt

Copy link
Copy Markdown
Contributor

Summary

  • Treat the core MCP get_bank tool as read-only.
  • Look up bank profiles with create_if_missing=False in both single-bank and multi-bank MCP modes.
  • Return a not-found error when the bank is missing instead of creating it.
  • Add MCP regression tests for missing banks and for the non-creating lookup parameter.

Why

get_bank is a read tool: it returns bank metadata such as name, disposition, and mission. Before this change, it called get_bank_profile() with the default behavior, which can create a missing bank as a side effect.

That makes a read-only MCP call mutate persistent state when a client passes a stale or mistyped bank id. It also makes lifecycle and authorization semantics harder to reason about, because get_bank effectively becomes a hidden create path.

Creation should stay on explicit write/create surfaces such as create_bank. This change keeps get_bank read-only while preserving its existing response shape for successful reads.

Test

  • uv run pytest tests/test_mcp_tools.py::TestTagsAndBankTools -q
  • git diff --check

Treat the get_bank MCP tool as read-only by looking up bank profiles
without auto-creation in both single-bank and multi-bank modes.

Add regression coverage for missing banks so get_bank returns a
not-found error instead of creating the bank.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant