Skip to content

feat(MCP): [3/5] Add upsert-records tool to RedisVL MCP#540

Open
vishal-bala wants to merge 6 commits intofeat/RAAE-1397/search-toolfrom
feat/RAAE-1398/upsert-tool
Open

feat(MCP): [3/5] Add upsert-records tool to RedisVL MCP#540
vishal-bala wants to merge 6 commits intofeat/RAAE-1397/search-toolfrom
feat/RAAE-1398/upsert-tool

Conversation

@vishal-bala
Copy link
Copy Markdown
Collaborator

@vishal-bala vishal-bala commented Mar 25, 2026

Builds on top of #539


Note

Medium Risk
Adds a new write-capable MCP tool that validates and loads user-provided records into Redis and may generate embeddings via the configured vectorizer, which impacts data integrity and runtime behavior. Risk is mitigated by strict request/schema validation, read-only gating, and extensive unit/integration test coverage.

Overview
Adds a new MCP tool, upsert-records, that writes data into the configured Redis index by validating record shapes against the index schema, optionally generating missing vector embeddings via the configured vectorizer, and serializing vectors appropriately for HASH storage before calling index.load().

The MCP server now registers this tool during startup only when not in read_only mode, and the tools package exports upsert_records. Separately, filter parsing type hints were adjusted to use typing aliases (e.g., Union, List) for broader Python compatibility, and new unit/integration tests cover upsert behavior, embedding fallbacks, runtime limits, and error mapping (including partial-write metadata).

Written by Cursor Bugbot for commit 352406b. This will update automatically on new commits. Configure here.

@vishal-bala vishal-bala self-assigned this Mar 25, 2026
@vishal-bala vishal-bala added the auto:minor Increment the minor version when merged label Mar 25, 2026
@jit-ci
Copy link
Copy Markdown

jit-ci bot commented Mar 25, 2026

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

@vishal-bala vishal-bala changed the title feat(MCP): Add tool for upserting records to the RedisVL MCP feat(MCP): Add upsert-records tool to RedisVL MCP Mar 25, 2026
@vishal-bala vishal-bala marked this pull request as ready for review March 25, 2026 16:53
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c748db2c6c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

@vishal-bala vishal-bala changed the title feat(MCP): Add upsert-records tool to RedisVL MCP feat(MCP): [3/5] Add upsert-records tool to RedisVL MCP Apr 2, 2026
Copy link
Copy Markdown
Collaborator

@nkanu17 nkanu17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Comment on lines +133 to +134
async def _embed_many(vectorizer: Any, contents: List[str]) -> List[List[float]]:
"""Embed multiple records with batch-first fallbacks."""
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why both?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I fully understand what you mean? If it's about having the fallback, it's because not all of our vectorizers implement batched calls.

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

Labels

auto:minor Increment the minor version when merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants