[21034] add MCP-optimized actions for Returnista#21111
Conversation
…agement Adds 5 new list/process actions and refactors 6 existing actions with improved prop descriptions, optional parameters, and structured response summaries for LLM usability. Updates app.mjs with paginated methods and new API endpoints. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
new component addition and removal of newly added component for list
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
Thank you so much for submitting this! We've added it to our backlog to review, and our team has been notified. |
|
Thanks for submitting this PR! When we review PRs, we follow the Pipedream component guidelines. If you're not familiar, here's a quick checklist:
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds draft return order creation, processing (accept/reject), and resend-confirmation actions; updates app props/methods for draft workflows; tightens create/update return-location schemas; improves defensive response handling across several Returnista actions; adds list-shipping-products action; and bumps component and source versions to 1.0.0 and 0.0.2 respectively. ChangesReturnista Draft Return Order and Returns Management
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
version update
There was a problem hiding this comment.
Actionable comments posted: 8
🤖 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
`@components/returnista/actions/create-draft-return-order/create-draft-return-order.mjs`:
- Around line 89-90: Update the successful export("$summary") to include the
created draft return order's ID instead of (or in addition to) this.consumerId:
locate the success path that currently calls $.export("$summary", `Successfully
created draft return order for consumer ${this.consumerId}`) and change it to
reference the created entity identifier from the response object returned by the
create call (e.g., use response.id or response.body.id depending on where the
API puts the new record ID), so the one-line summary contains the draft return
order ID for traceability.
In
`@components/returnista/actions/create-return-location/create-return-location.mjs`:
- Line 13: The package version in the create-return-location action (the
"version" field in create-return-location.mjs) was bumped only to 0.0.2 despite
introducing breaking input-contract changes; update the version to a new major
release (e.g., 1.0.0) so the major segment is incremented to reflect the
breaking change, and ensure any other occurrences of the action's package
version referenced elsewhere (notably the related entries around lines
referenced in the review) are updated consistently.
- Around line 6-12: Update the component description for create-return-location
to explicitly list all required inputs and their formats in a "Parameter notes"
section: enumerate each required field (street, houseNumber, city, postalCode,
countryCode) plus any required metadata (e.g., name/displayName, accountId/path
parameter, contact/email/phone if applicable), state accepted formats (e.g.,
two-letter ISO 3166-1 alpha-2 for countryCode, numeric/string expectations for
houseNumber/postalCode), show examples for each, and keep the existing
documentation link; modify the description string used in create-return-location
to include this consolidated parameter notes so agents have a single concrete
place to find every required input.
In `@components/returnista/actions/get-return-order/get-return-order.mjs`:
- Line 11: The version bump is incorrect for adding a new optional prop: update
the action's version value (the "version" field currently "0.0.2") to a minor
bump "0.1.0" to reflect the new optional `expand` parameter, and also update the
component package.json version (currently patch) to at least "0.2.0" so the
package and action versions align; locate the "version" field in
get-return-order (the file declaring version: "0.0.2") and the version in the
components/returnista package.json and change them to the recommended minor
versions.
In
`@components/returnista/actions/update-return-location/update-return-location.mjs`:
- Around line 7-12: The listed props (suffix, stateProvinceCode, attention,
contactName — and any other address/contact fields mentioned around the prop
definitions) are not explicitly optional, which prevents sparse PATCH updates;
update their prop definitions in the action's props object (the prop entries
used by the update-return-location action) to mark them optional (remove any
required:true and add optional:true or the equivalent for this props system) so
callers can omit fields for partial updates, and ensure no default values force
presence.
In `@components/returnista/package.json`:
- Line 3: The package.json version "0.1.1" bump is incomplete because dependent
component versions were not updated; update the "version" field in
components/returnista/package.json and increment the corresponding dependent
component entries (the 11 dependency fields referenced by the CI error) to the
same-or-greater semantic version segment required by the changed scopes, and
also bump the parent app's package.json version by the same-or-greater semver
segment; locate the "version" key in components/returnista/package.json and the
dependency entries in the same file (and the app package.json's "version") and
raise them consistently so the CI component-version check passes.
In `@components/returnista/returnista.app.mjs`:
- Around line 203-207: Update the description for the answers prop (answers in
returnista.app.mjs) to include a concrete inline JSON example showing the
expected stringified object shape — include a minimal example that demonstrates
the top-level object with "formField" (showing id, type, required) and an
"answer" value variant (string, array of strings, or array of file objects with
mimeType and url) so consumers can copy/paste; keep the example concise and
clearly labeled as a stringified JSON example within the description text.
- Around line 169-173: The returnReasonId field is declared required but treated
as optional elsewhere (documentation and the createDraftReturnOrder mapping in
create-draft-return-order.mjs which maps blank to null); update the schema for
returnReasonId in returnista.app.mjs (the returnReasonId property) to make it
optional (remove or set the required flag to false) so callers can submit it
blank and still follow the existing mapping to null in
create-draft-return-order.mjs; ensure any validation or tests referencing
returnReasonId requiredness are updated accordingly.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: a1739bce-bddc-499e-8eed-63470f258dbf
📒 Files selected for processing (11)
components/returnista/actions/create-draft-return-order/create-draft-return-order.mjscomponents/returnista/actions/create-return-location/create-return-location.mjscomponents/returnista/actions/get-consumer-purchases/get-consumer-purchases.mjscomponents/returnista/actions/get-return-order-emails/get-return-order-emails.mjscomponents/returnista/actions/get-return-order/get-return-order.mjscomponents/returnista/actions/get-return-request/get-return-request.mjscomponents/returnista/actions/process-draft-return-order/process-draft-return-order.mjscomponents/returnista/actions/resend-confirmation-email/resend-confirmation-email.mjscomponents/returnista/actions/update-return-location/update-return-location.mjscomponents/returnista/package.jsoncomponents/returnista/returnista.app.mjs
michelle0927
left a comment
There was a problem hiding this comment.
Looks like this still has some coderabbit comments to address. Also, in package.json, the minor version should be updated if new components are being added, so it should be "0.2.0".
coderabbit review comment addressed
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
components/returnista/returnista.app.mjs (1)
7-213:⚠️ Potential issue | 🟠 MajorFix Returnista app bold tool-name cross-references in prop descriptions
returnOrderIdanddraftReturnOrderId: List Return Orders → Get Return OrdersreturnLocationId: List Return Locations → Get Return LocationsreturnRequestId: List Return Requests → Get Return Requests🤖 Prompt for 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. In `@components/returnista/returnista.app.mjs` around lines 7 - 213, The prop descriptions for propDefinitions need updated tool-name cross-references: change the bold text in returnOrderId and draftReturnOrderId from "**List Return Orders**" to "**Get Return Orders**"; change returnLocationId's "**List Return Locations**" to "**Get Return Locations**"; and change returnRequestId's "**List Return Requests**" to "**Get Return Requests**" — locate these properties (returnOrderId, draftReturnOrderId, returnLocationId, returnRequestId) in the propDefinitions block and edit their description strings to replace the old bolded tool names with the corrected ones.Source: Coding guidelines
components/returnista/actions/get-return-order/get-return-order.mjs (1)
6-10:⚠️ Potential issue | 🟡 MinorFix bold cross-reference tool name in get-return-order description
- In
components/returnista/actions/get-return-order/get-return-order.mjs, the description references List Return Orders, but the target action’snameis Get Return Orders—update the bold cross-reference to Get Return Orders.- Get Return Order Emails matches the referenced action
name.🤖 Prompt for 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. In `@components/returnista/actions/get-return-order/get-return-order.mjs` around lines 6 - 10, Update the description string in get-return-order (components/returnista/actions/get-return-order/get-return-order.mjs) to replace the bold cross-reference "**List Return Orders**" with the correct action name "**Get Return Orders**" so the documented reference matches the action `name` used elsewhere; leave "**Get Return Order Emails**" unchanged.Source: Coding guidelines
🤖 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
`@components/returnista/actions/create-return-location/create-return-location.mjs`:
- Around line 7-10: The component description for create-return-location states
suffix, attention, and contactName are optional but the action's input contract
currently marks them required; update the input schema in create-return-location
(remove "suffix", "attention", and "contactName" from the required fields array
or mark them optional in the input contract) so the schema matches the
description and validation will allow agent-generated calls.
In `@components/returnista/returnista.app.mjs`:
- Around line 204-212: The prop description for answers currently includes a
documentation link which violates the guideline that only the top-level
component description should include external links; update the answers prop
(the answers field in the component schema) to remove the documentation URL from
its description while keeping the existing inline example and agent-friendly
explanation intact so only the top-level description retains the external link.
---
Outside diff comments:
In `@components/returnista/actions/get-return-order/get-return-order.mjs`:
- Around line 6-10: Update the description string in get-return-order
(components/returnista/actions/get-return-order/get-return-order.mjs) to replace
the bold cross-reference "**List Return Orders**" with the correct action name
"**Get Return Orders**" so the documented reference matches the action `name`
used elsewhere; leave "**Get Return Order Emails**" unchanged.
In `@components/returnista/returnista.app.mjs`:
- Around line 7-213: The prop descriptions for propDefinitions need updated
tool-name cross-references: change the bold text in returnOrderId and
draftReturnOrderId from "**List Return Orders**" to "**Get Return Orders**";
change returnLocationId's "**List Return Locations**" to "**Get Return
Locations**"; and change returnRequestId's "**List Return Requests**" to "**Get
Return Requests**" — locate these properties (returnOrderId, draftReturnOrderId,
returnLocationId, returnRequestId) in the propDefinitions block and edit their
description strings to replace the old bolded tool names with the corrected
ones.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 7ac0bb06-890c-40fb-82e6-c0867667a691
📒 Files selected for processing (10)
components/returnista/actions/create-draft-return-order/create-draft-return-order.mjscomponents/returnista/actions/create-return-location/create-return-location.mjscomponents/returnista/actions/get-return-order/get-return-order.mjscomponents/returnista/actions/update-return-location/update-return-location.mjscomponents/returnista/package.jsoncomponents/returnista/returnista.app.mjscomponents/returnista/sources/return-order-completed-instant/return-order-completed-instant.mjscomponents/returnista/sources/return-order-confirmed-instant/return-order-confirmed-instant.mjscomponents/returnista/sources/sales-order-approved-or-denied-instant/sales-order-approved-or-denied-instant.mjscomponents/returnista/sources/shipment-received-tracking-updates-instant/shipment-received-tracking-updates-instant.mjs
fix for the coderabbbit comment
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
components/returnista/returnista.app.mjs (1)
68-72:⚠️ Potential issue | 🟠 MajorFix cross-referenced action names in returnista.app.mjs prop descriptions
- List Return Orders, List Return Locations, and List Return Requests don’t match any action
nameincomponents/returnista/actions/; use Get Return Orders, Get Return Locations, and Get Return Requests (and for draft orders, Get Draft Return Orders).- Get Consumer Purchases and Get Return Reasons are valid references.
- Update the affected
descriptionstrings incomponents/returnista/returnista.app.mjs(around lines 71, 76, 157, 162).🤖 Prompt for 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. In `@components/returnista/returnista.app.mjs` around lines 68 - 72, Update the description strings for the properties that reference other actions so they point to the correct action name tokens: replace mentions of "List Return Orders" with "Get Return Orders" in the returnOrderId property's description (property name: returnOrderId), replace "List Return Locations" with "Get Return Locations" in the returnLocationId property's description (property name: returnLocationId), replace "List Return Requests" with "Get Return Requests" in the returnRequestId property's description (property name: returnRequestId), and for the draft orders description replace any "List Draft Return Orders" or similar with "Get Draft Return Orders" (property name used for draft return IDs). Keep existing sentence wording and emphasis but only swap the action display names to the corrected "Get ..." versions; do not change other text or property names.Source: Coding guidelines
🤖 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.
Outside diff comments:
In `@components/returnista/returnista.app.mjs`:
- Around line 68-72: Update the description strings for the properties that
reference other actions so they point to the correct action name tokens: replace
mentions of "List Return Orders" with "Get Return Orders" in the returnOrderId
property's description (property name: returnOrderId), replace "List Return
Locations" with "Get Return Locations" in the returnLocationId property's
description (property name: returnLocationId), replace "List Return Requests"
with "Get Return Requests" in the returnRequestId property's description
(property name: returnRequestId), and for the draft orders description replace
any "List Draft Return Orders" or similar with "Get Draft Return Orders"
(property name used for draft return IDs). Keep existing sentence wording and
emphasis but only swap the action display names to the corrected "Get ..."
versions; do not change other text or property names.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 2e4efdec-ea4f-4539-a78a-b781a4f4f767
📒 Files selected for processing (2)
components/returnista/actions/create-return-location/create-return-location.mjscomponents/returnista/returnista.app.mjs
fix for the code review
Updating already existing async options for the existing props
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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
`@components/returnista/actions/list-shipping-products/list-shipping-products.mjs`:
- Around line 22-24: The list-shipping-products action uses a simpler defensive
parsing pattern than get-return-order-emails, which creates inconsistency across
list actions in the Returnista connector. Update the products variable
assignment to use the more defensive extraction pattern that checks if response
has a data property, and if not, checks if response itself is an array before
defaulting to an empty array. Additionally, change the return statement to
return the full response object instead of just the extracted products array,
matching the pattern used in get-return-order-emails for consistency.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: d1dd8f42-c06e-4221-9035-0b6ce05af428
📒 Files selected for processing (7)
components/returnista/actions/get-return-order-emails/get-return-order-emails.mjscomponents/returnista/actions/get-return-order/get-return-order.mjscomponents/returnista/actions/get-return-request/get-return-request.mjscomponents/returnista/actions/list-shipping-products/list-shipping-products.mjscomponents/returnista/actions/resend-confirmation-email/resend-confirmation-email.mjscomponents/returnista/actions/update-return-location/update-return-location.mjscomponents/returnista/returnista.app.mjs
michelle0927
left a comment
There was a problem hiding this comment.
LGTM! Ready for QA!
update the version
Change in the description
changes with respect to mcp
Update in the version
Update in the description
Summary
Requested Actions
Retrieve a single return order by ID, including status, date, price, return reason, and other details.
Endpoint: GET /account/:accountId/return-order/:id
Docs: https://platform.returnista.com/reference/rest-api/
2. List Return Orders (Read all return orders)
Retrieve a list of all return orders for an account, with filtering by status, date, return reason, etc.
Endpoint: GET /account/:accountId/return-orders
Docs: https://platform.returnista.com/reference/rest-api/
3. Approve Return Request
Approve a draft return order request, accepting it for further processing.
Endpoint: PUT /account/{accountId}/draft-return-order/{draftReturnOrderId}/accept
Docs: https://platform.returnista.com/reference/rest-api/
4. Reject Return Request
Reject a draft return order request.
Endpoint: PUT /account/{accountId}/draft-return-order/{draftReturnOrderId}/reject
Docs: https://platform.returnista.com/reference/rest-api/
5. Create Return Label (multi-step)
Create a return shipping label. This involves the following steps:
Step 5a: Create Draft Return Order
Create a new draft return order for a consumer.
Endpoint: POST /consumer/{consumerId}/draft-return-order
Docs: https://platform.returnista.com/reference/rest-api/
Step 5b: Accept Return Request
Accept the draft return order to confirm it.
Endpoint: PUT /account/{accountId}/draft-return-order/{draftReturnOrderId}/accept
Docs: https://platform.returnista.com/reference/rest-api/
Step 5c: Get Return Order Data (for label URL)
Retrieve the return order details including the label URL.
Endpoint: GET /account/:accountId/return-order/:id
Docs: https://platform.returnista.com/reference/rest-api/
6. Resend Confirmation Email
Resend the confirmation email for a return order.
Endpoint: GET /account/:accountId/return-order/:id/resend-confirmation-email
Docs: https://platform.returnista.com/reference/rest-api/
Refactored prop descriptions across all propDefinitions for improved clarity
Added 4 new methods:
createDraftReturnOrder — POST /consumer/{consumerId}/draft-return-order
resendConfirmationEmail — GET /account/{accountId}/return-order/{id}/resend-confirmation-email
(plus getReturnOrders and paginated variants added in the committed commit)
New action components added (net result)
Action | Status -- | -- process-draft-return-order | Added create-draft-return-order | Added resend-confirmation-email | AddedResolves #21034
Checklist
Please check the following items before your PR can be reviewed:
Versioning
0.0.1for new ones)package.json's version updatedNew app
If this is a new app, please submit an app integration request - the PR will only be reviewed after the app is integrated.
CodeRabbit review
After the PR is opened, and if new changes are pushed, CodeRabbit will automatically review it. Do not 'mark as resolved' CodeRabbit's comments, but reply to them instead, whether you agree (and update the PR accordingly) or disagree.
Summary by CodeRabbit
New Features
Improvements
Chores