post_bulk_website_traffic
Submit multiple domain names to retrieve bulk website traffic data, including location and language-specific insights, using the SEO Review Tools API.
Instructions
Post bulk website traffic data to SEO Review Tools API.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domains | Yes | An array of domain names to check traffic for. | |
| hl | No | The language for the traffic data. | |
| location | No | The location for the traffic data. |
Implementation Reference
- The core handler function 'executeFunction' that performs the POST request to the SEO Review Tools API to retrieve bulk website traffic data.const executeFunction = async ({ domains, location = 'United States', hl = 'English' }) => { const baseUrl = 'https://api.seoreviewtools.com/v2/bulk-website-traffic/'; const token = process.env.SEO_API_WORKSPACE_API_KEY; try { // Prepare the request body const body = JSON.stringify({ domains }); // Set up the URL with query parameters const url = new URL(baseUrl); url.searchParams.append('key', token); url.searchParams.append('location', location); url.searchParams.append('hl', hl); // Perform the fetch request const response = await fetch(url.toString(), { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-Key': token }, body }); // Check if the response was successful if (!response.ok) { const errorData = await response.json(); throw new Error(errorData); } // Parse and return the response data const data = await response.json(); return data; } catch (error) { console.error('Error posting bulk website traffic data:', error); return { error: 'An error occurred while posting bulk website traffic data.' }; } };
- The 'apiTool' object containing the tool definition (schema) with name, description, and input parameters schema (domains required, location, hl optional). This is used for MCP tool registration.const apiTool = { function: executeFunction, definition: { type: 'function', function: { name: 'post_bulk_website_traffic', description: 'Post bulk website traffic data to SEO Review Tools API.', parameters: { type: 'object', properties: { domains: { type: 'array', items: { type: 'string', description: 'An array of domain names to check traffic for.' }, description: 'An array of domain names to check traffic for.' }, location: { type: 'string', description: 'The location for the traffic data.' }, hl: { type: 'string', description: 'The language for the traffic data.' } }, required: ['domains'] } } }
- tools/paths.js:5-5 (registration)The tool's file path is explicitly listed in the 'toolPaths' array, which drives dynamic discovery and loading of all MCP tools.'seo-api-workspace/seo-ap-is-seo-review-tools/post-bulk-website-traffic.js',
- lib/tools.js:7-16 (registration)The 'discoverTools' function dynamically imports each tool file from toolPaths and extracts the 'apiTool' object, preparing it for MCP server registration.export async function discoverTools() { const toolPromises = toolPaths.map(async (file) => { const module = await import(`../tools/${file}`); return { ...module.apiTool, path: file, }; }); return Promise.all(toolPromises); }
- mcpServer.js:85-85 (registration)In the MCP server setup, 'discoverTools()' is called to load all tools, including 'post_bulk_website_traffic', which are then handled by ListTools and CallTool request handlers.const tools = await discoverTools();