Skip to content

[Bug] Incorrect required field in params_json_schema causes tool misuse #3733

Description

@gdisk

Description

When generating params_json_schema for tool definitions, the current implementation incorrectly includes all parameters in the required array, regardless of whether they are truly mandatory.

This behavior may lead to unexpected or erroneous tool-calling behavior in downstream models. For example, the model may be forced to supply values for optional parameters, and in practice it often fills them with fallback values such as empty strings (""), zero (0), or literal "null" strings. This can degrade tool performance and cause hard-to-debug failures in production.

Expected Behavior

Only parameters that are explicitly marked as required should appear in the required field of the generated JSON Schema. Optional parameters should remain absent from the required array and should not be forced by the schema.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions