Skip to content

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

Open
advancedresearcharray wants to merge 2 commits into
github:mainfrom
advancedresearcharray:fix/get-me-empty-arguments-2587
Open

fix: accept empty/missing arguments for zero-param tools (get_me)#2607
advancedresearcharray wants to merge 2 commits 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 from 5f73549 to 1af8d2b Compare June 6, 2026 04:19
Treat nil or empty Arguments JSON as {} before unmarshaling so clients
that omit arguments work with tools that have empty input schemas.

Add table-driven tests covering nil, empty byte slice, and explicit {}.

Fixes github#2587
@advancedresearcharray advancedresearcharray force-pushed the fix/get-me-empty-arguments-2587 branch 3 times, most recently from 31ff4c5 to 8178649 Compare June 6, 2026 05:15
Add an integration test that exercises the full get_me handler path when
clients omit the arguments field, matching the failure mode in github#2587.
@advancedresearcharray advancedresearcharray force-pushed the fix/get-me-empty-arguments-2587 branch from 8178649 to d163e4b Compare June 6, 2026 05:15
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