Skip to main content
Glama
wkoutre

Linear MCP Server

by wkoutre

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
NameRequiredDescriptionDefault
teamIdYesID of the team to get workflow states for
includeArchivedNoWhether 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" }
          }
        }
      }
    }; 
  • Registration of the linear_getWorkflowStates handler within the registerToolHandlers function's return object.
    linear_getTeams: handleGetTeams(linearService),
    linear_getWorkflowStates: handleGetWorkflowStates(linearService),
  • 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;
    } 
  • Inclusion of the linear_getWorkflowStates tool definition in the allToolDefinitions array for overall tool registration.
    // Team tools
    getTeamsToolDefinition,
    getWorkflowStatesToolDefinition,

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so the description must carry the full burden. It does not mention default behavior (e.g., includeArchived defaults to false), rate limits, or pagination. The read-only nature is implied but not explicitly stated.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with no waste. It could be slightly more informative without losing conciseness, but it earns a 4 for efficiency.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is too sparse. It does not explain what workflow states are, the return format, or any defaults. For a simple tool with no output schema, more context is needed for complete understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with descriptions for both parameters. The description adds no extra meaning beyond the schema, achieving the baseline of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get workflow states for a team' clearly states the verb (Get) and resource (workflow states), and the scope (for a team) helps differentiate it from siblings like linear_getTeamLabels.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool vs alternatives (e.g., linear_getIssues or linear_getTeamLabels). The description lacks context for usage decisions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.