create_worklog
Generate a new worklog entry for a specific issue in a project, detailing the work performed, duration, and other essential data to track and manage tasks effectively.
Instructions
Create a new worklog for an issue
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issue_id | Yes | The uuid identifier of the issue to create worklog for | |
| project_id | Yes | The uuid identifier of the project containing the issue | |
| worklog_data | Yes | The data for creating the worklog |
Implementation Reference
- src/tools/work-log.ts:66-80 (handler)The async handler function that executes the create_worklog tool by making a POST request to the Plane API with the provided worklog data.async ({ project_id, issue_id, worklog_data }) => { const response = await makePlaneRequest( "POST", `workspaces/${process.env.PLANE_WORKSPACE_SLUG}/projects/${project_id}/issues/${issue_id}/worklogs/`, worklog_data ); return { content: [ { type: "text", text: JSON.stringify(response, null, 2), }, ], }; }
- src/schemas.ts:241-252 (schema)Zod schema definition for IssueWorkLog, used to validate the worklog_data input for the create_worklog tool.export const IssueWorkLog = z.object({ issue_id: z.string().uuid(), description: z.string().optional(), logged_by_id: z.string().uuid(), duration: z.number().int().min(0).describe("The duration of the worklog in minutes"), created_at: z.string().datetime(), updated_at: z.string().datetime(), project_id: z.string().uuid(), workspace_id: z.string().uuid(), }); export type IssueWorkLog = z.infer<typeof IssueWorkLog>;
- src/tools/work-log.ts:54-81 (registration)Direct registration of the create_worklog tool on the MCP server within registerWorkLogTools, including inline schema and handler."create_worklog", "Create a new worklog for an issue", { project_id: z.string().describe("The uuid identifier of the project containing the issue"), issue_id: z.string().describe("The uuid identifier of the issue to create worklog for"), worklog_data: IssueWorkLog.partial() .required({ duration: true, description: true, }) .describe("The data for creating the worklog"), }, async ({ project_id, issue_id, worklog_data }) => { const response = await makePlaneRequest( "POST", `workspaces/${process.env.PLANE_WORKSPACE_SLUG}/projects/${project_id}/issues/${issue_id}/worklogs/`, worklog_data ); return { content: [ { type: "text", text: JSON.stringify(response, null, 2), }, ], }; } );
- src/tools/index.ts:24-24 (registration)Higher-level registration call that invokes registerWorkLogTools to set up the create_worklog tool among others.registerWorkLogTools(server);