create_state
Add a new state to a project in the Plane MCP Server by specifying project ID and state details like color and name. Simplifies project management workflows.
Instructions
Create a new state in a project
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | The uuid identifier of the project to create the state in | |
| state_data | Yes |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"project_id": {
"description": "The uuid identifier of the project to create the state in",
"type": "string"
},
"state_data": {
"additionalProperties": false,
"properties": {
"color": {
"maxLength": 255,
"type": "string"
},
"created_at": {
"format": "date-time",
"type": "string"
},
"created_by": {
"format": "uuid",
"type": "string"
},
"default": {
"type": "boolean"
},
"deleted_at": {
"format": "date-time",
"type": "string"
},
"description": {
"type": "string"
},
"external_id": {
"maxLength": 255,
"type": "string"
},
"external_source": {
"maxLength": 255,
"type": "string"
},
"group": {},
"id": {
"format": "uuid",
"type": "string"
},
"is_triage": {
"type": "boolean"
},
"name": {
"maxLength": 255,
"type": "string"
},
"project": {
"format": "uuid",
"type": "string"
},
"sequence": {
"type": "number"
},
"slug": {
"maxLength": 100,
"pattern": "^[-a-zA-Z0-9_]+$",
"type": "string"
},
"updated_at": {
"format": "date-time",
"type": "string"
},
"updated_by": {
"format": "uuid",
"type": "string"
},
"workspace": {
"format": "uuid",
"type": "string"
}
},
"required": [
"color",
"name"
],
"type": "object"
}
},
"required": [
"project_id",
"state_data"
],
"type": "object"
}
Implementation Reference
- src/tools/metadata.ts:173-199 (registration)Registration of the 'create_state' MCP tool using server.tool(). Includes tool name, description, input schema (project_id and partial StateSchema requiring name, color, group), and inline asynchronous handler that sends a POST request to the Plane API to create the state and returns the JSON response as text content.server.tool( "create_state", "Create a new state in a project", { project_id: z.string().describe("The uuid identifier of the project to create the state in"), state_data: StateSchema.partial().required({ name: true, color: true, group: true, }), }, async ({ project_id, state_data }) => { const response = await makePlaneRequest( "POST", `workspaces/${process.env.PLANE_WORKSPACE_SLUG}/projects/${project_id}/states/`, state_data ); return { content: [ { type: "text", text: JSON.stringify(response, null, 2), }, ], }; } );
- src/schemas.ts:125-145 (schema)Zod schema definition for the State object (exported as StateSchema), used in the input schema for create_state tool to validate state_data.export const State = z.object({ color: z.string().max(255), created_at: z.string().datetime({ offset: true }).readonly(), created_by: z.string().uuid().readonly(), default: z.boolean().optional(), 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(), group: z.any().optional(), id: z.string().uuid().readonly(), is_triage: z.boolean().optional(), name: z.string().max(255), project: z.string().uuid().readonly(), sequence: z.number().optional(), slug: z.string().regex(new RegExp("^[-a-zA-Z0-9_]+$")).max(100).optional(), updated_at: z.string().datetime({ offset: true }).readonly(), updated_by: z.string().uuid().readonly(), workspace: z.string().uuid().readonly(), }); export type State = z.infer<typeof State>;