Skip to content

Write tool called with invalid parameters #18131

Closed as not planned
Closed as not planned

Description

@spotlesscoder

Description

I am experimenting with https://github.com/LarsCowe/bmalph

Model: Qwen 3.5 35B-A3B hosted in LM Studio

At some point during the conversation the below mentioned error message is presented to me

Plugins

how to obtain a list?

OpenCode version

1.2.27

Steps to reproduce

  1. Setup a new git repo with https://github.com/LarsCowe/bmalph
  2. Use the analyst agent
  3. Answer the questions the agent asks you

The next output is

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

Screenshot and/or share link

No response

Operating System

Windows

Terminal

Project Bluefins default terminal

Activity

  1. github-actions commented on Mar 18, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Please review those issues to see if your problem is already tracked there.

  2. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 18, 2026
  3. spotlesscoder commented on Mar 18, 2026

    @spotlesscoder
    Author

    Could be related to #11112 but I'm not sure

  4. darluc commented on Mar 19, 2026

    @darluc
    ✗ write failed
    Error: The write tool was called with invalid arguments: [
      {
        "expected": "string",
        "code": "invalid_type",
        "path": [
          "content"
        ],
        "message": "Invalid input: expected string, received undefined"
      },
      {
        "expected": "string",
        "code": "invalid_type",
        "path": [
          "filePath"
        ],
        "message": "Invalid input: expected string, received undefined"
      }
    ].
    
    

    Same problem. Version: 1.2.27

  5. haoxuanpan commented on Apr 22, 2026

    @haoxuanpan

    Same, Claude 4.6 and Mac

  6. nirolfa commented on Apr 27, 2026

    @nirolfa

    similar issue
    The write tool was called with invalid arguments: SchemaError(Missing key
    at ["content"]).
    Please rewrite the input so it satisfies the expected schema.

    opencode 1.14.28

  7. removed
    bugSomething isn't working
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  8. cliu639 commented on May 4, 2026

    @cliu639

    The skill tool was called with invalid arguments: SchemaError(Missing key
    at ["name"]).
    Please rewrite the input so it satisfies the expected schema.

    Similar issue here

  9. f-g-s commented on May 4, 2026

    @f-g-s
    ~ Preparing write...
    The write tool was called with invalid arguments: SchemaError(Missing key
      at ["filePath"]).
    Please rewrite the input so it satisfies the expected schema.
    

    I am using Opencode, Ollama, VSCode and Qwen 3.5.

  10. striver8 commented on May 18, 2026

    @striver8

    不用zen或go里模型,这个不能写入问题一直存在,没法解决,永远在循环报错

  11. rudy500 commented on May 22, 2026

    @rudy500

    Hi Everyone! I am using opencode 1.15.7, lmstudio and Qwen 3.6 27B and same error.

  12. Rajeshwaran-R commented on May 26, 2026

    @Rajeshwaran-R

    Hi Everyone, Facing the same

    Opencode: 1.15.10
    Model: QWEN 3.5 122B A10B

    From my analysis, Model hallucinate and failed to send tools argument. When I enquired about missing of tools call without argument, it believe, the argument was sent in the tool call response. But the argument was missing. I tried to handle this via system prompt, didn't help.

    seeking for a help. Thanks.

  13. nikhilkulkarni1755 commented on Jun 1, 2026

    @nikhilkulkarni1755

    Opened a PR that should help with this — #30224. When the model sends wrong argument keys (e.g. fileContent instead of content), the error fed back now tells it which keys it should have used vs what it sent, so it can self-correct on the next turn instead of hitting the retry limit.

  14. github-actions commented on Aug 1, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  15. AlieNiT commented on Oct 11, 2026

    @AlieNiT

    I'm still experiencing the same issue.

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