linear_getWorkflowStates
Retrieve workflow states for a Linear team to track issue progress and manage project workflows effectively.
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
- The handler function that implements the core logic for the 'linear_getWorkflowStates' tool. It validates the input arguments using the type guard and calls the LinearService to fetch workflow states for the given 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; } }; }
- Defines the MCP tool schema for 'linear_getWorkflowStates', specifying input (teamId required, includeArchived optional) and output schema (array of 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:74-74 (registration)Registers the tool handler 'handleGetWorkflowStates' for the name 'linear_getWorkflowStates' in the registerToolHandlers function.linear_getWorkflowStates: handleGetWorkflowStates(linearService),
- src/tools/type-guards.ts:697-718 (helper)Type guard helper function used in the handler to validate input arguments match the expected schema (teamId: string required, includeArchived?: boolean).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/handlers/index.ts:32-32 (registration)Imports the handleGetWorkflowStates handler function from team-handlers.ts for use in tool registration.import { handleGetTeams, handleGetWorkflowStates } from './team-handlers.js';