agentic_fetch.md

 1Fetches content from a URL or searches the web, then processes it using an AI model to extract information or answer questions.
 2
 3<when_to_use>
 4Use this tool when you need to:
 5- Search the web for information (omit the url parameter)
 6- Extract specific information from a webpage (provide a url)
 7- Answer questions about web content
 8- Summarize or analyze web pages
 9- Research topics by searching and following links
10
11DO NOT use this tool when:
12- You just need raw content without analysis (use fetch instead - faster and cheaper)
13- You want direct access to API responses or JSON (use fetch instead)
14- You don't need the content processed or interpreted (use fetch instead)
15</when_to_use>
16
17<usage>
18- Provide a prompt describing what information you want to find or extract (required)
19- Optionally provide a URL to fetch and analyze specific content
20- If no URL is provided, the agent will search the web to find relevant information
21- The tool spawns a sub-agent with web_search, web_fetch, and analysis tools
22- Returns the agent's response about the content
23</usage>
24
25<parameters>
26- prompt: What information you want to find or extract (required)
27- url: The URL to fetch content from (optional - if not provided, agent will search the web)
28</parameters>
29
30<usage_notes>
31- IMPORTANT: If an MCP-provided web fetch tool is available, prefer using that tool instead of this one, as it may have fewer restrictions. All MCP-provided tools start with "mcp_".
32- When using URL mode: The URL must be a fully-formed valid URL. HTTP URLs will be automatically upgraded to HTTPS.
33- When searching: Just provide the prompt describing what you want to find - the agent will search and fetch relevant pages.
34- The sub-agent can perform multiple searches and fetch multiple pages to gather comprehensive information.
35- This tool is read-only and does not modify any files.
36- Results will be summarized if the content is very large.
37- This tool uses AI processing and costs more tokens than the simple fetch tool.
38</usage_notes>
39
40<limitations>
41- Max response size: 5MB per page
42- Only supports HTTP and HTTPS protocols
43- Cannot handle authentication or cookies
44- Some websites may block automated requests
45- Uses additional tokens for AI processing
46- Search results depend on DuckDuckGo availability
47</limitations>
48
49<tips>
50- Be specific in your prompt about what information you want
51- For research tasks, omit the URL and let the agent search and follow relevant links
52- For complex pages, ask the agent to focus on specific sections
53- The agent has access to web_search, web_fetch, grep, and view tools
54- If you just need raw content, use the fetch tool instead to save tokens
55</tips>
56
57<examples>
58Search for information:
59- prompt: "What are the main new features in the latest Python release?"
60
61Fetch and analyze a URL:
62- url: "https://docs.python.org/3/whatsnew/3.12.html"
63- prompt: "Summarize the key changes in Python 3.12"
64</examples>