webscraping_ai_question
Ask a question about any webpage and get an AI-generated answer. Provide URL and question; the tool scrapes the page and returns the response.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL of the target page. | |
| question | Yes | Question or instructions to ask the LLM model about the target page. | |
| timeout | No | Maximum web page retrieval time in ms (20000 by default, maximum is 30000). | |
| js | No | Execute on-page JavaScript using a headless browser (false by default). | |
| js_timeout | No | Maximum JavaScript rendering time in ms (3000 by default). | |
| wait_for | No | CSS selector to wait for before returning the page content. | |
| proxy | No | Type of proxy: datacenter, residential, or stealth (datacenter by default). Use residential if the site restricts datacenter traffic, or stealth for the most heavily protected sites with advanced anti-bot detection. Residential and stealth requests cost more than datacenter — see the pricing page. | datacenter |
| country | No | Country of the proxy to use (US by default). | |
| custom_proxy | No | Your own proxy URL in "http://user:password@host:port" format. | |
| device | No | Type of device emulation. | |
| error_on_404 | No | Return error on 404 HTTP status on the target page (false by default). | |
| error_on_redirect | No | Return error on redirect on the target page (false by default). | |
| js_script | No | Custom JavaScript code to execute on the target page. |
Implementation Reference
- src/index.js:231-246 (registration)Tool registration using server.tool() with the name 'webscraping_ai_question', defining the URL and question input schema, and delegating to client.question().
server.tool( 'webscraping_ai_question', { url: z.string().describe('URL of the target page.'), question: z.string().describe('Question or instructions to ask the LLM model about the target page.'), ...commonOptionsSchema }, async ({ url, question, ...options }) => { try { const result = await client.question(url, question, options); return createSanitizedResponse(result, url); } catch (error) { return createSanitizedResponse(error.message, url, true); } } ); - src/index.js:238-245 (handler)The handler function for the tool: calls client.question(url, question, options), returns sanitized response on success, or error response on failure.
async ({ url, question, ...options }) => { try { const result = await client.question(url, question, options); return createSanitizedResponse(result, url); } catch (error) { return createSanitizedResponse(error.message, url, true); } } - src/index.js:234-236 (schema)Input schema for the tool: requires 'url' (string) and 'question' (string), plus common options (timeout, js, js_timeout, wait_for, proxy, country, etc.).
url: z.string().describe('URL of the target page.'), question: z.string().describe('Question or instructions to ask the LLM model about the target page.'), ...commonOptionsSchema - src/index.js:74-80 (helper)The client.question() helper method that sends a GET request to the '/ai/question' endpoint with url, question, and options parameters.
async question(url, question, options = {}) { return this.request('/ai/question', { url, question, ...options }); }