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.