Skip to content

fix(mcp): expose tag_groups parameter on recall tool#1424

Merged
nicoloboschi merged 1 commit intomainfrom
fix/mcp-recall-tag-groups
May 4, 2026
Merged

fix(mcp): expose tag_groups parameter on recall tool#1424
nicoloboschi merged 1 commit intomainfrom
fix/mcp-recall-tag-groups

Conversation

@nicoloboschi
Copy link
Copy Markdown
Collaborator

Summary

  • Adds tag_groups to the MCP recall tool schema (both multi-bank and single-bank variants), bringing it in line with the REST API's RecallRequest.
  • Validates incoming dicts via TypeAdapter(list[TagGroup]) and enforces the same tags/tag_groups mutual-exclusivity rule as the REST endpoint.
  • Closes MCP recall tool schema missing tag_groups parameter #1396.

Why

The engine and REST API already supported tag_groups, but the MCP tool's signature omitted it — so MCP clients passing e.g. [{"not": {"tags": ["closeout"], "match": "any_strict"}}] for negative filtering had the parameter silently dropped, and recall executed unfiltered. This was caught by a PM bootstrap skill that got 7/50 closeout-tagged results leaking through via MCP while the same filter worked over REST.

Test plan

  • uv run pytest tests/test_mcp_tools.py — 172 passed (4 new tests)
  • ./scripts/hooks/lint.sh clean
  • uv run ty check hindsight_api/mcp_tools.py clean
  • New tests cover: NOT-group passthrough, omitted-param no-op, tags+tag_groups rejection, single-bank mode

The MCP recall tool's schema omitted tag_groups, so MCP clients passing
e.g. {"not": {"tags": ["closeout"]}} for negative filtering had it
silently dropped — recall executed without the filter. The REST API
already exposed it; this brings the MCP tool in line.

Validates incoming dicts via TypeAdapter(list[TagGroup]) and enforces
the same tags/tag_groups mutual-exclusivity check as RecallRequest.
@nicoloboschi nicoloboschi merged commit b948b57 into main May 4, 2026
61 of 63 checks passed
liling pushed a commit to liling/hindsight that referenced this pull request May 5, 2026
…) (vectorize-io#1424)

The MCP recall tool's schema omitted tag_groups, so MCP clients passing
e.g. {"not": {"tags": ["closeout"]}} for negative filtering had it
silently dropped — recall executed without the filter. The REST API
already exposed it; this brings the MCP tool in line.

Validates incoming dicts via TypeAdapter(list[TagGroup]) and enforces
the same tags/tag_groups mutual-exclusivity check as RecallRequest.
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.

MCP recall tool schema missing tag_groups parameter

1 participant