Skip to content

FetchUrlResult

Defined in: packages/tools/src/web/tools.ts:74

fetchUrl’s result. A non-2xx status is a normal outcome here — see FETCH_URL_DESCRIPTION.

content: string

Defined in: packages/tools/src/web/tools.ts:81

The readable content: markdown when the source was HTML, otherwise the decoded text.


contentType: string | null

Defined in: packages/tools/src/web/tools.ts:79

The response’s declared Content-Type, or null when it sent none.


markdown: boolean

Defined in: packages/tools/src/web/tools.ts:83

true when the source was HTML converted to markdown.


redirects: string[]

Defined in: packages/tools/src/web/tools.ts:87

Every URL redirected to, in order. Empty when the request did not redirect.


status: number

Defined in: packages/tools/src/web/tools.ts:77


truncated: boolean

Defined in: packages/tools/src/web/tools.ts:85

true when the body hit the byte cap and the remainder was discarded.


url: string

Defined in: packages/tools/src/web/tools.ts:76

The URL the content actually came from — differs from the request when it redirected.