FetchJsonOpts
Options for ToolContext.fetchJson. Supply schema (as part of the
call, not this base type) to validate and type the result via z.infer.
Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
errorMap? | (res: Response, body: string) => ToolError | undefined | Map a non-2xx response to a custom ToolError, given the response and its already-read body text (so the upstream’s own error message can be surfaced). Return undefined to fall back to the default status mapping. |
init? | RequestInit | Standard fetch init (method, headers, body). |