seo_keyword_difficulty
Analyze keyword difficulty for SEO strategies using the ReviewWebsite API. Input a keyword and optional country code to evaluate competition and optimize search rankings.
Instructions
Get keyword difficulty for a keyword using ReviewWeb.site API.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| api_key | No | Your ReviewWebsite API key | |
| country | No | Country code (default: us) | |
| keyword | Yes | The keyword to check difficulty for |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"api_key": {
"description": "Your ReviewWebsite API key",
"type": "string"
},
"country": {
"description": "Country code (default: us)",
"type": "string"
},
"keyword": {
"description": "The keyword to check difficulty for",
"type": "string"
}
},
"required": [
"keyword"
],
"type": "object"
}
Implementation Reference
- src/tools/reviewwebsite.tool.ts:586-621 (handler)MCP tool handler function that executes the logic for 'seo_keyword_difficulty' by calling the reviewWebsiteController.getKeywordDifficulty method.async function handleGetKeywordDifficulty( args: SeoKeywordDifficultyToolArgsType, ) { const methodLogger = Logger.forContext( 'tools/reviewwebsite.tool.ts', 'handleGetKeywordDifficulty', ); methodLogger.debug(`Getting keyword difficulty:`, { ...args, api_key: args.api_key ? '[REDACTED]' : undefined, }); try { const result = await reviewWebsiteController.getKeywordDifficulty( args.keyword, { country: args.country, }, { api_key: args.api_key, }, ); return { content: [ { type: 'text' as const, text: result.content, }, ], }; } catch (error) { methodLogger.error(`Error getting keyword difficulty`, error); return formatErrorForMcpTool(error); } }
- src/tools/reviewwebsite.tool.ts:804-809 (registration)Registration of the 'seo_keyword_difficulty' tool with the MCP server, linking name, description, input schema, and handler function.server.tool( 'seo_keyword_difficulty', `Get keyword difficulty for a keyword using ReviewWeb.site API.`, SeoKeywordDifficultyToolArgs.shape, handleGetKeywordDifficulty, );
- Zod schema defining the input arguments for the 'seo_keyword_difficulty' tool.export const SeoKeywordDifficultyToolArgs = z.object({ keyword: z.string().describe('The keyword to check difficulty for'), country: z.string().optional().describe('Country code (default: us)'), api_key: z.string().optional().describe('Your ReviewWebsite API key'), });