get_authority_scores
Calculate domain and page authority scores for multiple URLs to assess SEO performance and identify improvement opportunities.
Instructions
Get authority scores for a list of URLs.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| urls | Yes | The list of URLs to check authority scores for. | |
| metrics | No | The metrics to retrieve, default is "pa|da". |
Implementation Reference
- The main handler function `executeFunction` that fetches authority scores (PA/DA metrics) for a list of URLs using the SEO Review Tools API.const executeFunction = async ({ urls, metrics = 'pa|da' }) => { const baseUrl = 'https://api.seoreviewtools.com/bulk-authority-score/'; const token = process.env.SEO_API_WORKSPACE_API_KEY; try { // Prepare the request body const body = JSON.stringify({ urls }); // Set up headers for the request const headers = { 'Content-Type': 'application/json', 'X-API-Key': token }; // Perform the fetch request const response = await fetch(`${baseUrl}?metrics=${metrics}&key=${token}`, { method: 'POST', headers, 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 getting authority scores:', error); return { error: 'An error occurred while getting authority scores.' }; } };
- The JSON schema defining the input parameters for the tool: `urls` (required array of strings) and optional `metrics` (string).parameters: { type: 'object', properties: { urls: { type: 'array', items: { type: 'string' }, description: 'The list of URLs to check authority scores for.' }, metrics: { type: 'string', description: 'The metrics to retrieve, default is "pa|da".' } }, required: ['urls'] }
- lib/tools.js:7-16 (registration)Dynamic registration of the tool via `discoverTools()` which imports the `apiTool` export from get-authority.js (via paths.js) and includes it in the list of available MCP tools.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); }
- tools/paths.js:3-3 (registration)The tool path is listed in `toolPaths` array, used by discoverTools to load the specific tool file.'seo-api-workspace/seo-ap-is-seo-review-tools/get-authority.js',