fix: threshold parameter validation in analyze-complexity

Change threshold parameter in analyze_project_complexity from union type to coerce.number with min/max validation. Fix Invalid type error that occurred with certain input formats. Add test implementation to avoid real API calls and proper tests for parameter validation.
This commit is contained in:
Eyal Toledano
2025-04-09 19:10:20 -04:00
parent 1a15dc310d
commit 571d7628f0
5 changed files with 605 additions and 42 deletions

View File

@@ -33,8 +33,10 @@ export function registerAnalyzeTool(server) {
.describe(
'LLM model to use for analysis (defaults to configured model)'
),
threshold: z
.union([z.number(), z.string()])
threshold: z.coerce
.number()
.min(1)
.max(10)
.optional()
.describe(
'Minimum complexity score to recommend expansion (1-10) (default: 5)'