@@ -1091,8 +1091,10 @@ func WithObject(name string, opts ...PropertyOption) ToolOption {
10911091 }
10921092}
10931093
1094- // WithArray adds an array property to the tool schema.
1095- // It accepts property options to configure the array property's behavior and constraints.
1094+ // WithArray returns a ToolOption that adds an array-typed property with the given name to a Tool's input schema.
1095+ // It applies provided PropertyOption functions to configure the property's schema, moves a `required` flag
1096+ // from the property schema into the Tool's InputSchema.Required slice when present, and registers the resulting
1097+ // schema under InputSchema.Properties[name].
10961098func WithArray (name string , opts ... PropertyOption ) ToolOption {
10971099 return func (t * Tool ) {
10981100 schema := map [string ]any {
@@ -1113,8 +1115,9 @@ func WithArray(name string, opts ...PropertyOption) ToolOption {
11131115 }
11141116}
11151117
1116- // WithAny adds a property of any type to the tool schema.
1117- // It accepts property options to configure the property's behavior and constraints.
1118+ // WithAny adds an input property named name with no predefined JSON Schema type to the Tool's input schema.
1119+ // The returned ToolOption applies the provided PropertyOption functions to the property's schema, moves a property-level
1120+ // `required` flag into the Tool's InputSchema.Required list if present, and stores the resulting schema under InputSchema.Properties[name].
11181121func WithAny (name string , opts ... PropertyOption ) ToolOption {
11191122 return func (t * Tool ) {
11201123 schema := map [string ]any {}
@@ -1133,7 +1136,8 @@ func WithAny(name string, opts ...PropertyOption) ToolOption {
11331136 }
11341137}
11351138
1136- // Properties defines the properties for an object schema
1139+ // Properties sets the "properties" map for an object schema.
1140+ // The returned PropertyOption stores the provided map under the schema's "properties" key.
11371141func Properties (props map [string ]any ) PropertyOption {
11381142 return func (schema map [string ]any ) {
11391143 schema ["properties" ] = props
0 commit comments