Skip to content

fix(mcp): handle string-typed numeric params in intArg#123

Open
todie wants to merge 1 commit intoGentleman-Programming:mainfrom
todie:fix/intarg-string-parsing
Open

fix(mcp): handle string-typed numeric params in intArg#123
todie wants to merge 1 commit intoGentleman-Programming:mainfrom
todie:fix/intarg-string-parsing

Conversation

@todie
Copy link
Copy Markdown

@todie todie commented Mar 25, 2026

Summary

  • intArg() only type-asserted to float64, silently returning 0 when the MCP transport sent numeric params as strings
  • This caused "id is required" errors on mem_update, mem_delete, and mem_timeline
  • Added strconv.Atoi fallback via type switch so both float64 and string representations are handled

Test plan

  • Existing TestHandleUpdateAcceptsAllOptionalFields passes
  • Verify mem_update, mem_delete, mem_timeline work when id arrives as string

🤖 Generated with Claude Code

The intArg helper only type-asserted to float64, which silently failed
when the MCP transport sent numeric params as strings. This caused
"id is required" errors on mem_update, mem_delete, and mem_timeline.

Add strconv.Atoi fallback via type switch so both float64 and string
representations are handled correctly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@todie todie force-pushed the fix/intarg-string-parsing branch from 57ffc60 to ea53bdd Compare March 25, 2026 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant