create_label
Generate new labels within a Plane project to organize and categorize work items. Specify label details like name, color, and project ID for clear project management.
Instructions
Create a new label in a project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| label_data | Yes | ||
| project_id | Yes | The uuid identifier of the project to create the label in |
Implementation Reference
- src/tools/metadata.ts:304-318 (handler)The async handler function for the 'create_label' tool. It sends a POST request to the Plane API to create a new label in the specified project and returns the response as text.async ({ project_id, label_data }) => { const response = await makePlaneRequest( "POST", `workspaces/${process.env.PLANE_WORKSPACE_SLUG}/projects/${project_id}/labels/`, label_data ); return { content: [ { type: "text", text: JSON.stringify(response, null, 2), }, ], }; }
- src/schemas.ts:106-123 (schema)The Zod schema for Label objects (exported as Label, imported as LabelSchema), used to validate the label_data input for create_label.export const Label = z.object({ color: z.string().max(255).optional(), created_at: z.string().datetime({ offset: true }).readonly(), created_by: z.string().uuid().readonly(), deleted_at: z.string().datetime({ offset: true }).readonly(), description: z.string().optional(), external_id: z.string().max(255).optional(), external_source: z.string().max(255).optional(), id: z.string().uuid().readonly(), name: z.string().max(255), parent: z.string().uuid().optional(), project: z.string().uuid().readonly(), sort_order: z.number().optional(), updated_at: z.string().datetime({ offset: true }).readonly(), updated_by: z.string().uuid().readonly(), workspace: z.string().uuid().readonly(), }); export type Label = z.infer<typeof Label>;
- src/tools/metadata.ts:294-319 (registration)The server.tool() call that registers the 'create_label' tool, including its name, description, input schema (using LabelSchema), and inline handler function.server.tool( "create_label", "Create a new label in a project", { project_id: z.string().describe("The uuid identifier of the project to create the label in"), label_data: LabelSchema.partial().required({ name: true, color: true, }), }, async ({ project_id, label_data }) => { const response = await makePlaneRequest( "POST", `workspaces/${process.env.PLANE_WORKSPACE_SLUG}/projects/${project_id}/labels/`, label_data ); return { content: [ { type: "text", text: JSON.stringify(response, null, 2), }, ], }; } );
- src/tools/index.ts:14-14 (registration)Invocation of registerMetadataTools which includes the create_label tool registration.registerMetadataTools(server);
- src/tools/metadata.ts:297-302 (schema)The specific input schema for the create_label tool parameters.{ project_id: z.string().describe("The uuid identifier of the project to create the label in"), label_data: LabelSchema.partial().required({ name: true, color: true, }),