docs: clarify Field description handling for variadic tool parameters - #4954
Closed
subhashpolisetti wants to merge 1 commit into
Closed
subhashpolisetti wants to merge 1 commit into
subhashpolisetti wants to merge 1 commit into
Conversation
The section covers constraining and describing arguments with Field, and the variadic paragraph mentions only constraints, so the wording reads as though a Field description also reaches a variadic parameter. State that the SDK does not read Field(description=...) for a variadic parameter and name the two supported ways to supply that description.
Merged
Contributor
|
This PR is stale because it has been open for 10 days with no activity. |
4 tasks
Collaborator
|
Thank you, @subhashpolisetti, for identifying this documentation gap, writing the original clarification and example, and verifying the supported alternatives. We have carried your contribution forward in #5223, with the description guidance in its own paragraph and explicit docstring precedence. The replacement PR credits you prominently, and its commit includes you as a co-author using the authorship from your original commit. Closing this draft in favor of #5223 so we can take the clarification through review there. Thank you again for the investigation and contribution. |
jbeckwith-oai
added a commit
that referenced
this pull request
Sep 28, 2026
* docs: clarify descriptions for variadic tool parameters Explain the existing Field description limitation and document supported docstring and Annotated descriptions, including their precedence. Based on Subhash Polisetti's original clarification and example in #4954. Co-authored-by: subhash polisetti <subhashr161347@gmail.com> * docs: explain non-strict variadic keyword tool arguments --------- Co-authored-by: subhash polisetti <subhashr161347@gmail.com>
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
This pull request clarifies how a Pydantic
Fielddescription is handled for variadic tool parameters.The section is titled "Constraining and describing arguments with Pydantic Field" and states that
Fieldadds constraints and descriptions to tool arguments. The variadic paragraph then mentions only constraints, so the wording reads as thoughField(description=...)also reaches a variadic parameter. It does not: onv0.22.2,*scores: Annotated[int, Field(description="Exam scores", ge=0, le=100)]advertises the constraints on each collected value and no parameter description.The added sentence states that the SDK ignores a
descriptionpassed toField(...)on a variadic parameter and names the two supported ways that description is taken, following the guidance given when #4951 was closed.Test plan
v0.22.2that*scores: Annotated[int, "Exam scores", Field(ge=0, le=100)]and a docstring entry alongsideField(ge=0, le=100)each produce the parameter description together with the per-value constraints, and thatField(description=...)alone produces no description.make build-docscompletes with no errors and no new warnings. Generated pages underdocs/ja,docs/ko, anddocs/zhare untouched.make build-docsis the applicable check.Checks
.agents/skills/code-change-verification/scripts/run.sh/reviewbefore submitting this PR