Skip to content

Improve tool-call error feedback for faster model self-correction #819

@harry-xm

Description

@harry-xm

What feature would you like to see?

Problem

When a model sends a tool call with wrong arguments (e.g. typo in property name), the error message it gets back is too terse to self-correct efficiently. The model burns a full round-trip per attempt, often repeating the same mistake multiple times before converging on the right argument names or giving up.

In a sample session the LLM model repeatedly sent offset/limit to Read (which expects line_offset/n_lines) because the error (e.g. must NOT have additional property 'offset') didn't hint at what the valid properties are.

Proposed changes

For each category of JSON Schema validation error, include actionable hints:

  • Unknown property — currently reports the offending property name only.
    Should also list the valid property names declared in the schema, e.g.:
    must NOT have additional property 'offset'; valid properties: path, line_offset, n_lines

  • Missing required property — currently reports which property is missing.
    Should also include the expected type if the schema declares it, e.g.:
    must have required property 'path' (expected string)

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    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