class Builder {

        private String name;
        private String description;
        private ToolParameters parameters;

        /**
         * Creates a {@link Builder}.
         */
        private Builder() {
        }

        /**
         * Sets the {@code name}.
         * @param name the {@code name}
         * @return {@code this}
         */
        public Builder name(String name) {
            this.name = name;
            return this;
        }

        /**
         * Sets the {@code description}.
         * @param description the {@code description}
         * @return {@code this}
         */
        public Builder description(String description) {
            this.description = description;
            return this;
        }

        /**
         * Sets the {@code parameters}.
         * @param parameters the {@code parameters}
         * @return {@code this}
         */
        public Builder parameters(ToolParameters parameters) {
            this.parameters = parameters;
            return this;
        }

        /**
         * Adds a parameter to the tool.
         * @param name the name of the parameter.
         * @param jsonSchemaProperties the properties of the parameter.
         * @return {@code this}
         */
        public Builder addParameter(String name, JsonSchemaProperty... jsonSchemaProperties) {
            return addParameter(name, asList(jsonSchemaProperties));
        }

        /**
         * Adds a parameter to the tool.
         * @param name the name of the parameter.
         * @param jsonSchemaProperties the properties of the parameter.
         * @return {@code this}
         */
        public Builder addParameter(String name, Iterable<JsonSchemaProperty> jsonSchemaProperties) {
            addOptionalParameter(name, jsonSchemaProperties);
            this.parameters.required().add(name);
            return this;
        }

        /**
         * Adds an optional parameter to the tool.
         * @param name the name of the parameter.
         * @param jsonSchemaProperties the properties of the parameter.
         * @return {@code this}
         */
        public Builder addOptionalParameter(String name, JsonSchemaProperty... jsonSchemaProperties) {
            return addOptionalParameter(name, asList(jsonSchemaProperties));
        }

        /**
         * Adds an optional parameter to the tool.
         * @param name the name of the parameter.
         * @param jsonSchemaProperties the properties of the parameter.
         * @return {@code this}
         */
        public Builder addOptionalParameter(String name, Iterable<JsonSchemaProperty> jsonSchemaProperties) {<FILL_FUNCTION_BODY>}

        /**
         * Returns a {@code ToolSpecification} built from the parameters previously set.
         * @return a {@code ToolSpecification} built with parameters of this {@code ToolSpecification.Builder}
         */
        public ToolSpecification build() {
            return new ToolSpecification(this);
        }
    }

            if (this.parameters == null) {
                this.parameters = ToolParameters.builder().build();
            }

            Map<String, Object> jsonSchemaPropertiesMap = new HashMap<>();
            for (JsonSchemaProperty jsonSchemaProperty : jsonSchemaProperties) {
                jsonSchemaPropertiesMap.put(jsonSchemaProperty.key(), jsonSchemaProperty.value());
            }

            this.parameters.properties().put(name, jsonSchemaPropertiesMap);
            return this;
        
<no_super_class>