list_projects
Retrieve all projects from Linear, optionally filtered by team ID, to manage and organize development work programmatically.
Instructions
List all projects
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| teamId | No | Filter by team ID (optional) | |
| first | No | Number of projects to return (default: 50) |
Implementation Reference
- src/index.ts:375-407 (handler)The handler logic for the 'list_projects' tool. Parses arguments, builds filter for teamId, queries Linear projects with pagination, resolves teams for each project, formats output with id, name, description, state, teamIds, and returns as JSON text content.case "list_projects": { const args = request.params.arguments as unknown as ListProjectsArgs; const filter: Record<string, any> = {}; if (args?.teamId) filter.team = { id: { eq: args.teamId } }; const query = await linearClient.projects({ first: args?.first ?? 50, filter, }); const projects = await Promise.all( (query as any).nodes.map(async (project: any) => { const teamsConnection = await project.teams; const teams = teamsConnection ? (teamsConnection as any).nodes : []; return { id: project.id, name: project.name, description: project.description, state: project.state, teamIds: teams.map((team: any) => team.id), }; }) ); return { content: [ { type: "text", text: JSON.stringify(projects, null, 2), }, ], }; }
- src/index.ts:246-249 (schema)TypeScript interface defining the expected input arguments for the list_projects tool: optional teamId and first.type ListProjectsArgs = { teamId?: string; first?: number; };
- src/index.ts:169-185 (registration)Registration of the list_projects tool in the tools list returned by ListToolsRequestSchema, including name, description, and JSON schema for inputs.{ name: "list_projects", description: "List all projects", inputSchema: { type: "object", properties: { teamId: { type: "string", description: "Filter by team ID (optional)", }, first: { type: "number", description: "Number of projects to return (default: 50)", }, }, }, },
- src/index.ts:51-51 (registration)Declaration in server capabilities indicating support for the list_projects tool.list_projects: true,