fetch_types.go

 1package tools
 2
 3// AgenticFetchToolName is the name of the agentic fetch tool.
 4const AgenticFetchToolName = "agentic_fetch"
 5
 6// WebFetchToolName is the name of the web_fetch tool.
 7const WebFetchToolName = "web_fetch"
 8
 9// WebSearchToolName is the name of the web_search tool for sub-agents.
10const WebSearchToolName = "web_search"
11
12// LargeContentThreshold is the size threshold for saving content to a file.
13const LargeContentThreshold = 50000 // 50KB
14
15// AgenticFetchParams defines the parameters for the agentic fetch tool.
16type AgenticFetchParams struct {
17	URL    string `json:"url,omitempty" description:"The URL to fetch content from (optional - if not provided, the agent will search the web)"`
18	Prompt string `json:"prompt" description:"The prompt describing what information to find or extract"`
19}
20
21// AgenticFetchPermissionsParams defines the permission parameters for the agentic fetch tool.
22type AgenticFetchPermissionsParams struct {
23	URL    string `json:"url,omitempty"`
24	Prompt string `json:"prompt"`
25}
26
27// WebFetchParams defines the parameters for the web_fetch tool.
28type WebFetchParams struct {
29	URL string `json:"url" description:"The URL to fetch content from"`
30}
31
32// WebSearchParams defines the parameters for the web_search tool.
33type WebSearchParams struct {
34	Query      string `json:"query" description:"The search query to find information on the web"`
35	MaxResults int    `json:"max_results,omitempty" description:"Maximum number of results to return (default: 10, max: 20)"`
36}
37
38// FetchParams defines the parameters for the simple fetch tool.
39type FetchParams struct {
40	URL     string `json:"url" description:"The URL to fetch content from"`
41	Format  string `json:"format" description:"The format to return the content in (text, markdown, or html)"`
42	Timeout int    `json:"timeout,omitempty" description:"Optional timeout in seconds (max 120)"`
43}
44
45// FetchPermissionsParams defines the permission parameters for the simple fetch tool.
46type FetchPermissionsParams struct {
47	URL     string `json:"url"`
48	Format  string `json:"format"`
49	Timeout int    `json:"timeout,omitempty"`
50}