linear_getWorkflowStates
Retrieve workflow states for a specific team in Linear, with options to include archived states, aiding in project management and task tracking.
Instructions
Get workflow states for a team
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| includeArchived | No | Whether to include archived states (default: false) | |
| teamId | Yes | ID of the team to get workflow states for |
Implementation Reference
- Handler function that implements the core logic for the linear_getWorkflowStates tool, including input validation via type guard and calling the Linear service./** * 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 (schema) for linear_getWorkflowStates, specifying input and output schemas./** * Tool definition for getting workflow states for a team */ 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:72-74 (registration)Registration of the linear_getWorkflowStates handler in the tool handlers map within registerToolHandlers function.// Team tools linear_getTeams: handleGetTeams(linearService), linear_getWorkflowStates: handleGetWorkflowStates(linearService),
- src/tools/type-guards.ts:694-718 (helper)Type guard helper function for validating input arguments to linear_getWorkflowStates tool./** * 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; }