mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-03 05:45:04 +03:00
The omniroute_web_fetch input schema (#4510) used z.string().min(1, "URL is required") for the url field, but .min() only fires for an empty string. A MISSING url (webFetchInput.parse({})) fails the z.string() type check first and emitted the default Zod v4 message ("expected string, received undefined"), so the existing test 'webFetchInput rejects missing URL' (expecting /URL is required/) failed on the full unit suite — a latent base red on release/v3.8.33. Add the custom message to the type check: z.string({ error: "URL is required" }). Now both the missing-field and empty-string cases emit 'URL is required'; a valid url still passes. No other web_fetch behavior changes. Co-authored-by: Diego Rodrigues de Sa e Souza <diego.souza@cdwasolutions.com.br> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
2b21bb60d9
commit
4d3a9fd3df
@@ -462,7 +462,7 @@ export const webSearchTool: McpToolDefinition<typeof webSearchInput, typeof webS
|
||||
// --- Tool 10: omniroute_web_fetch ---
|
||||
export const webFetchInput = z.object({
|
||||
url: z
|
||||
.string()
|
||||
.string({ error: "URL is required" })
|
||||
.min(1, "URL is required")
|
||||
.describe("The URL to fetch content from"),
|
||||
provider: z
|
||||
|
||||
Reference in New Issue
Block a user