Skip to main content
Glama
wkoutre

Linear MCP Server

by wkoutre

linear_addIssueToProject

Add an existing issue to a Linear project to organize and track work within specific initiatives. Provide the issue ID and project ID to link them.

Instructions

Add an existing issue to a project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
issueIdYesID or identifier of the issue to add to the project
projectIdYesID of the project to add the issue to

Implementation Reference

  • Handler function that validates input arguments using type guard and calls the LinearService to add an issue to a project.
    export function handleAddIssueToProject(linearService: LinearService) {
      return async (args: unknown) => {
        try {
          if (!isAddIssueToProjectArgs(args)) {
            throw new Error("Invalid arguments for addIssueToProject");
          }
          
          return await linearService.addIssueToProject(args.issueId, args.projectId);
        } catch (error) {
          logError("Error adding issue to project", error);
          throw error;
        }
      };
    }
  • MCPToolDefinition for linear_addIssueToProject, defining input schema (issueId, projectId) and output schema.
    export const addIssueToProjectToolDefinition: MCPToolDefinition = {
      name: "linear_addIssueToProject",
      description: "Add an existing issue to a project",
      input_schema: {
        type: "object",
        properties: {
          issueId: {
            type: "string",
            description: "ID or identifier of the issue to add to the project",
          },
          projectId: {
            type: "string",
            description: "ID of the project to add the issue to",
          },
        },
        required: ["issueId", "projectId"],
      },
      output_schema: {
        type: "object",
        properties: {
          success: { type: "boolean" },
          issue: {
            type: "object",
            properties: {
              id: { type: "string" },
              identifier: { type: "string" },
              title: { type: "string" },
              project: {
                type: "object",
                properties: {
                  id: { type: "string" },
                  name: { type: "string" }
                }
              }
            }
          }
        }
      }
    };
  • Registration of the linear_addIssueToProject handler in the tool handlers map within registerToolHandlers function.
    linear_updateProject: handleUpdateProject(linearService),
    linear_addIssueToProject: handleAddIssueToProject(linearService),
    linear_getProjectIssues: handleGetProjectIssues(linearService),
  • Type guard function used in the handler to validate input arguments for linear_addIssueToProject.
    /**
     * Type guard for linear_addIssueToProject tool arguments
     */
    export function isAddIssueToProjectArgs(args: unknown): args is {
      issueId: string;
      projectId: string;
    } {
      return (
        typeof args === "object" &&
        args !== null &&
        "issueId" in args &&
        typeof (args as { issueId: string }).issueId === "string" &&
        "projectId" in args &&
        typeof (args as { projectId: string }).projectId === "string"
      );
    }

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