Skip to main content
Glama

linear_searchIssues

Search for issues in Linear using custom filters such as query, team, assignee, project, or state to efficiently find and manage specific tasks.

Instructions

Search for issues with various filters

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assigneeIdNoFilter issues by assignee ID
limitNoMaximum number of issues to return (default: 10)
projectIdNoFilter issues by project ID
queryNoText to search for in issue title or description
statesNoFilter issues by state name (e.g., 'Todo', 'In Progress', 'Done')
teamIdNoFilter issues by team ID

Implementation Reference

  • The handler function that implements the core logic for the 'linear_searchIssues' tool. It performs input validation using the type guard and calls the LinearService to search issues.
    export function handleSearchIssues(linearService: LinearService) { return async (args: unknown) => { try { console.log('searchIssues args:', JSON.stringify(args, null, 2)); if (!isSearchIssuesArgs(args)) { console.error('Invalid arguments for searchIssues'); throw new Error('Invalid arguments for searchIssues'); } console.log('Arguments validated successfully'); return await linearService.searchIssues(args); } catch (error) { logError('Error searching issues', error); throw error; } }; }
  • Defines the MCP tool schema for 'linear_searchIssues', including name, description, input parameters, and output format.
    export const searchIssuesToolDefinition: MCPToolDefinition = { name: 'linear_searchIssues', description: 'Search for issues with various filters', input_schema: { type: 'object', properties: { query: { type: 'string', description: 'Text to search for in issue title or description', }, teamId: { type: 'string', description: 'Filter issues by team ID', }, assigneeId: { type: 'string', description: 'Filter issues by assignee ID', }, projectId: { type: 'string', description: 'Filter issues by project ID', }, states: { type: 'array', items: { type: 'string' }, description: "Filter issues by state name (e.g., 'Todo', 'In Progress', 'Done')", }, limit: { type: 'number', description: 'Maximum number of issues to return (default: 10)', }, }, required: [], }, output_schema: { type: 'array', items: { type: 'object', properties: { id: { type: 'string' }, identifier: { type: 'string' }, title: { type: 'string' }, description: { type: 'string' }, state: { type: 'string' }, priority: { type: 'number' }, estimate: { type: 'number' }, dueDate: { type: 'string' }, team: { type: 'object' }, assignee: { type: 'object' }, project: { type: 'object' }, cycle: { type: 'object' }, parent: { type: 'object' }, labels: { type: 'array', items: { type: 'object', properties: { id: { type: 'string' }, name: { type: 'string' }, color: { type: 'string' }, }, }, }, sortOrder: { type: 'number' }, createdAt: { type: 'string' }, updatedAt: { type: 'string' }, url: { type: 'string' }, }, }, }, };
  • Registers the 'linear_searchIssues' tool by mapping it to the handleSearchIssues handler function within the registerToolHandlers export.
    linear_searchIssues: handleSearchIssues(linearService),
  • Type guard function 'isSearchIssuesArgs' used by the handler to validate and type-check the input arguments for the tool.
    * Type guard for linear_searchIssues tool arguments */ export function isSearchIssuesArgs(args: unknown): args is { query?: string; teamId?: string; assigneeId?: string; projectId?: string; states?: string[]; limit?: number; } { // Check if args is an object if (typeof args !== 'object' || args === null) { console.error('searchIssues args is not an object or is null'); return false; } // Check query if ('query' in args && typeof (args as { query: unknown }).query !== 'string') { console.error('searchIssues query is not a string'); return false; } // Check teamId if ('teamId' in args && typeof (args as { teamId: unknown }).teamId !== 'string') { console.error('searchIssues teamId is not a string'); return false; } // Check assigneeId if ('assigneeId' in args && typeof (args as { assigneeId: unknown }).assigneeId !== 'string') { console.error('searchIssues assigneeId is not a string'); return false; } // Check projectId if ('projectId' in args && typeof (args as { projectId: unknown }).projectId !== 'string') { console.error('searchIssues projectId is not a string'); return false; } // Check states if ('states' in args) { const states = (args as { states: unknown }).states; if (!Array.isArray(states)) { console.error('searchIssues states is not an array'); return false; } // Check that all elements in the array are strings for (let i = 0; i < states.length; i++) { if (typeof states[i] !== 'string') { console.error(`searchIssues states[${i}] is not a string`); return false; } } } // Check limit if ('limit' in args && typeof (args as { limit: unknown }).limit !== 'number') { console.error('searchIssues limit is not a number'); return false; } return true; }

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

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