validate_context
Verify accuracy and completeness of context files for codebase analysis by checking specified validation criteria against project directories.
Instructions
Validate accuracy and completeness of generated context files
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Root directory path | |
| context_path | Yes | Path to context files to validate | |
| checks | No | Validation checks to perform |
Implementation Reference
- src/tools/validate-context.ts:11-29 (handler)The main handler function for the 'validate_context' tool. It takes ValidateContextArgs and returns a standardized MCP content response. Currently implements a placeholder that returns a pending message.export async function validateContext( args: ValidateContextArgs ): Promise<{ content: Array<{ type: string; text: string }> }> { return { content: [ { type: "text", text: JSON.stringify( { message: "Context validation - implementation pending", path: args.path, }, null, 2 ), }, ], }; }
- src/tools/validate-context.ts:5-9 (schema)Type definition for the input arguments of the validateContext handler, matching the tool's inputSchema.interface ValidateContextArgs { path: string; context_path: string; checks?: string[]; }
- src/tools/index.ts:61-62 (registration)Tool dispatch registration in the CallToolRequestSchema handler switch statement, calling the validateContext function.case "validate_context": return await validateContext(args as any);
- src/index.ts:306-328 (registration)Tool metadata registration in the ListToolsRequestSchema response, including name, description, and JSON inputSchema.{ name: "validate_context", description: "Validate accuracy and completeness of generated context files", inputSchema: { type: "object", properties: { path: { type: "string", description: "Root directory path", }, context_path: { type: "string", description: "Path to context files to validate", }, checks: { type: "array", items: { type: "string" }, description: "Validation checks to perform", }, }, required: ["path", "context_path"], }, },
- src/tools/index.ts:17-80 (registration)The registerTools function that sets up the overall tool request handler (CallToolRequestSchema), which dispatches to specific tool handlers based on name.export function registerTools(server: Server) { server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; try { if (!args) { throw new Error("Missing arguments"); } switch (name) { case "analyze_codebase": return await analyzeCodebase(args as any); case "enrich_context": { const result = await enrichContext(args as any); const formatted = formatEnrichedContext(result); return { content: [ { type: "text", text: formatted, }, ], }; } case "generate_context": return await generateContext(args as any); case "update_context": return await updateContext(args as any); case "extract_patterns": return await extractPatterns(args as any); case "analyze_dependencies": return await analyzeDependencies(args as any); case "watch_project": return await watchProject(args as any); case "extract_api_surface": return await extractApiSurface(args as any); case "validate_context": return await validateContext(args as any); default: throw new Error(`Unknown tool: ${name}`); } } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return { content: [ { type: "text", text: `Error executing ${name}: ${errorMessage}`, }, ], isError: true, }; } }); }