Skip to main content
Glama
wkoutre

Linear MCP Server

by wkoutre

linear_getProjects

Retrieve a list of projects from Linear's project management system to view, organize, and manage team workflows and tasks.

Instructions

Get a list of projects from Linear

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The primary handler function for the 'linear_getProjects' tool. It takes no input arguments (as per schema), calls LinearService.getProjects(), and handles errors by logging and rethrowing.
    export function handleGetProjects(linearService: LinearService) {
      return async (args: unknown) => {
        try {
          return await linearService.getProjects();
        } catch (error) {
          logError("Error getting projects", error);
          throw error;
        }
      };
    }
  • Tool schema definition specifying empty input and detailed output structure for projects including id, name, description, state, teams array, and url.
    export const getProjectsToolDefinition: MCPToolDefinition = {
      name: "linear_getProjects",
      description: "Get a list of projects from Linear",
      input_schema: {
        type: "object",
        properties: {},
      },
      output_schema: {
        type: "array",
        items: {
          type: "object",
          properties: {
            id: { type: "string" },
            name: { type: "string" },
            description: { type: "string" },
            state: { type: "string" },
            teams: {
              type: "array",
              items: {
                type: "object",
                properties: {
                  id: { type: "string" },
                  name: { type: "string" }
                }
              }
            },
            url: { type: "string" }
          }
        }
      }
    };
  • Tool registration mapping the name 'linear_getProjects' to its handler function within the registerToolHandlers export.
    linear_getProjects: handleGetProjects(linearService),
  • Core service method implementing the project fetching logic using Linear client SDK, resolving projects and their teams asynchronously. Called by the tool handler.
    async getProjects() {
      const projects = await this.client.projects();
      return Promise.all(
        projects.nodes.map(async (project) => {
          // We need to fetch teams using the relationship
          const teams = await project.teams();
    
          return {
            id: project.id,
            name: project.name,
            description: project.description,
            state: project.state,
            teams: teams.nodes.map((team) => ({
              id: team.id,
              name: team.name,
            })),
          };
        }),
      );
    }

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

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