Skip to main content
Glama
makeplane

Plane MCP Server

Official
by makeplane

delete_state

Remove a specific state from a project in Plane MCP Server by providing the project and state UUID identifiers, simplifying state management within project workflows.

Instructions

Delete a state

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesThe uuid identifier of the project containing the state
state_idYesThe uuid identifier of the state to delete

Implementation Reference

  • Registration of the 'delete_state' tool, including input schema (project_id and state_id) and the handler function that executes a DELETE request via makePlaneRequest to delete the state from the project.
    server.tool(
      "delete_state",
      "Delete a 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 delete"),
      },
      async ({ project_id, state_id }) => {
        const response = await makePlaneRequest(
          "DELETE",
          `workspaces/${process.env.PLANE_WORKSPACE_SLUG}/projects/${project_id}/states/${state_id}/`
        );
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(response, null, 2),
            },
          ],
        };
      }
    );
  • Supporting utility function 'makePlaneRequest' that handles HTTP requests to the Plane API using axios, called by the delete_state handler.
    export async function makePlaneRequest<T>(method: string, path: string, body: any = null): Promise<T> {
      const hostUrl = process.env.PLANE_API_HOST_URL || "https://api.plane.so/";
      const host = hostUrl.endsWith("/") ? hostUrl : `${hostUrl}/`;
      const url = `${host}api/v1/${path}`;
      const headers: Record<string, string> = {
        "X-API-Key": process.env.PLANE_API_KEY || "",
      };
    
      // Only add Content-Type for non-GET requests
      if (method.toUpperCase() !== "GET") {
        headers["Content-Type"] = "application/json";
      }
    
      try {
        const config: AxiosRequestConfig = {
          url,
          method,
          headers,
        };
    
        // Only include body for non-GET requests
        if (method.toUpperCase() !== "GET" && body !== null) {
          config.data = body;
        }
    
        const response = await axios(config);
        return response.data;
      } catch (error) {
        if (axios.isAxiosError(error)) {
          throw new Error(`Request failed: ${error.message}`);
        }
        throw error;
      }
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/makeplane/plane-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server