list_archived_cycles
Retrieve all archived cycles for a specific project to review past planning periods and historical data.
Instructions
List archived cycles in a project.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | UUID of the project | |
| params | No | Optional query parameters as a dictionary |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- plane_mcp/tools/cycles.py:167-187 (handler)The handler function for the list_archived_cycles tool. It uses the @mcp.tool() decorator (via FastMCP) and calls client.cycles.list_archived() to retrieve archived cycles from the Plane API, returning the results list.
@mcp.tool() 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 """ client, workspace_slug = get_plane_client_context() response: PaginatedArchivedCycleResponse = client.cycles.list_archived( workspace_slug=workspace_slug, project_id=project_id, params=params ) return response.results - plane_mcp/tools/cycles.py:6-14 (schema)Import of the PaginatedArchivedCycleResponse schema model used by the list_archived_cycles handler as the return type from the API call.
from plane.models.cycles import ( CreateCycle, Cycle, PaginatedArchivedCycleResponse, PaginatedCycleResponse, PaginatedCycleWorkItemResponse, TransferCycleWorkItemsRequest, UpdateCycle, ) - plane_mcp/tools/__init__.py:27-36 (registration)The register_tools function calls register_cycle_tools(mcp) which in turn registers list_archived_cycles (along with all other cycle tools) with the MCP server.
def register_tools(mcp: FastMCP) -> None: """Register all tools with the MCP server.""" register_project_tools(mcp) register_work_item_tools(mcp) register_work_item_activity_tools(mcp) register_work_item_comment_tools(mcp) register_work_item_link_tools(mcp) register_work_item_relation_tools(mcp) register_work_log_tools(mcp) register_cycle_tools(mcp) - plane_mcp/tools/cycles.py:20-21 (registration)The register_cycle_tools function is where the @mcp.tool() decorator registers list_archived_cycles as an MCP tool.
def register_cycle_tools(mcp: FastMCP) -> None: """Register all cycle-related tools with the MCP server.""" - plane_mcp/client.py:21-74 (helper)The get_plane_client_context helper function that provides the PlaneClient and workspace_slug used by list_archived_cycles.
def get_plane_client_context() -> PlaneClientContext: """ Initialize and return a PlaneClient instance with workspace context. Authentication is handled by the PlaneOAuthProvider, which supports: 1. Environment variables (PLANE_API_KEY + PLANE_WORKSPACE_SLUG) 2. HTTP headers (x-api-key + x-workspace-slug) 3. OAuth access token Environment variables: - PLANE_INTERNAL_BASE_URL: Internal URL for Plane API (preferred for server-to-server calls) - PLANE_BASE_URL: Base URL for Plane API (fallback, default: https://api.plane.so) Returns: PlaneClientContext containing configured PlaneClient instance and workspace slug Raises: ConfigurationError: If access token is not available or workspace slug is missing """ base_url = os.getenv("PLANE_INTERNAL_BASE_URL") or os.getenv("PLANE_BASE_URL", "https://api.plane.so") workspace_slug = os.getenv("PLANE_WORKSPACE_SLUG", "") api_key = os.getenv("PLANE_API_KEY", "") access_token = None # Get access token from the OAuth provider (which handles all auth methods) stored_access_token: AccessToken | None = get_access_token() if stored_access_token: # Determine authentication method to use appropriate PlaneClient constructor auth_method = stored_access_token.claims.get("auth_method", "oauth") token = stored_access_token.token workspace_slug = stored_access_token.claims.get("workspace_slug", "") # For API key auth methods, use api_key parameter; for OAuth, use access_token if auth_method in ("api_key_env", "api_key_header"): api_key = token else: access_token = token if access_token: client = PlaneClient( base_url=base_url, access_token=access_token, ) else: client = PlaneClient( base_url=base_url, api_key=api_key, ) return PlaneClientContext( client=client, workspace_slug=workspace_slug, )