Fix omitted tool arguments - #3099
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes omitted tool arguments by normalizing absent payloads to {} while preserving validation failures.
Changes:
- Normalizes nil and zero-length arguments.
- Rejects explicit
nulland malformed JSON. - Adds wrapper and
get_meregression coverage.
Show a summary per file
| File | Description |
|---|---|
pkg/inventory/server_tool.go |
Normalizes omitted arguments and centralizes errors. |
pkg/inventory/server_tool_test.go |
Adds table-driven argument handling tests. |
pkg/github/context_tools_test.go |
Verifies get_me accepts omitted arguments. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Balanced
Normalize missing or zero-length tool arguments to an empty object while preserving invalid JSON and required-parameter validation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
SamMorrowDrums
force-pushed
the
sammorrowdrums-optional-tool-arguments
branch
from
August 19, 2026 10:20
1b72832 to
9df1e3b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tools/callarguments as an empty JSON objectnulland malformed JSON invalid while allowing parameterized tools to run their existing required-field validationget_mehandler regression testRationale
The MCP 2026-07-28 schema makes
CallToolRequestParams.argumentsoptional, but constrains it to an object when present. The shared wrapper now supplies{}only when the raw argument bytes are absent. It deliberately does not handle a missingparamsobject, leaving the go-sdk protocol boundary to reject that required field.Validation
script/lintscript/testFixes #2587
This independently authored change supersedes duplicate attempts #2632, #2680, and #2689. No commits were copied or cherry-picked from those branches; this branch starts at
origin/maincommit8395beae410e4fe50c4610e2b354a40d21997f45.