Natural Language Query
Process natural language queries to retrieve project and task information from the Project Tracker MCP Server. Ask questions like "Show me John's overdue tasks" to get relevant data.
Instructions
Process natural language queries with enhanced entity discovery and intelligent analysis
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | Natural language query (e.g., "Show me John's overdue tasks") |
Implementation Reference
- MCP tool definition including name, Zod input schema, description, and handler function that executes the natural language query processing logicexport const naturalLanguageQueryTool = { name: 'Natural Language Query', description: 'Process natural language queries with enhanced entity discovery and intelligent analysis', parameters: z.object({ prompt: z .string() .min(5, 'Prompt must be at least 5 characters') .max(500, 'Prompt must be less than 500 characters') .describe( 'Natural language query (e.g., "Show me Sarah\'s overdue tasks", "Analyze project health")', ), }), handler: async ({ prompt }: { prompt: string }) => { const processor = new NaturalLanguageQueryProcessor(process.env.MCP_DEBUG_MODE === 'true'); const result = await processor.processQuery(prompt); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }, };
- Zod-based input schema definition for the tool parametersparameters: z.object({ prompt: z .string() .min(5, 'Prompt must be at least 5 characters') .max(500, 'Prompt must be less than 500 characters') .describe( 'Natural language query (e.g., "Show me Sarah\'s overdue tasks", "Analyze project health")', ), }),
- src/mcp/tools/index.ts:11-16 (registration)Registration of the Natural Language Query tool in the mcpTools array exported for use by the MCP serverimport { naturalLanguageQueryTool } from './natural_language_query'; import { workloadAnalysisTool } from './workload_analysis'; import { riskAssessmentTool } from './risk_assessment'; // EXPANSION: Consolidated tool registry for MCP server export const mcpTools = [naturalLanguageQueryTool, workloadAnalysisTool, riskAssessmentTool];
- src/mcp/server.ts:76-88 (registration)Tool-specific schema provided in server for tool listing response (fallback/JSON schema)case 'Natural Language Query': return { type: 'object', properties: { prompt: { type: 'string', description: 'Natural language query (e.g., "Show me John\'s overdue tasks")', minLength: 5, maxLength: 500, }, }, required: ['prompt'], };