summaryrefslogtreecommitdiffhomepage
path: root/packages
diff options
context:
space:
mode:
authorsamcornor <[email protected]>2025-12-29 21:53:12 +0000
committerGitHub <[email protected]>2025-12-29 15:53:12 -0600
commitfd973d242e3045a8dbc76c07c796fe175a721ea0 (patch)
treeeef89e50bd0ffaddd2375fb0fb6b1f03f011173f /packages
parentc3d86727539b8afdb1882b814f2a345ee0240822 (diff)
downloadopencode-fd973d242e3045a8dbc76c07c796fe175a721ea0.tar.gz
opencode-fd973d242e3045a8dbc76c07c796fe175a721ea0.zip
fix(webfetch): make format parameter optional with markdown default (#6345)
Co-authored-by: Somair Ansar <[email protected]>
Diffstat (limited to 'packages')
-rw-r--r--packages/opencode/src/tool/webfetch.ts3
-rw-r--r--packages/opencode/src/tool/webfetch.txt8
2 files changed, 6 insertions, 5 deletions
diff --git a/packages/opencode/src/tool/webfetch.ts b/packages/opencode/src/tool/webfetch.ts
index 0333bb018..cf1940bf8 100644
--- a/packages/opencode/src/tool/webfetch.ts
+++ b/packages/opencode/src/tool/webfetch.ts
@@ -15,7 +15,8 @@ export const WebFetchTool = Tool.define("webfetch", {
url: z.string().describe("The URL to fetch content from"),
format: z
.enum(["text", "markdown", "html"])
- .describe("The format to return the content in (text, markdown, or html)"),
+ .default("markdown")
+ .describe("The format to return the content in (text, markdown, or html). Defaults to markdown."),
timeout: z.number().describe("Optional timeout in seconds (max 120)").optional(),
}),
async execute(params, ctx) {
diff --git a/packages/opencode/src/tool/webfetch.txt b/packages/opencode/src/tool/webfetch.txt
index c5d1e7da2..169aadefa 100644
--- a/packages/opencode/src/tool/webfetch.txt
+++ b/packages/opencode/src/tool/webfetch.txt
@@ -1,13 +1,13 @@
- Fetches content from a specified URL
-- Takes a URL and a prompt as input
-- Fetches the URL content, converts HTML to markdown
-- Returns the model's response about the content
+- Takes a URL and optional format as input
+- Fetches the URL content, converts to requested format (markdown by default)
+- Returns the content in the specified format
- Use this tool when you need to retrieve and analyze web content
Usage notes:
- IMPORTANT: if another tool is present that offers better web fetching capabilities, is more targeted to the task, or has fewer restrictions, prefer using that tool instead of this one.
- The URL must be a fully-formed valid URL
- HTTP URLs will be automatically upgraded to HTTPS
- - The prompt should describe what information you want to extract from the page
+ - Format options: "markdown" (default), "text", or "html"
- This tool is read-only and does not modify any files
- Results may be summarized if the content is very large