feat: add chroma_update_documents tool #17
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request introduces the
chroma_update_documentstool to the Chroma MCP server. This tool allows users to update existing documents within a specified Chroma collection by providing their IDs.Key Features:
documents), metadata (metadatas), or embeddings (embeddings) of existing documents identified by their unique IDs.Implementation Details:
chroma_update_documentsfunction tosrc/chroma_mcp/server.py, which interacts with the ChromaDB client'supdatemethod.Testing:
Added comprehensive tests in
tests/test_server.pyto cover various scenarios:test_update_documents_success: Verifies successful updates of document content and metadata.test_update_documents_invalid_args: Ensures appropriate errors are raised for invalid input (empty IDs, no update fields).test_update_documents_collection_not_found: Checks error handling when the target collection doesn't exist.test_update_documents_id_not_found: Confirms that attempting to update non-existent IDs does not raise an error but completes the request (as per ChromaDB behavior).This new tool enhances the capabilities of the Chroma MCP server, providing users with more granular control over their collection data.
Related PRs
Following the merge of this PR, I plan to merge the pull request for adding the document deletion feature (
chroma_delete_documents):