linear_getProjects
Retrieve a list of projects from Linear to manage tasks and track progress. This tool integrates with the Linear project management system for streamlined access to project details.
Instructions
Get a list of projects from Linear
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- Handler function that executes the linear_getProjects tool, wrapping the LinearService.getProjects() call with error handling.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 including input (empty) and output schema for projects list with details like id, name, teams, etc.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' }, content: { type: 'string' }, state: { type: 'string' }, teams: { type: 'array', items: { type: 'object', properties: { id: { type: 'string' }, name: { type: 'string' }, }, }, }, url: { type: 'string' }, }, }, }, };
- src/services/linear-service.ts:78-98 (helper)LinearService method that fetches projects from Linear API using GraphQL client, resolves teams for each project, and formats the response.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, content: project.content, state: project.state, teams: teams.nodes.map((team) => ({ id: team.id, name: team.name, })), }; }), ); }
- src/tools/handlers/index.ts:77-77 (registration)Registration of the linear_getProjects tool handler in the registerToolHandlers function, mapping the tool name to the handler.linear_getProjects: handleGetProjects(linearService),