opencode icon indicating copy to clipboard operation
opencode copied to clipboard

[BUG] webfetch tool schema missing required 'format' parameter

Open chaithanya009 opened this issue 1 day ago • 0 comments

Image

Description

The webfetch tool schema exposed to LLMs is missing the required format parameter. When the LLM calls webfetch without specifying format, the tool fails with a validation error.

Error message:

Invalid option: expected one of "text"|"markdown"|"html"

Root cause: The tool definition in webfetch.ts defines format as a required parameter:

format: z.enum(["text", "markdown", "html"])
  .describe("The format to return the content in")

However, the schema exposed to the LLM only includes:

  • url (required)
  • timeout (optional)

The format parameter is missing from the schema definition given to the model.

OpenCode version

1.0.204

Steps to reproduce

  1. Start OpenCode
  2. Ask it to fetch a URL (e.g., "fetch https://opencode.ai/docs")
  3. Observe the validation error about missing format parameter

Operating System

macOS

Terminal

Ghostty

chaithanya009 avatar Dec 28 '25 10:12 chaithanya009