create_issue_type
Create a new issue type in a specified project using Plane MCP Server, enabling efficient project management with customizable issue categories.
Instructions
Create a new issue type in a project
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issue_type_data | Yes | ||
| project_id | Yes | The uuid identifier of the project to create the issue type in |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"issue_type_data": {
"additionalProperties": false,
"properties": {
"created_at": {
"format": "date-time",
"type": "string"
},
"created_by": {
"format": "uuid",
"type": "string"
},
"deleted_at": {
"format": "date-time",
"type": "string"
},
"description": {
"type": "string"
},
"external_id": {
"maxLength": 255,
"type": "string"
},
"external_source": {
"maxLength": 255,
"type": "string"
},
"id": {
"format": "uuid",
"type": "string"
},
"is_active": {
"type": "boolean"
},
"is_default": {
"type": "boolean"
},
"level": {
"type": "integer"
},
"logo_props": {},
"name": {
"maxLength": 255,
"type": "string"
},
"project_ids": {
"items": {
"format": "uuid",
"type": "string"
},
"type": "array"
},
"updated_at": {
"format": "date-time",
"type": "string"
},
"updated_by": {
"format": "uuid",
"type": "string"
},
"workspace": {
"format": "uuid",
"type": "string"
}
},
"required": [
"description",
"name"
],
"type": "object"
},
"project_id": {
"description": "The uuid identifier of the project to create the issue type in",
"type": "string"
}
},
"required": [
"project_id",
"issue_type_data"
],
"type": "object"
}
Implementation Reference
- src/tools/metadata.ts:63-77 (handler)The async handler function that makes a POST request to the Plane API to create an issue type and returns the JSON response as text content.async ({ project_id, issue_type_data }) => { const response = await makePlaneRequest( "POST", `workspaces/${process.env.PLANE_WORKSPACE_SLUG}/projects/${project_id}/issue-types/`, issue_type_data ); return { content: [ { type: "text", text: JSON.stringify(response, null, 2), }, ], }; }
- src/schemas.ts:86-104 (schema)Zod schema for IssueTypeAPI (imported as IssueTypeSchema), defining the structure of issue type data used in the tool's input validation for issue_type_data.export const IssueTypeAPI = z.object({ 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(), is_active: z.boolean().optional(), is_default: z.boolean().readonly(), level: z.number().int().readonly(), logo_props: z.any().readonly(), name: z.string().max(255), project_ids: z.array(z.string().uuid()).optional(), updated_at: z.string().datetime({ offset: true }).readonly(), updated_by: z.string().uuid().readonly(), workspace: z.string().uuid().readonly(), }); export type IssueTypeAPI = z.infer<typeof IssueTypeAPI>;
- src/tools/metadata.ts:53-78 (registration)MCP server.tool registration for 'create_issue_type', specifying name, description, input schema, and handler function.server.tool( "create_issue_type", "Create a new issue type in a project", { project_id: z.string().describe("The uuid identifier of the project to create the issue type in"), issue_type_data: IssueTypeSchema.partial().required({ name: true, description: true, }), }, async ({ project_id, issue_type_data }) => { const response = await makePlaneRequest( "POST", `workspaces/${process.env.PLANE_WORKSPACE_SLUG}/projects/${project_id}/issue-types/`, issue_type_data ); return { content: [ { type: "text", text: JSON.stringify(response, null, 2), }, ], }; } );
- src/common/request-helper.ts:3-36 (helper)Utility function makePlaneRequest used by the handler to perform authenticated HTTP requests to the Plane API.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; } }