Skip to content

AI_InvalidToolInputError: Invalid input for tool write #1498

Closed

Description

@RanaMoizHaider
AI_InvalidToolInputError: Invalid input for tool write: Type validation failed: Value: {}.
Error message: [
  {
    "code": "invalid_type",
    "expected": "string",
    "received": "undefined",
    "path": [
      "filePath"
    ],
    "message": "Required"
  },
  {
    "code": "invalid_type",
    "expected": "string",
    "received": "undefined",
    "path": [
      "content"
    ],
    "message": "Required"
  }
]

OpenCode v0.3.110
GitHub Copilot - Claude Sonnet 4

Activity

  1. self-assigned this
    on Aug 4, 2025
  2. thdxr commented on Aug 4, 2025

    @thdxr
    Member

    try again in latest

  3. rekram1-node commented on Dec 28, 2025

    @rekram1-node
    Collaborator

    [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

  4. harmeet commented on Feb 23, 2026

    @harmeet

    This issue still exists as of Feb 22, 2026.

    Reproduced with mlx-community/Qwen3-Coder-Next-4bit with mlx_lm.server on Apple M4.

    Error:

    Error: The write tool was called with invalid arguments: [
      {
        "expected": "string",
        "code": "invalid_type",
        "path": [
          "filePath"
        ],
        "message": "Invalid input: expected string, received undefined"
      }
    ].
    Please rewrite the input so it satisfies the expected schema.
    

    Opened a PR with a one-line fix: #14744

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions