webfetch

package
v0.0.0-beta Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package webfetch provides a tool for fetching web pages and converting them to markdown.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Inputs

type Inputs struct {
	// URL is the web page to fetch.
	URL string `json:"url" jsonschema:"required,description=URL to fetch (http/https only)" validate:"required,url"`
	// Format is the output format: markdown (default), text, or html.
	Format string `` /* 129-byte string literal not displayed */
}

Inputs defines the parameters for the WebFetch tool.

type Tool

type Tool struct {
	tool.Base
	// contains filtered or unexported fields
}

Tool implements web page fetching with HTML-to-markdown conversion.

func New

func New(maxBodySize int64) *Tool

New creates a WebFetch tool with the given body size limit.

func (*Tool) Execute

func (t *Tool) Execute(ctx context.Context, args map[string]any) (string, error)

Execute fetches a URL and returns its content in the requested format.

func (*Tool) Name

func (t *Tool) Name() string

Name returns the tool's identifier.

func (*Tool) Sandboxable

func (t *Tool) Sandboxable() bool

Sandboxable returns false because the tool makes network calls.

func (*Tool) Schema

func (t *Tool) Schema() tool.Schema

Schema returns the provider-agnostic tool definition.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL