Skip to main content
Glama

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
NameRequiredDescriptionDefault
teamIdYesID of the team to get workflow states for
includeArchivedNoWhether 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' }, }, }, }, };
  • Registers the tool handler 'handleGetWorkflowStates' for the name 'linear_getWorkflowStates' in the registerToolHandlers function.
    linear_getWorkflowStates: handleGetWorkflowStates(linearService),
  • 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; }
  • Imports the handleGetWorkflowStates handler function from team-handlers.ts for use in tool registration.
    import { handleGetTeams, handleGetWorkflowStates } from './team-handlers.js';

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/tacticlaunch/mcp-linear'

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