list_projects
Retrieve all available lighting projects with optional fixture and scene counts for efficient project management in the LacyLights system.
Instructions
List all available lighting projects
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| includeDetails | No | Include fixture and scene counts |
Input Schema (JSON Schema)
{
"properties": {
"includeDetails": {
"default": false,
"description": "Include fixture and scene counts",
"type": "boolean"
}
},
"type": "object"
}
Implementation Reference
- src/tools/project-tools.ts:32-67 (handler)The async listProjects method in ProjectTools class that implements the core logic for listing projects: parses input args, conditionally queries GraphQL for projects with/without counts based on includeDetails, maps results to response format, handles errors.async listProjects(args: z.infer<typeof ListProjectsSchema>) { const { includeDetails } = ListProjectsSchema.parse(args); try { if (includeDetails) { // Use efficient count query const projects = await this.graphqlClient.getProjectsWithCounts(); return { projects: projects.map(project => ({ id: project.id, name: project.name, description: project.description, createdAt: project.createdAt, updatedAt: project.updatedAt, fixtureCount: project.fixtureCount, sceneCount: project.sceneCount, cueListCount: project.cueListCount })), totalProjects: projects.length }; } // Lightweight query without counts const projects = await this.graphqlClient.getProjects(); return { projects: projects.map(project => ({ id: project.id, name: project.name, description: project.description })), totalProjects: projects.length }; } catch (error) { throw new Error(`Failed to list projects: ${error}`); } }
- src/tools/project-tools.ts:5-7 (schema)Zod schema defining the input parameters for the listProjects tool: optional boolean includeDetails.const ListProjectsSchema = z.object({ includeDetails: z.boolean().default(false).describe('Include fixture and scene counts') });
- src/index.ts:1790-1802 (registration)Registration in CallToolRequestSchema handler: switch case for "list_projects" that calls projectTools.listProjects and formats response.case "list_projects": return { content: [ { type: "text", text: JSON.stringify( await this.projectTools.listProjects(args as any), null, 2, ), }, ], };
- src/index.ts:72-95 (registration)Tool definition in ListToolsRequestSchema handler: specifies name, description, and inputSchema for "list_projects".{ name: "list_projects", description: `List all projects with optional detail level. Parameters: - includeDetails: When true, includes resource counts for each project. Default false. Returns: - Basic info (id, name, description) always - Resource counts (fixtureCount, sceneCount, cueListCount) when includeDetails=true Use includeDetails=false for quick project listing. Use includeDetails=true when you need to understand project sizes.`, inputSchema: { type: "object", properties: { includeDetails: { type: "boolean", default: false, description: "Include fixture/scene/cue counts", }, }, }, },