webfetch

package
v0.1.8-rc.7 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: Apache-2.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package webfetch provides a URL content fetcher for agents. This is a critical fallback when web_search is unavailable — agents can directly fetch and read content from known URLs. The tool fetches a webpage via HTTP and returns a simplified text/markdown representation.

Problem: Agents often need to read documentation, API responses, or web pages. Without this tool, they would have no way to access URL content directly — web_search only returns summaries, not full page content.

Safety guards:

  • 30-second HTTP timeout prevents hanging on slow servers
  • Response body capped at 1 MB to prevent memory exhaustion
  • HTML is cleaned via htmlutils (strips scripts, styles, nav, footer)
  • Output truncated at 1 MB to limit LLM context consumption

Dependencies:

  • github.com/stackgenhq/genie/pkg/htmlutils — HTML-to-text extraction
  • Go stdlib net/http — no external system dependencies

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ToolProvider

type ToolProvider struct{}

ToolProvider wraps the web fetch tool and satisfies the tools.ToolProviders interface.

func NewToolProvider

func NewToolProvider() *ToolProvider

NewToolProvider creates a ToolProvider for the web fetch tool.

func (*ToolProvider) GetTools

func (p *ToolProvider) GetTools() []tool.Tool

GetTools returns the web fetch tool.

Jump to

Keyboard shortcuts

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