Skip to content

fix: accept empty/missing arguments for zero-param tools (get_me)#2607

Closed
advancedresearcharray wants to merge 1 commit into
github:mainfrom
advancedresearcharray:fix/get-me-empty-arguments-2587
Closed

fix: accept empty/missing arguments for zero-param tools (get_me)#2607
advancedresearcharray wants to merge 1 commit into
github:mainfrom
advancedresearcharray:fix/get-me-empty-arguments-2587

Conversation

@advancedresearcharray
Copy link
Copy Markdown

@advancedresearcharray advancedresearcharray commented Jun 4, 2026

Summary

  • Treat nil or empty arguments on tools/call as {} before JSON unmarshaling
  • Fixes get_me and other zero-parameter tools when clients omit arguments entirely

Fixes #2587

Test plan

  • go test ./pkg/inventory/...
  • TestNewServerToolWithContextHandler_EmptyArguments_TreatedAsEmptyObject (nil, empty byte slice, explicit {})

@advancedresearcharray advancedresearcharray requested a review from a team as a code owner June 4, 2026 22:11
@advancedresearcharray advancedresearcharray force-pushed the fix/get-me-empty-arguments-2587 branch from fa5f70b to 5f73549 Compare June 5, 2026 19:39
Copy link
Copy Markdown

@King-la141 King-la141 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

King

@advancedresearcharray advancedresearcharray force-pushed the fix/get-me-empty-arguments-2587 branch 7 times, most recently from 26acf46 to ece6db2 Compare June 6, 2026 19:32
When clients omit the arguments field on tools/call, the typed tool wrapper
received nil RawMessage and failed JSON unmarshaling before the handler ran.
Treat nil or empty arguments as {} so zero-parameter tools work as documented.

Closes github#2587
@advancedresearcharray advancedresearcharray force-pushed the fix/get-me-empty-arguments-2587 branch from ece6db2 to 29b57da Compare June 6, 2026 19:33
@advancedresearcharray
Copy link
Copy Markdown
Author

Closing as duplicate of #2632, which includes the same fix plus integration coverage for get_me with omitted arguments.

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.

bug: get_me tool fails without parameters due to empty JSON object {} not being accepted as valid input

2 participants