update_state
Modify an existing state within a project by specifying its identifier and updating relevant fields such as name, description, or color using the Plane MCP Server.
Instructions
Update an existing state
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | The uuid identifier of the project containing the state | |
| state_data | Yes | The fields to update on the state | |
| state_id | Yes | The uuid identifier of the state to update |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"project_id": {
"description": "The uuid identifier of the project containing the state",
"type": "string"
},
"state_data": {
"additionalProperties": false,
"description": "The fields to update on the state",
"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"
}
},
"type": "object"
},
"state_id": {
"description": "The uuid identifier of the state to update",
"type": "string"
}
},
"required": [
"project_id",
"state_id",
"state_data"
],
"type": "object"
}
Implementation Reference
- src/tools/metadata.ts:209-223 (handler)Handler function that executes the update_state tool by sending a PATCH request to the Plane API to update the specified state with the provided data and returns the JSON response as text content.async ({ project_id, state_id, state_data }) => { const response = await makePlaneRequest( "PATCH", `workspaces/${process.env.PLANE_WORKSPACE_SLUG}/projects/${project_id}/states/${state_id}/`, state_data ); return { content: [ { type: "text", text: JSON.stringify(response, null, 2), }, ], }; }
- src/tools/metadata.ts:204-208 (schema)Input schema validation using Zod for the update_state tool parameters: project_id, state_id, and partial state_data based on StateSchema.{ project_id: z.string().describe("The uuid identifier of the project containing the state"), state_id: z.string().describe("The uuid identifier of the state to update"), state_data: StateSchema.partial().describe("The fields to update on the state"), },
- src/tools/metadata.ts:201-224 (registration)Registration of the 'update_state' tool on the MCP server within registerMetadataTools, including description, input schema, and handler function.server.tool( "update_state", "Update an existing state", { project_id: z.string().describe("The uuid identifier of the project containing the state"), state_id: z.string().describe("The uuid identifier of the state to update"), state_data: StateSchema.partial().describe("The fields to update on the state"), }, async ({ project_id, state_id, state_data }) => { const response = await makePlaneRequest( "PATCH", `workspaces/${process.env.PLANE_WORKSPACE_SLUG}/projects/${project_id}/states/${state_id}/`, state_data ); return { content: [ { type: "text", text: JSON.stringify(response, null, 2), }, ], }; } );
- src/schemas.ts:125-145 (schema)Base Zod schema for State object, imported as StateSchema and used in partial form for update_state input.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>;