add_cycle_issues
Add specific issues to a project cycle in Plane by providing the project ID, cycle ID, and issue UUIDs. Streamlines issue management within cycles.
Instructions
Add issues to a cycle
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cycle_id | Yes | The uuid identifier of the cycle to add issues to | |
| issues | Yes | Array of issue UUIDs to add to the cycle | |
| project_id | Yes | The uuid identifier of the project containing the cycle |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"cycle_id": {
"description": "The uuid identifier of the cycle to add issues to",
"type": "string"
},
"issues": {
"description": "Array of issue UUIDs to add to the cycle",
"items": {
"type": "string"
},
"type": "array"
},
"project_id": {
"description": "The uuid identifier of the project containing the cycle",
"type": "string"
}
},
"required": [
"project_id",
"cycle_id",
"issues"
],
"type": "object"
}
Implementation Reference
- src/tools/cycle-issues.ts:38-52 (handler)Handler function that makes a POST request to the Plane API to add the specified issues to the cycle and returns the response as text content.async ({ project_id, cycle_id, issues }) => { const response = await makePlaneRequest( "POST", `workspaces/${process.env.PLANE_WORKSPACE_SLUG}/projects/${project_id}/cycles/${cycle_id}/cycle-issues/`, { issues } ); return { content: [ { type: "text", text: JSON.stringify(response, null, 2), }, ], }; }
- src/tools/cycle-issues.ts:33-37 (schema)Zod input schema defining project_id, cycle_id, and issues (array of strings).{ project_id: z.string().describe("The uuid identifier of the project containing the cycle"), cycle_id: z.string().describe("The uuid identifier of the cycle to add issues to"), issues: z.array(z.string()).describe("Array of issue UUIDs to add to the cycle"), },
- src/tools/cycle-issues.ts:30-53 (registration)Direct registration of the add_cycle_issues tool on the MCP server, including name, description, input schema, and handler function.server.tool( "add_cycle_issues", "Add issues to a cycle", { project_id: z.string().describe("The uuid identifier of the project containing the cycle"), cycle_id: z.string().describe("The uuid identifier of the cycle to add issues to"), issues: z.array(z.string()).describe("Array of issue UUIDs to add to the cycle"), }, async ({ project_id, cycle_id, issues }) => { const response = await makePlaneRequest( "POST", `workspaces/${process.env.PLANE_WORKSPACE_SLUG}/projects/${project_id}/cycles/${cycle_id}/cycle-issues/`, { issues } ); return { content: [ { type: "text", text: JSON.stringify(response, null, 2), }, ], }; } );
- src/tools/index.ts:22-22 (registration)Top-level registration call that invokes registerCycleIssueTools, which includes the add_cycle_issues tool registration.registerCycleIssueTools(server);
- src/common/request-helper.ts:3-36 (helper)Utility function makePlaneRequest used by the handler to perform HTTP requests to the Plane API with authentication and error handling.export async function makePlaneRequest<T>(method: string, path: string, body: any = null): Promise<T> { const hostUrl = process.env.PLANE_API_HOST_URL || "https://api.plane.so/"; const host = hostUrl.endsWith("/") ? hostUrl : `${hostUrl}/`; const url = `${host}api/v1/${path}`; const headers: Record<string, string> = { "X-API-Key": process.env.PLANE_API_KEY || "", }; // Only add Content-Type for non-GET requests if (method.toUpperCase() !== "GET") { headers["Content-Type"] = "application/json"; } try { const config: AxiosRequestConfig = { url, method, headers, }; // Only include body for non-GET requests if (method.toUpperCase() !== "GET" && body !== null) { config.data = body; } const response = await axios(config); return response.data; } catch (error) { if (axios.isAxiosError(error)) { throw new Error(`Request failed: ${error.message}`); } throw error; } }