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:
@@ -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)'
|
||||
|
||||
Reference in New Issue
Block a user