Skip to main content
Glama

get_tasks

Retrieve tasks from Linear with filters like status, assignee, or team to manage workflows efficiently and limit results for focused task tracking.

Instructions

Get tasks from Linear with optional filtering

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assigneeNoFilter by assignee name or ID
limitNoMaximum number of tasks to return (default: 20)
statusNoFilter by status (e.g., "Todo", "In Progress", "Done")
teamNoFilter by team name or ID

Implementation Reference

  • The handler function that implements the core logic of the 'get_tasks' tool. It constructs a filter based on input arguments (status, assignee, team, limit), queries the Linear API for matching issues, fetches additional details for each issue, formats them, and returns a JSON string response.
    private async handleGetTasks(args: any) { const limit = args?.limit || 20; // Build the filter let filter: Record<string, any> = {}; if (args?.status) { // Get workflow states to map status name to ID const workflowStates = await linearClient.workflowStates(); const state = workflowStates.nodes.find( (s) => s.name.toLowerCase() === args.status.toLowerCase() ); if (state) { filter.stateId = { eq: state.id }; } } if (args?.assignee) { const users = await linearClient.users(); const user = users.nodes.find( (u) => u.name.toLowerCase().includes(args.assignee.toLowerCase()) || u.id === args.assignee ); if (user) { filter.assigneeId = { eq: user.id }; } } if (args?.team) { const teams = await linearClient.teams(); const team = teams.nodes.find( (t) => t.name.toLowerCase().includes(args.team.toLowerCase()) || t.id === args.team ); if (team) { filter.teamId = { eq: team.id }; } } // Fetch issues with the filter const issues = await linearClient.issues({ filter, first: limit, }); // Format the response const formattedIssues = await Promise.all( issues.nodes.map(async (issue) => { const assignee = issue.assignee ? await issue.assignee : null; const team = issue.team ? await issue.team : null; const state = issue.state ? await issue.state : null; return { id: issue.id, title: issue.title, description: issue.description, status: state ? state.name : null, assignee: assignee ? assignee.name : null, team: team ? team.name : null, createdAt: issue.createdAt, updatedAt: issue.updatedAt, url: issue.url, }; }) ); return { content: [ { type: 'text', text: JSON.stringify(formattedIssues, null, 2), }, ], }; }
  • The schema definition for the 'get_tasks' tool, including name, description, and input schema specifying optional filter parameters.
    name: 'get_tasks', description: 'Get tasks from Linear with optional filtering', inputSchema: { type: 'object', properties: { status: { type: 'string', description: 'Filter by status (e.g., "Todo", "In Progress", "Done")', }, assignee: { type: 'string', description: 'Filter by assignee name or ID', }, team: { type: 'string', description: 'Filter by team name or ID', }, limit: { type: 'number', description: 'Maximum number of tasks to return (default: 20)', minimum: 1, maximum: 100, }, }, }, },
  • src/index.ts:114-115 (registration)
    The dispatch/registration point where incoming 'get_tasks' tool calls are routed to the handleGetTasks handler.
    case 'get_tasks': return await this.handleGetTasks(request.params.arguments);

Other Tools

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

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