feat: add customer tools#177
Conversation
|
Warning Review limit reached
Next review available in: 49 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdds customer CRUD, property, property-value, request, and work-item MCP tools. The new customer package centralizes registration, updates the Plane SDK dependency, and expands integration coverage to verify all customer tools are available. ChangesCustomer tool surface
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant MCPClient
participant CustomerTool
participant PlaneSDK
MCPClient->>CustomerTool: invoke customer operation
CustomerTool->>PlaneSDK: call client.customers API
PlaneSDK-->>CustomerTool: return response
CustomerTool-->>MCPClient: return tool result
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (4)
plane_mcp/tools/customers/_helpers.py (1)
24-32: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueUpdate the return type annotation to include
None.The
build_settingsfunction can returnNone, but its return type is currently annotated asPropertySettings. Update it toPropertySettings | Noneto accurately reflect the return values and avoid type-checking errors.♻️ Proposed fix
-def build_settings(property_type: str, settings: dict | None) -> PropertySettings: +def build_settings(property_type: str, settings: dict | None) -> PropertySettings | None:🤖 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 `@plane_mcp/tools/customers/_helpers.py` around lines 24 - 32, Update the return type annotation of build_settings to PropertySettings | None, matching its existing None return paths while preserving the current settings conversion behavior.plane_mcp/tools/customers/base.py (1)
177-188: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueAdd a
Returnssection to the docstrings. As per coding guidelines, FastMCP tools should include docstrings with bothArgsandReturnssections. Adding aReturnssection, even to indicate that the tool returns nothing, ensures consistency across the codebase.
plane_mcp/tools/customers/base.py#L177-L188: addReturns:\n Noneto thedelete_customerdocstring.plane_mcp/tools/customers/requests.py#L133-L139: addReturns:\n Noneto thedelete_customer_requestdocstring.🤖 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 `@plane_mcp/tools/customers/base.py` around lines 177 - 188, Both customer deletion tool docstrings lack the required Returns section. In plane_mcp/tools/customers/base.py lines 177-188, update delete_customer to add a Returns section documenting None; make the same change in plane_mcp/tools/customers/requests.py lines 133-139 for delete_customer_request.Source: Coding guidelines
plane_mcp/tools/customers/work_items.py (1)
73-80: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low valueConsider handling partial failures during unlink.
If
work_item_idscontains multiple IDs and anunlinknetwork call fails partway through the loop, the remaining items will not be unlinked, and an exception will be raised. If the SDK does not provide a bulk unlink endpoint, consider whether partial failures should be caught and accumulated or if failing fast is the intended behavior.🤖 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 `@plane_mcp/tools/customers/work_items.py` around lines 73 - 80, Review the unlink loop in the work item handling branch and define explicit partial-failure behavior for multiple work_item_ids. If continuing after failures is intended, catch each unlink error, accumulate the failures, process all remaining IDs, and report the aggregated result; otherwise preserve and document failing-fast behavior by allowing the first exception to propagate.plane_mcp/tools/customers/properties.py (1)
169-175: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueAdd
Returnssection to the docstrings.As per coding guidelines, FastMCP tools must include docstrings with both
ArgsandReturnssections. The tools returningNoneare missing theReturnssection.
plane_mcp/tools/customers/properties.py#L169-L175: AddReturns: Nonetodelete_customer_property.plane_mcp/tools/customers/property_values.py#L35-L55: AddReturns: Nonetoset_customer_property_values.🤖 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 `@plane_mcp/tools/customers/properties.py` around lines 169 - 175, Add a Returns section documenting None to the docstrings of delete_customer_property in plane_mcp/tools/customers/properties.py (lines 169-175) and set_customer_property_values in plane_mcp/tools/customers/property_values.py (lines 35-55), while preserving their existing Args documentation.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 `@plane_mcp/tools/customers/properties.py`:
- Around line 20-40: The list_customer_properties function currently returns the
full PaginatedCustomerPropertyResponse envelope. Update it to return only the
response’s results array, and revise its return annotation and docstring to
describe the list of customer properties rather than pagination metadata.
---
Nitpick comments:
In `@plane_mcp/tools/customers/_helpers.py`:
- Around line 24-32: Update the return type annotation of build_settings to
PropertySettings | None, matching its existing None return paths while
preserving the current settings conversion behavior.
In `@plane_mcp/tools/customers/base.py`:
- Around line 177-188: Both customer deletion tool docstrings lack the required
Returns section. In plane_mcp/tools/customers/base.py lines 177-188, update
delete_customer to add a Returns section documenting None; make the same change
in plane_mcp/tools/customers/requests.py lines 133-139 for
delete_customer_request.
In `@plane_mcp/tools/customers/properties.py`:
- Around line 169-175: Add a Returns section documenting None to the docstrings
of delete_customer_property in plane_mcp/tools/customers/properties.py (lines
169-175) and set_customer_property_values in
plane_mcp/tools/customers/property_values.py (lines 35-55), while preserving
their existing Args documentation.
In `@plane_mcp/tools/customers/work_items.py`:
- Around line 73-80: Review the unlink loop in the work item handling branch and
define explicit partial-failure behavior for multiple work_item_ids. If
continuing after failures is intended, catch each unlink error, accumulate the
failures, process all remaining IDs, and report the aggregated result; otherwise
preserve and document failing-fast behavior by allowing the first exception to
propagate.
🪄 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: 9df8cd84-faba-4deb-9ac2-76f61afd8680
📒 Files selected for processing (11)
CLAUDE.mdplane_mcp/tools/__init__.pyplane_mcp/tools/customers/__init__.pyplane_mcp/tools/customers/_helpers.pyplane_mcp/tools/customers/base.pyplane_mcp/tools/customers/properties.pyplane_mcp/tools/customers/property_values.pyplane_mcp/tools/customers/requests.pyplane_mcp/tools/customers/work_items.pypyproject.tomltests/test_integration.py
…e and create methods
Description
Adds MCP tools for Plane's customers domain.
Tools
Organized as a
plane_mcp/tools/customers/package.Requires
plane-sdk==0.2.20.Summary by CodeRabbit