Skip to content

AI_InvalidToolInputError: Invalid input for tool read. Path: limit #1328

Closed

Description

@esafak
AI_InvalidToolInputError: Invalid input for tool read: Type validation failed: Value:
{"filePath":"/Users/emre/code/langserver/tests/tprojectsetup.nim","offset":"130","limit":
"80"}.
Error message: [
  {
    "code": "invalid_type",
    "expected": "number",
    "received": "string",
    "path": [
      "offset"
    ],
    "message": "Expected number, received string"
  },
  {
    "code": "invalid_type",
    "expected": "number",
    "received": "string",
    "path": [
      "limit"
    ],
    "message": "Expected number, received string"
  }
]

This is on OpenRouter Qwen3 Coder, 0.3.71

Activity

  1. skpulipaka26 commented on Jul 25, 2025

    @skpulipaka26

    I have the same issue.

    Model: Qwen/Qwen3-Coder-480B-A35B-Instruct

    AI_InvalidToolInputError: Invalid input for tool read: Type validation failed: Value:
    {"filePath":"/foo.go","offset":"490"}.
    Error message: [
      {
        "code": "invalid_type",
        "expected": "number",
        "received": "string",
        "path": [
          "offset"
        ],
        "message": "Expected number, received string"
      }
    ]
    
  2. aeramu commented on Jul 26, 2025

    @aeramu

    I have same issue with with Qwen3 Coder. At first it's working but after some progress, he does this a lot. After he does this, in that particular session, he will always does this. Need to create new session or change model halfway through. I don't know if it's Qwen problem for not using the tools properly or the tool should expect both integer and string because of the nature of unpredictability of model

  3. self-assigned this
    on Jul 26, 2025
  4. ryzen3100 commented on Jul 27, 2025

    @ryzen3100

    Same issue here via OpenRouter.

  5. alexispurslane commented on Jul 28, 2025

    @alexispurslane

    I also ran into very similar issues using qwen 3 coder via open router.

  6. changed the title [-]AI_InvalidToolInputError: Invalid input for tool read: Expected number, received string[/-] [+]AI_InvalidToolInputError: Invalid input for tool read. Path: limit[/+] on Jul 28, 2025
  7. thdxr commented on Aug 12, 2025

    @thdxr
    Member

    closing this old issue. openrouter has some low quality providers that don't follow tool schemas properly. suggest going directly to qwen or another provider instead of through openrouter for better reliability. if you're still hitting tool validation errors with a direct provider, open a new issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions