linear_getWorkflowStates
Retrieve workflow states for a Linear team to understand project statuses and manage issue progression.
Instructions
Get workflow states for a team
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| teamId | Yes | ID of the team to get workflow states for | |
| includeArchived | No | Whether to include archived states (default: false) |
Implementation Reference
- Handler function that implements the core logic of the linear_getWorkflowStates tool. Validates arguments using type guard and delegates to LinearService.getWorkflowStates./** * Handler for getting workflow states for a team */ export function handleGetWorkflowStates(linearService: LinearService) { return async (args: unknown) => { try { if (!isGetWorkflowStatesArgs(args)) { throw new Error("Invalid arguments for getWorkflowStates"); } return await linearService.getWorkflowStates( args.teamId, args.includeArchived || false ); } catch (error) { logError("Error getting workflow states", error); throw error; } };
- MCP tool definition specifying name, description, input_schema (teamId required, includeArchived optional boolean), and output_schema for workflow state objects.*/ export const getWorkflowStatesToolDefinition: MCPToolDefinition = { name: "linear_getWorkflowStates", description: "Get workflow states for a team", input_schema: { type: "object", properties: { teamId: { type: "string", description: "ID of the team to get workflow states for", }, includeArchived: { type: "boolean", description: "Whether to include archived states (default: false)", }, }, required: ["teamId"], }, output_schema: { type: "array", items: { type: "object", properties: { id: { type: "string" }, name: { type: "string" }, type: { type: "string" }, position: { type: "number" }, color: { type: "string" }, description: { type: "string" } } } } };
- src/tools/handlers/index.ts:60-61 (registration)Registration of the linear_getWorkflowStates handler within the registerToolHandlers function's return object.linear_getTeams: handleGetTeams(linearService), linear_getWorkflowStates: handleGetWorkflowStates(linearService),
- src/tools/type-guards.ts:513-536 (helper)Type guard helper function used by the handler to validate input arguments for teamId (string, required) and includeArchived (boolean, optional).* Type guard for linear_getWorkflowStates tool arguments */ export function isGetWorkflowStatesArgs(args: unknown): args is { teamId: string; includeArchived?: boolean; } { if ( typeof args !== "object" || args === null || !("teamId" in args) || typeof (args as { teamId: string }).teamId !== "string" ) { return false; } if ( "includeArchived" in args && typeof (args as { includeArchived: boolean }).includeArchived !== "boolean" ) { return false; } return true; }
- src/tools/definitions/index.ts:54-56 (registration)Inclusion of the linear_getWorkflowStates tool definition in the allToolDefinitions array for overall tool registration.// Team tools getTeamsToolDefinition, getWorkflowStatesToolDefinition,