| 317 | static readonly Name: string = 'web_fetch'; |
| 318 | |
| 319 | constructor(private readonly config: Config) { |
| 320 | super( |
| 321 | WebFetchTool.Name, |
| 322 | 'WebFetch', |
| 323 | "Processes content from URL(s), including local and private network addresses (e.g., localhost), embedded in a prompt. Include up to 20 URLs and instructions (e.g., summarize, extract specific data) directly in the 'prompt' parameter.", |
| 324 | Kind.Fetch, |
| 325 | { |
| 326 | properties: { |
| 327 | prompt: { |
| 328 | description: |
| 329 | 'A comprehensive prompt that includes the URL(s) (up to 20) to fetch and specific instructions on how to process their content (e.g., "Summarize https://example.com/article and extract key points from https://another.com/data"). Must contain as least one URL starting with http:// or https://.', |
| 330 | type: 'string', |
| 331 | }, |
| 332 | }, |
| 333 | required: ['prompt'], |
| 334 | type: 'object', |
| 335 | }, |
| 336 | ); |
| 337 | const proxy = config.getProxy(); |
| 338 | if (proxy) { |
| 339 | setGlobalDispatcher(new ProxyAgent(proxy as string)); |
| 340 | } |
| 341 | } |
| 342 | |
| 343 | protected override validateToolParams( |
| 344 | params: WebFetchToolParams, |