get_seo_content_score
Analyze content SEO performance by evaluating title tags, meta descriptions, body content, and keywords to identify optimization opportunities.
Instructions
Get the SEO content score from SEO Review Tools.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title_tag | Yes | The title tag of the content. | |
| meta_description | Yes | The meta description of the content. | |
| body_content | Yes | The body content of the document, including HTML formatting. | |
| keyword | Yes | The main keyword for the SEO analysis. | |
| relatedkeywords | Yes | Related keywords for the SEO analysis. |
Implementation Reference
- The core handler function `executeFunction` that makes the API request to SEO Review Tools to compute the SEO content score based on provided title, meta, body, keyword, and related keywords.const executeFunction = async ({ title_tag, meta_description, body_content, keyword, relatedkeywords }) => { const baseUrl = 'https://api.seoreviewtools.com/v5/seo-content-optimization/'; const token = process.env.SEO_API_WORKSPACE_API_KEY; const content_input = { title_tag, meta_description, body_content }; try { // Construct the URL with query parameters const url = new URL(baseUrl); url.searchParams.append('content', '1'); url.searchParams.append('keyword', keyword); url.searchParams.append('relatedkeywords', relatedkeywords.join('|')); url.searchParams.append('key', token); // Set up headers for the request const headers = { 'Content-Type': 'application/json' }; // Perform the fetch request const response = await fetch(url.toString(), { method: 'POST', headers, body: JSON.stringify({ content_input }) }); // 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 SEO content score:', error); return { error: 'An error occurred while getting the SEO content score.' }; } };
- The JSON schema definition for the tool, including name, description, parameters, and required fields.type: 'function', function: { name: 'get_seo_content_score', description: 'Get the SEO content score from SEO Review Tools.', parameters: { type: 'object', properties: { title_tag: { type: 'string', description: 'The title tag of the content.' }, meta_description: { type: 'string', description: 'The meta description of the content.' }, body_content: { type: 'string', description: 'The body content of the document, including HTML formatting.' }, keyword: { type: 'string', description: 'The main keyword for the SEO analysis.' }, relatedkeywords: { type: 'array', items: { type: 'string' }, description: 'Related keywords for the SEO analysis.' } }, required: ['title_tag', 'meta_description', 'body_content', 'keyword', 'relatedkeywords'] } } }
- lib/tools.js:7-16 (registration)The `discoverTools` function dynamically imports all tools listed in toolPaths, including this one, by loading module.apiTool and registering it for use.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:7-7 (registration)The path to this specific tool file, used by discoverTools for dynamic import and registration.'seo-api-workspace/seo-ap-is-seo-review-tools/get-seo-content-score.js',