goose
goose copied to clipboard
fix: Add schema-aware numeric coercion for MCP tool arguments
Some LLMs quote numeric arguments when calling MCP tools (e.g., sending "42" instead of 42), which can cause tool execution failures. This change adds schema-aware coercion that automatically converts string representations of numbers to their proper numeric types, but only when the tool's schema explicitly indicates a parameter should be numeric. The implementation is conservative - if no schema is available, no coercion is performed to avoid accidentally modifying strings that should remain as strings.