Improve ambiguity handling in argument processing - #43
Merged
Conversation
Collaborator
|
Looks like
|
diego-ferrand
requested changes
Aug 17, 2026
diego-ferrand
approved these changes
Sep 2, 2026
* Support dual store and data type * Improve status, condition and error policy * Support condition statement and error policy * Variable, command contract and validations * Update hint notes * Contract and others improvements * Contract/spec and improvements --------- Co-authored-by: diego-ferrand <[email protected]>
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.
This pull request introduces a standardized approach for handling tool arguments across multiple managers and patches the MCP argument model to improve payload handling. The main change is the addition of a
normalize_action_argsutility, which ensures consistent parsing of action and argument data, and updates all tool managers to use a singleargumentsparameter. This makes the codebase more robust against variations in client payloads and simplifies argument handling logic.Core infrastructure improvements:
normalize_action_argsand validation utilities totools/utils.pyto standardize and simplify argument parsing for all tool endpoints. This function supports multiple payload formats and ensures all managers receive arguments in a consistent(action, args)tuple.mcp.server.fastmcp.utilities.func_metadata.ArgModelBaseinmain.pyto ensure tools with anargumentsparameter always receive the full payload, even if the client omits theargumentswrapper. This increases compatibility with different client payload styles.Tool manager refactoring:
registerendpoints (ai_scriptless_manager.py,device_manager.py,execution_manager.py,help_manager.py,user_manager.py) to accept a singleargumentsparameter instead of separateactionandargs, and to usenormalize_action_argsfor argument extraction. [1] [2] [3] [4] [5]normalize_action_args. [1] [2] [3] [4] [5]API and documentation consistency:
ai_scriptless_manager.pyto rename parameters fromargumentstocmd_argumentsfor clarity, and updated all related docstrings and dispatch logic to match the new naming and argument handling convention. [1] [2] [3] [4] [5]These changes collectively make the argument handling more robust and maintainable, reducing the risk of errors from inconsistent payloads and simplifying the interface for future tool development.