Skip to main content
Glama
magarcia

Linear MCP Server

linear_get_projects

Retrieve and filter project data from Linear's issue tracking system to monitor progress, organize work, and manage team initiatives.

Instructions

Get projects in the organization

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
includeArchivedNoInclude archived projects
limitNoMaximum number of projects to return (default: 50)
statusNoFilter by project status (e.g., 'completed', 'in progress')
teamIdNoFilter projects by team ID

Implementation Reference

  • The main handler function that executes the tool logic: fetches Linear projects optionally filtered by team, status, etc., and returns JSON.
    export const linearGetProjectsHandler: ToolHandler = async args => {
      const params = args as {
        teamId?: string;
        includeArchived?: boolean;
        limit?: number;
        status?: string;
      };
    
      try {
        // Set up query parameters
        const queryParams: {
          first: number;
          includeArchived: boolean;
        } = {
          first: params.limit || 50,
          includeArchived: params.includeArchived || false,
        };
    
        // Fetch projects using the Linear API
        let projectsResponse;
    
        if (params.teamId) {
          // If teamId is provided, fetch projects for that team
          const team = await linearClient.team(params.teamId);
          if (!team) {
            return {
              content: [
                {
                  type: 'text',
                  text: `Error: Team with ID ${params.teamId} not found`,
                },
              ],
              isError: true,
            };
          }
          projectsResponse = await team.projects(queryParams);
        } else {
          // Otherwise, fetch all projects
          projectsResponse = await linearClient.projects(queryParams);
        }
    
        if (!projectsResponse) {
          return {
            content: [
              {
                type: 'text',
                text: 'Error: Failed to fetch projects',
              },
            ],
            isError: true,
          };
        }
    
        // Filter by status if provided
        let projectNodes = projectsResponse.nodes;
        if (params.status && projectNodes.length > 0) {
          const statusFilter = params.status.toLowerCase();
          const filteredProjects = [];
    
          for (const project of projectNodes) {
            const projectStatus = await project.status;
            if (projectStatus) {
              const statusName = await projectStatus.name;
              if (statusName && statusName.toLowerCase() === statusFilter) {
                filteredProjects.push(project);
              }
            }
          }
    
          projectNodes = filteredProjects;
        }
    
        // Extract project data
        const projects = await Promise.all(
          projectNodes.map(async project => {
            const status = await project.status;
    
            // Teams is a connection, fetch the first team (if any)
            const teamsConnection = await project.teams({ first: 1 });
            const team = teamsConnection?.nodes?.[0];
    
            return {
              id: project.id,
              name: project.name,
              description: project.description,
              status: status ? await status.name : null,
              teamId: team ? await team.id : null,
              teamName: team ? await team.name : null,
              startDate: project.startDate,
              targetDate: project.targetDate,
              url: project.url,
              progress: project.progress,
              priority: project.priority,
              color: project.color,
              icon: project.icon,
              createdAt: project.createdAt,
              updatedAt: project.updatedAt,
            };
          })
        );
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(projects),
            },
          ],
        };
      } catch (error) {
        const errorMessage =
          error instanceof Error
            ? error.message
            : typeof error === 'string'
              ? error
              : 'Unknown error occurred';
    
        return {
          content: [
            {
              type: 'text',
              text: `Error: ${errorMessage}`,
            },
          ],
          isError: true,
        };
      }
    };
  • Input schema defining parameters for the linear_get_projects tool: teamId, includeArchived, limit, status.
    inputSchema: {
      type: 'object',
      properties: {
        teamId: {
          type: 'string',
          description: 'Filter projects by team ID',
        },
        includeArchived: {
          type: 'boolean',
          description: 'Include archived projects',
        },
        limit: {
          type: 'number',
          description: 'Maximum number of projects to return (default: 50)',
        },
        status: {
          type: 'string',
          description: "Filter by project status (e.g., 'completed', 'in progress')",
        },
      },
    },
  • Registration of the linear_get_projects tool using registerTool, including name, description, schema, and handler reference.
    export const linearGetProjectsTool = registerTool(
      {
        name: 'linear_get_projects',
        description: 'Get projects in the organization',
        inputSchema: {
          type: 'object',
          properties: {
            teamId: {
              type: 'string',
              description: 'Filter projects by team ID',
            },
            includeArchived: {
              type: 'boolean',
              description: 'Include archived projects',
            },
            limit: {
              type: 'number',
              description: 'Maximum number of projects to return (default: 50)',
            },
            status: {
              type: 'string',
              description: "Filter by project status (e.g., 'completed', 'in progress')",
            },
          },
        },
      },
      linearGetProjectsHandler
    );
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states a read operation ('Get'), implying it's non-destructive, but doesn't cover critical aspects like authentication requirements, rate limits, pagination behavior (beyond the limit parameter), error handling, or return format. This leaves significant gaps for a tool with 4 parameters and no output schema.

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

Conciseness5/5

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

The description is a single, efficient sentence with zero wasted words. It's front-loaded with the core purpose and appropriately sized for a straightforward list tool, making it easy for an agent to parse quickly.

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?

Given the tool's complexity (4 parameters, no annotations, no output schema), the description is inadequate. It doesn't explain what 'projects' entail in this context, how results are structured, or any behavioral constraints. For a list operation with filtering options, more context on output and usage would be necessary for an agent to use it effectively.

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?

The input schema has 100% description coverage, so parameters like includeArchived, limit, status, and teamId are well-documented in the schema itself. The description adds no additional parameter semantics beyond implying a list operation, which is already clear from the name and schema. This meets the baseline for high schema coverage.

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

Purpose4/5

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

The description 'Get projects in the organization' clearly states the verb ('Get') and resource ('projects'), with scope ('in the organization') that distinguishes it from sibling tools like linear_get_project (singular) or linear_get_team_issues. However, it doesn't explicitly differentiate from other list tools like linear_get_teams or linear_get_labels, which follow a similar pattern.

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?

The description provides no guidance on when to use this tool versus alternatives. For example, it doesn't mention when to choose linear_get_projects over linear_get_project_issues or linear_get_team_issues, nor does it specify prerequisites or typical use cases. The agent must infer usage from the name and parameters alone.

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

Install Server

Other Tools

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/magarcia/mcp-server-linearapp'

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