refactor/mcptools: split buildCLITools and the capability-request handler into helpers #93
Loading…
Reference in a new issue
No description provided.
Delete branch "refactor/complexity-mcptools"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of #71, the mcptools slice, the two worst functions in the repo. buildCLITools was at Sonar cognitive complexity 55 and the capability-request handler closure at 36. buildCLITools now delegates to ruleDescription, flagToolOption, flagIsBoolean and logSanitizedToolName, and the request handler to handleCapabilityRequest with stringSlice and parseFlagTypes. Flag-type precedence is unchanged, explicit constraint over introspection over name heuristic with string as the default for an unknown valueless flag. Reviewer pass built the full MCP tool schema for a config covering every precedence case on main and on this branch and found the JSON byte-identical, and ran the new request handler tests against main's handler to prove they pin pre-existing behaviour. The handler had no tests before, request_tool_test.go adds them. 🤖 Generated with Claude Code