Skip to content

[Feature]:工具调用参数检查校验及自动修复增强 #847

Description

@miniceM

When working with LLM tool calls, we frequently encounter malformed JSON in tool call arguments. Common issues include:

  • Markdown code blocks: Arguments wrapped in \json ... `
  • JSON comments: // or /* */ comments that aren't valid JSON
  • Single quotes: Using ' instead of " for strings/keys
  • Missing braces: Incomplete JSON objects
  • Trailing commas: Commas after last element (not valid in strict JSON)

These issues cause the current ChatMessageConverter to fail when parsing tool arguments, requiring manual intervention or rejecting otherwise valid tool calls.

Example problematic inputs:

  ```json
  {"query": "test"} // Simple search

  {'query': 'test',}

  {"query": "test",}

  {"query": "test", “condition”: {"id": "123"}

Implement a robust multi-stage tool argument parser that progressively cleans up malformed JSON before parsing.

Activity

  1. added
    enhancement
    on Mar 2, 2026
  2. changed the title [-][Feature]:[/-] [+][Feature]:工具调用参数检查校验及自动修复增强[/+] on Mar 9, 2026
  3. added
    area/core/tool
    on May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/core/toolenhancement

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions