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
TableJSON 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 |
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>;