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

Closed
opened 2026-02-16 17:41:59 -05:00 by yindo · 3 comments
Owner

Originally created by @chaithanya009 on GitHub (Dec 28, 2025).

Originally assigned to: @rekram1-node on GitHub.

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

Originally created by @chaithanya009 on GitHub (Dec 28, 2025). Originally assigned to: @rekram1-node on GitHub. <img width="1482" height="604" alt="Image" src="https://github.com/user-attachments/assets/861539c3-3d6c-46eb-9f97-86a6652ac4d6" /> ### 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: ```typescript 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
yindo closed this issue 2026-02-16 17:41:59 -05:00
Author
Owner

@zeroaddresss commented on GitHub (Dec 29, 2025):

Also getting this on 1.0.207 on Arch Linux and Ghostty

@zeroaddresss commented on GitHub (Dec 29, 2025): Also getting this on 1.0.207 on Arch Linux and Ghostty
Author
Owner

@baeseokjae commented on GitHub (Dec 30, 2025):

Hi @rekram1-node! I noticed the missing format parameter in the webfetch tool schema. I’d like to fix this by adding it to the definition. May I be assigned to this?

@baeseokjae commented on GitHub (Dec 30, 2025): Hi @rekram1-node! I noticed the missing format parameter in the webfetch tool schema. I’d like to fix this by adding it to the definition. May I be assigned to this?
Author
Owner

@rekram1-node commented on GitHub (Dec 31, 2025):

someone else made a pr for that, merged it a couple days ago, thanks tho!

@rekram1-node commented on GitHub (Dec 31, 2025): someone else made a pr for that, merged it a couple days ago, thanks tho!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3933