list_initiatives
Retrieve and filter project initiatives by status, priority, or search terms to manage organizational goals and track progress.
Instructions
List all initiatives with optional filtering
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | No | Filter by project | |
| status | No | Filter by status | |
| priority | No | Filter by priority | |
| search | No | Search initiatives by name or objective | |
| limit | No | Maximum number of initiatives to return |
Implementation Reference
- src/tools/initiatives.ts:93-110 (handler)The primary handler function for the 'list_initiatives' tool. It validates input parameters using Zod, logs the request, fetches initiatives from the Supabase service with optional filters and pagination, and returns a formatted response including the list, total count, and applied filters.export const listInitiatives = requireAuth(async (args: any) => { const { project_id, status, priority, search, limit } = ListInitiativesSchema.parse(args) logger.info('Listing initiatives', { project_id, status, priority, search, limit }) const initiatives = await supabaseService.getInitiatives( { project_id, status, priority, search }, { limit }, { field: 'updated_at', order: 'desc' } ) // The API already returns enriched initiatives with counts return { initiatives: initiatives, total: initiatives.length, filters_applied: { project_id, status, priority, search } } })
- src/tools/initiatives.ts:14-20 (schema)Zod schema defining the input validation for list_initiatives parameters, including optional filters for project, status, priority, search term, and limit.const ListInitiativesSchema = z.object({ project_id: z.string().uuid().optional(), status: z.enum(['planning', 'active', 'on_hold', 'completed', 'cancelled']).optional(), priority: z.enum(['critical', 'high', 'medium', 'low']).optional(), search: z.string().optional(), limit: z.number().int().positive().max(100).default(20) })
- src/tools/initiatives.ts:57-91 (registration)MCPTool registration object for 'list_initiatives', including name, description, and JSON Schema for MCP protocol input validation.export const listInitiativesTool: MCPTool = { name: 'list_initiatives', description: 'List all initiatives with optional filtering', inputSchema: { type: 'object', properties: { project_id: { type: 'string', format: 'uuid', description: 'Filter by project' }, status: { type: 'string', enum: ['planning', 'active', 'on_hold', 'completed', 'cancelled'], description: 'Filter by status' }, priority: { type: 'string', enum: ['critical', 'high', 'medium', 'low'], description: 'Filter by priority' }, search: { type: 'string', description: 'Search initiatives by name or objective' }, limit: { type: 'number', minimum: 1, maximum: 100, default: 20, description: 'Maximum number of initiatives to return' } } } }
- src/index.ts:143-155 (registration)Server constructor registers all handlers by spreading module handlers, including initiativeHandlers which contains list_initiatives, into the server's allHandlers object used for tool execution.this.allHandlers = { ...projectHandlers, ...taskHandlers, ...documentHandlers, ...conversationHandlers, ...contextAggregationHandlers, ...workflowAutomationHandlers, ...intelligentSearchHandlers, ...analyticsInsightsHandlers, ...initiativeHandlers, ...promptToProjectTools.reduce((acc, tool) => ({ ...acc, [tool.name]: tool.handler }), {}), ...debugHandlers, }
- src/index.ts:129-141 (registration)Server constructor registers all tools by spreading module tools, including initiativeTools which contains listInitiativesTool, into the server's allTools list advertised to MCP clients.this.allTools = [ ...Object.values(projectTools), ...Object.values(taskTools), ...Object.values(documentTools), ...Object.values(conversationTools), ...Object.values(contextAggregationTools), ...Object.values(workflowAutomationTools), ...Object.values(intelligentSearchTools), ...Object.values(analyticsInsightsTools), ...Object.values(initiativeTools), ...promptToProjectTools, ...Object.values(debugTools), ]