Fix chroma add documents and fix Optional parameters undefined issue #31
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.
Improve chroma_add_documents and fix type annotation issues
Summary
This PR addresses two main issues in the chroma-mcp implementation:
Optionaltype annotations that were causing parameter recognition problems in Cursor MCPchroma_add_documentsfunction to properly validate document IDsChanges
Type Annotation Fixes
Optionaltype annotations from parameters across the codebaseDict = Noneinstead ofOptional[Dict] = None)undefined, particularly with metadata parametersDocument ID Validation Improvements
idsparameter inchroma_add_documentsidscannot be null or empty stringsAuto-generated IDs Removal
Motivation
When using chroma-mcp with Cursor, I encountered parameter recognition issues where the MCP framework would fail to properly process
Optional-typed parameters. Additionally, the automatic ID generation was causing confusion and potential data loss when users weren't explicitly providing document identifiers.These changes improve reliability and consistency across different environments while enforcing better practices for document management.
Testing
Tested in multiple Cursor environments to verify parameter recognition works correctly, and that the ID validation properly enforces the required constraints.