Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
151 changes: 12 additions & 139 deletions plane_mcp/tools/cycles.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,7 @@ def list_cycles(
project_id: str,
params: dict[str, Any] | None = None,
) -> list[Cycle]:
"""
List all cycles in a project.

Args:
workspace_slug: The workspace slug identifier
project_id: UUID of the project
params: Optional query parameters as a dictionary

Returns:
List of Cycle objects
"""
"""List all cycles in a project."""
client, workspace_slug = get_plane_client_context()
response: PaginatedCycleResponse = client.cycles.list(
workspace_slug=workspace_slug, project_id=project_id, params=params
Expand All @@ -54,24 +44,7 @@ def create_cycle(
external_id: str | None = None,
timezone: str | None = None,
) -> Cycle:
"""
Create a new cycle.

Args:
workspace_slug: The workspace slug identifier
project_id: UUID of the project
name: Cycle name
owned_by: UUID of the user who owns the cycle
description: Cycle description
start_date: Cycle start date (ISO 8601 format)
end_date: Cycle end date (ISO 8601 format)
external_source: External system source name
external_id: External system identifier
timezone: Cycle timezone

Returns:
Created Cycle object
"""
"""Create a new cycle."""
client, workspace_slug = get_plane_client_context()

data = CreateCycle(
Expand All @@ -90,17 +63,7 @@ def create_cycle(

@mcp.tool()
def retrieve_cycle(project_id: str, cycle_id: str) -> Cycle:
"""
Retrieve a cycle by ID.

Args:
workspace_slug: The workspace slug identifier
project_id: UUID of the project
cycle_id: UUID of the cycle

Returns:
Cycle object
"""
"""Retrieve a cycle by ID."""
client, workspace_slug = get_plane_client_context()
return client.cycles.retrieve(
workspace_slug=workspace_slug, project_id=project_id, cycle_id=cycle_id
Expand All @@ -119,25 +82,7 @@ def update_cycle(
external_id: str | None = None,
timezone: str | None = None,
) -> Cycle:
"""
Update a cycle by ID.

Args:
workspace_slug: The workspace slug identifier
project_id: UUID of the project
cycle_id: UUID of the cycle
name: Cycle name
description: Cycle description
start_date: Cycle start date (ISO 8601 format)
end_date: Cycle end date (ISO 8601 format)
owned_by: UUID of the user who owns the cycle
external_source: External system source name
external_id: External system identifier
timezone: Cycle timezone

Returns:
Updated Cycle object
"""
"""Update a cycle by ID."""
client, workspace_slug = get_plane_client_context()

data = UpdateCycle(
Expand All @@ -157,14 +102,7 @@ def update_cycle(

@mcp.tool()
def delete_cycle(project_id: str, cycle_id: str) -> None:
"""
Delete a cycle by ID.

Args:
workspace_slug: The workspace slug identifier
project_id: UUID of the project
cycle_id: UUID of the cycle
"""
"""Delete a cycle by ID."""
client, workspace_slug = get_plane_client_context()
client.cycles.delete(
workspace_slug=workspace_slug, project_id=project_id, cycle_id=cycle_id
Expand All @@ -175,17 +113,7 @@ def list_archived_cycles(
project_id: str,
params: dict[str, Any] | None = None,
) -> list[Cycle]:
"""
List archived cycles in a project.

Args:
workspace_slug: The workspace slug identifier
project_id: UUID of the project
params: Optional query parameters as a dictionary

Returns:
List of archived Cycle objects
"""
"""List archived cycles in a project."""
client, workspace_slug = get_plane_client_context()
response: PaginatedArchivedCycleResponse = client.cycles.list_archived(
workspace_slug=workspace_slug, project_id=project_id, params=params
Expand All @@ -198,15 +126,7 @@ def add_work_items_to_cycle(
cycle_id: str,
issue_ids: list[str],
) -> None:
"""
Add work items to a cycle.

Args:
workspace_slug: The workspace slug identifier
project_id: UUID of the project
cycle_id: UUID of the cycle
issue_ids: List of work item IDs to add to the cycle
"""
"""Add work items to a cycle."""
client, workspace_slug = get_plane_client_context()
client.cycles.add_work_items(
workspace_slug=workspace_slug,
Expand All @@ -221,15 +141,7 @@ def remove_work_item_from_cycle(
cycle_id: str,
work_item_id: str,
) -> None:
"""
Remove a work item from a cycle.

Args:
workspace_slug: The workspace slug identifier
project_id: UUID of the project
cycle_id: UUID of the cycle
work_item_id: UUID of the work item to remove
"""
"""Remove a work item from a cycle."""
client, workspace_slug = get_plane_client_context()
client.cycles.remove_work_item(
workspace_slug=workspace_slug,
Expand All @@ -244,18 +156,7 @@ def list_cycle_work_items(
cycle_id: str,
params: dict[str, Any] | None = None,
) -> list[WorkItem]:
"""
List work items in a cycle.

Args:
workspace_slug: The workspace slug identifier
project_id: UUID of the project
cycle_id: UUID of the cycle
params: Optional query parameters as a dictionary

Returns:
List of WorkItem objects in the cycle
"""
"""List work items in a cycle."""
client, workspace_slug = get_plane_client_context()
response: PaginatedCycleWorkItemResponse = client.cycles.list_work_items(
workspace_slug=workspace_slug,
Expand All @@ -271,15 +172,7 @@ def transfer_cycle_work_items(
cycle_id: str,
new_cycle_id: str,
) -> None:
"""
Transfer work items from one cycle to another.

Args:
workspace_slug: The workspace slug identifier
project_id: UUID of the project
cycle_id: UUID of the source cycle
new_cycle_id: UUID of the target cycle to transfer issues to
"""
"""Transfer work items from one cycle to another."""
client, workspace_slug = get_plane_client_context()

data = TransferCycleWorkItemsRequest(new_cycle_id=new_cycle_id)
Expand All @@ -293,35 +186,15 @@ def transfer_cycle_work_items(

@mcp.tool()
def archive_cycle(project_id: str, cycle_id: str) -> bool:
"""
Archive a cycle.

Args:
workspace_slug: The workspace slug identifier
project_id: UUID of the project
cycle_id: UUID of the cycle

Returns:
True if the cycle was archived successfully
"""
"""Archive a cycle."""
client, workspace_slug = get_plane_client_context()
return client.cycles.archive(
workspace_slug=workspace_slug, project_id=project_id, cycle_id=cycle_id
)

@mcp.tool()
def unarchive_cycle(project_id: str, cycle_id: str) -> bool:
"""
Unarchive a cycle.

Args:
workspace_slug: The workspace slug identifier
project_id: UUID of the project
cycle_id: UUID of the cycle

Returns:
True if the cycle was unarchived successfully
"""
"""Unarchive a cycle."""
client, workspace_slug = get_plane_client_context()
return client.cycles.unarchive(
workspace_slug=workspace_slug, project_id=project_id, cycle_id=cycle_id
Expand Down
65 changes: 5 additions & 60 deletions plane_mcp/tools/initiatives.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,7 @@ def register_initiative_tools(mcp: FastMCP) -> None:
def list_initiatives(
params: dict[str, Any] | None = None,
) -> list[Initiative]:
"""
List all initiatives in a workspace.

Args:
workspace_slug: The workspace slug identifier
params: Optional query parameters as a dictionary (e.g., per_page, cursor)

Returns:
List of Initiative objects
"""
"""List all initiatives in a workspace."""
client, workspace_slug = get_plane_client_context()
response: PaginatedInitiativeResponse = client.initiatives.list(
workspace_slug=workspace_slug, params=params
Expand All @@ -47,22 +38,7 @@ def create_initiative(
state: InitiativeState | str | None = None,
lead: str | None = None,
) -> Initiative:
"""
Create a new initiative in the workspace.

Args:
workspace_slug: The workspace slug identifier
name: Initiative name
description_html: HTML description of the initiative
start_date: Initiative start date (ISO 8601 format)
end_date: Initiative end date (ISO 8601 format)
logo_props: Logo properties dictionary
state: Initiative state (DRAFT, PLANNED, ACTIVE, COMPLETED, CLOSED)
lead: UUID of the user who leads the initiative

Returns:
Created Initiative object
"""
"""Create a new initiative in the workspace."""
client, workspace_slug = get_plane_client_context()

data = CreateInitiative(
Expand All @@ -79,16 +55,7 @@ def create_initiative(

@mcp.tool()
def retrieve_initiative(initiative_id: str) -> Initiative:
"""
Retrieve an initiative by ID.

Args:
workspace_slug: The workspace slug identifier
initiative_id: UUID of the initiative

Returns:
Initiative object
"""
"""Retrieve an initiative by ID."""
client, workspace_slug = get_plane_client_context()
return client.initiatives.retrieve(
workspace_slug=workspace_slug, initiative_id=initiative_id
Expand All @@ -105,23 +72,7 @@ def update_initiative(
state: InitiativeState | str | None = None,
lead: str | None = None,
) -> Initiative:
"""
Update an initiative by ID.

Args:
workspace_slug: The workspace slug identifier
initiative_id: UUID of the initiative
name: Initiative name
description_html: HTML description of the initiative
start_date: Initiative start date (ISO 8601 format)
end_date: Initiative end date (ISO 8601 format)
logo_props: Logo properties dictionary
state: Initiative state (DRAFT, PLANNED, ACTIVE, COMPLETED, CLOSED)
lead: UUID of the user who leads the initiative

Returns:
Updated Initiative object
"""
"""Update an initiative by ID."""
client, workspace_slug = get_plane_client_context()

data = UpdateInitiative(
Expand All @@ -140,12 +91,6 @@ def update_initiative(

@mcp.tool()
def delete_initiative(initiative_id: str) -> None:
"""
Delete an initiative by ID.

Args:
workspace_slug: The workspace slug identifier
initiative_id: UUID of the initiative
"""
"""Delete an initiative by ID."""
client, workspace_slug = get_plane_client_context()
client.initiatives.delete(workspace_slug=workspace_slug, initiative_id=initiative_id)
Loading