Improve documentation for the read_multiple_files
action
#2602
+4
−1
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.
Description
This PR fixes the
read_multiple_files
function to properly handle empty arrays and improves documentation to make the parameter structure self-documenting for AI assistants.Server Details
Motivation and Context
Addresses issue #2032 where the
read_multiple_files
function lacked clear documentation about its parameter structure and behavior, causing AI assistants to use it incorrectly without explicit instruction. The function would accept empty arrays and return empty results without helpful feedback, making it difficult for AI assistants to understand proper usage.How Has This Been Tested?
Breaking Changes
No breaking changes for valid usage. The only change is that empty arrays (which previously returned empty results) now return a clear error message explaining that at least one file path is required.
Types of changes
Checklist
Additional context
Changes made:
.min(1, "At least one file path must be provided")
to reject empty arrays with a clear error message.describe()
to thepaths
parameter explaining the expected format and requirementsBefore this fix:
After this fix:
The fix maintains full backward compatibility for all valid use cases while providing better guidance for incorrect usage.