Add missing contact import export tools#95
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughAdds contact import and export MCP tools: types, JSON schemas, create/get handlers, Jest tests, server registration of four tools, and README/CLAUDE docs describing payloads and polling/download behavior. ChangesContact Import/Export Feature Addition
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@CLAUDE.md`:
- Line 161: Update the create-contact-import documentation entry to explicitly
state which field value types are accepted in the import payload for the fields
property of create-contact-import (e.g., text/string, number, boolean, date) or
state the restriction if only string/number are allowed; ensure the wording
aligns with README.md (and the contact field types referenced at "contact
fields" line) so both docs consistently describe whether boolean and date values
are supported in imports and, if not supported, explain that they must be
serialized (e.g., as ISO date strings or boolean strings).
In `@README.md`:
- Line 799: The README currently states `fields` accepts string or number but
lacks clarification; update the README line about `fields` to explicitly say
imported field values are limited to string | number per the createContactImport
schema and the ContactImportFieldValue type, or if you intend to accept
boolean/date values then update the createContactImport validation/schema and
the ContactImportFieldValue union to include boolean and date (and ensure
corresponding parsing/serialization in the import handler such as
createContactImport and any consumers of ContactImportFieldValue).
In `@src/tools/contactExports/schemas/createContactExport.ts`:
- Around line 16-34: The schema currently forces "value" to be required for
every filter, which breaks semantics for operators like "is_empty" and
"is_not_empty"; update the schema for the filter object (the block containing
"operator" and "value") to only require ["name","operator"] and add a JSON
Schema conditional (if/then/else or oneOf) that: when "operator" is "is_empty"
or "is_not_empty" ensures "value" is absent/optional, and otherwise enforces
"value" is present and conforms to the existing description/type; adjust the
required array and add an "if": {"properties":{"operator":{"const":"is_empty"}}}
/ "then" and a similar branch for "is_not_empty" (or a combined enum), with an
"else" that requires "value".
In `@src/tools/contactExports/schemas/getContactExport.ts`:
- Around line 4-6: The export_id schema currently uses type: "number" which
permits decimals and negatives; update the export_id property in
getContactExport.ts to require an integer ID and be positive by changing type to
"integer" (or adding an integer constraint) and adding a minimum: 1 constraint
(e.g., type: "integer", minimum: 1) so only positive whole IDs are allowed.
In `@src/tools/contactImports/schemas/getContactImport.ts`:
- Around line 4-10: The schema's import_id currently uses type: "number" which
permits floats and negatives; update the getContactImport schema's import_id
definition to require an integer >= 1 by changing the type to "integer" and
adding "minimum": 1 (retain description, required array, and
additionalProperties: false) so only positive whole IDs validate.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 26914b66-c0d3-454a-a46b-4db283c11ea4
📒 Files selected for processing (18)
CLAUDE.mdREADME.mdsrc/server.tssrc/tools/contactExports/__tests__/createContactExport.test.tssrc/tools/contactExports/__tests__/getContactExport.test.tssrc/tools/contactExports/createContactExport.tssrc/tools/contactExports/getContactExport.tssrc/tools/contactExports/index.tssrc/tools/contactExports/schemas/createContactExport.tssrc/tools/contactExports/schemas/getContactExport.tssrc/tools/contactImports/__tests__/createContactImport.test.tssrc/tools/contactImports/__tests__/getContactImport.test.tssrc/tools/contactImports/createContactImport.tssrc/tools/contactImports/getContactImport.tssrc/tools/contactImports/index.tssrc/tools/contactImports/schemas/createContactImport.tssrc/tools/contactImports/schemas/getContactImport.tssrc/types/mailtrap.ts
Motivation
Changes
Summary by CodeRabbit
New Features
Documentation
Tests