fix: strip MCP-only params from bulk_edit delete request to Paperless#100
Conversation
When method is "delete", the Paperless bulk-edit endpoint's delete() action accepts no extra kwargs. Forwarding confirm or delete_originals in the parameters object caused a 400 from Paperless. Now an empty parameters object is sent for the delete method. Closes #91 https://claude.ai/code/session_018wRYWcNE4fmxKQ4qrSHaFX
🦋 Changeset detectedLatest commit: e32afbe The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 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 |
Closes #101 ## Summary - **`docker-compose.e2e.yml`** — Paperless-ngx 2.14 + Redis fixture stack with auto-created admin user - **`e2e/e2e.test.ts`** — Deterministic `tools/call` tests (no LLM) using Node's native `node:test` covering all tools from the issue: `list_tags`, `create_tag`, `list_correspondents`, `create_correspondent`, `list_document_types`, `create_document_type`, `list_documents`, `get_document`, `search_documents`, `download_document` (regression for #87), `get_document_thumbnail`, `bulk_edit_documents` (regression for #100, #89), `post_document` - **`e2e/client.ts`** — SDK `StreamableHTTPClientTransport` factory - **`e2e/paperless.ts`** — Direct Paperless REST client for seeding test data in `before()` hooks - **`.github/workflows/e2e.yml`** — Matrix job (CLI + Docker) triggered on every PR and push to `main` - **`README.md`** — Testing section with unit and E2E run instructions - **`package.json`** — `npm run test:e2e` script ## Test plan - [ ] Verify CI passes on this PR (E2E matrix job: cli + docker) - [ ] Check that `list_tags` finds the seeded tag - [ ] Check that `download_document` returns a `paperless://` URI (regression #87) - [ ] Check that `bulk_edit_documents` modify_tags round-trip works (regression #100) - [ ] Confirm Docker image job also passes (builds image then runs same test file) - [ ] Review README Testing section renders correctly https://claude.ai/code/session_01LActHt6HMhygRppaphFRzQ --- _Generated by [Claude Code](https://claude.ai/code/session_01LActHt6HMhygRppaphFRzQ)_ <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Added a comprehensive E2E test suite that runs locally and in CI against a real Paperless-ngx instance, exercising tag/correspondent/document-type management, document operations (list/get/search/download/thumbnail), bulk tag edits, and uploads. * **Documentation** * Added a “Testing” section with prerequisites and instructions for running unit and E2E tests and cleanup steps. * **Chores** * Added CI workflow, Docker Compose for E2E, and an npm script to run E2E tests; excluded E2E from regular TypeScript compilation. * **Bug Fixes** * Bulk-edit behavior now initializes tag fields by default for tag-modify operations to ensure robust payloads. <!-- review_stack_entry_start --> [](https://app.coderabbit.ai/change-stack/baruchiro/paperless-mcp/pull/104?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Closes #91
Summary
method: "delete", Paperless'sdelete()action accepts no extra kwargs. The MCP wrapper was forwardingconfirm(and potentiallydelete_originals) in theparametersobject, causing a400 Bad Requestfrom Paperless.confirmis an MCP-side safety guardrail and was already being stripped by destructuring on the handler line; howeverdelete_originalswas still included in the spread...parameters.deletemethod, pass an emptyparameters: {}object to the Paperless API instead of the user-supplied parameter spread.Test plan
bulk_edit_documentswithmethod: "delete"andconfirm: true— should succeed (noparametersforwarded)method: "delete",confirm: true, anddelete_originals: true— should no longer 400add_tag) — parameters still forwarded correctlyGenerated by Claude Code