Skip to main content
Glama

linear_update_issue

Modify an existing Linear issue by updating its title, description, state, team assignment, priority level, due date, or assignee.

Instructions

Update an existing Linear issue

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assigneeIdNoUser ID to assign the issue to
descriptionNoNew issue description (markdown supported)
dueDateNoNew due date
issueIdYesIssue ID to update
priorityNoNew priority level (0-4), where 0=no priority, 1=urgent, 4=low
stateIdNoNew state ID
teamIdNoNew team ID
titleNoNew issue title

Implementation Reference

  • The handler function that executes the tool logic: validates input, fetches the issue, applies updates using linearClient.updateIssue, awaits related data, and returns the updated issue details or an error response.
    export const linearUpdateIssueHandler: ToolHandler = async args => { const params = args as { issueId: string; title?: string; description?: string; stateId?: string; teamId?: string; assigneeId?: string; priority?: number; dueDate?: string; }; try { // Validate required parameters if (!params.issueId) { return { content: [ { type: 'text', text: 'Error: Issue ID is required', }, ], isError: true, }; } // Check if issue exists const issue = await linearClient.issue(params.issueId); if (!issue) { return { content: [ { type: 'text', text: `Error: Issue with ID ${params.issueId} not found`, }, ], isError: true, }; } // Build update input with proper typing const updateInput: { title?: string; description?: string; stateId?: string; teamId?: string; assigneeId?: string; priority?: number; dueDate?: string; } = {}; // Add optional parameters if provided if (params.title) updateInput.title = params.title; if (params.description) updateInput.description = params.description; if (params.stateId) updateInput.stateId = params.stateId; if (params.teamId) updateInput.teamId = params.teamId; if (params.assigneeId) updateInput.assigneeId = params.assigneeId; if (params.priority !== undefined) updateInput.priority = params.priority; if (params.dueDate) updateInput.dueDate = params.dueDate; // Update the issue const updatePayload = await linearClient.updateIssue(params.issueId, updateInput); if (!updatePayload.success) { return { content: [ { type: 'text', text: 'Error: Failed to update issue', }, ], isError: true, }; } // Get updated issue data with proper awaits const updatedIssue = updatePayload.issue; if (!updatedIssue) { return { content: [ { type: 'text', text: 'Error: Failed to retrieve updated issue data', }, ], isError: true, }; } // Process all issue data const issue_data = await updatedIssue; // Process related objects if they exist const state = await updatedIssue.then(issue => issue.state); const team = await updatedIssue.then(issue => issue.team); const assignee = await updatedIssue.then(issue => issue.assignee); const responseData = { id: issue_data.id, title: issue_data.title, description: issue_data.description, state: state ? await state.name : null, team: team ? await team.name : null, assignee: assignee ? await assignee.name : null, priority: issue_data.priority, url: issue_data.url, }; return { content: [ { type: 'text', text: JSON.stringify(responseData), }, ], }; } 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 the parameters for updating a Linear issue, with issueId required and others optional.
    inputSchema: { type: 'object', properties: { issueId: { type: 'string', description: 'Issue ID to update', }, title: { type: 'string', description: 'New issue title', }, description: { type: 'string', description: 'New issue description (markdown supported)', }, stateId: { type: 'string', description: 'New state ID', }, teamId: { type: 'string', description: 'New team ID', }, assigneeId: { type: 'string', description: 'User ID to assign the issue to', }, priority: { type: 'number', description: 'New priority level (0-4), where 0=no priority, 1=urgent, 4=low', }, dueDate: { type: 'string', description: 'New due date', }, }, required: ['issueId'], },
  • Registers the tool with name 'linear_update_issue', description, input schema, and the handler function.
    export const linearUpdateIssueTool = registerTool( { name: 'linear_update_issue', description: 'Update an existing Linear issue', inputSchema: { type: 'object', properties: { issueId: { type: 'string', description: 'Issue ID to update', }, title: { type: 'string', description: 'New issue title', }, description: { type: 'string', description: 'New issue description (markdown supported)', }, stateId: { type: 'string', description: 'New state ID', }, teamId: { type: 'string', description: 'New team ID', }, assigneeId: { type: 'string', description: 'User ID to assign the issue to', }, priority: { type: 'number', description: 'New priority level (0-4), where 0=no priority, 1=urgent, 4=low', }, dueDate: { type: 'string', description: 'New due date', }, }, required: ['issueId'], }, }, linearUpdateIssueHandler );
  • src/tools/index.ts:3-3 (registration)
    Imports the linear_update_issue tool file to ensure it is registered when index is imported.
    import './linear_update_issue.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/magarcia/mcp-server-linearapp'

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