wp_seo_track_serp
Monitor search engine rankings for target keywords to analyze SEO performance and track position changes over time.
Instructions
Track search engine result page positions for target keywords
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site | No | Site identifier for multi-site setups | |
| keywords | Yes | Keywords to track positions for | |
| url | No | Specific URL to track (optional, uses site home if not provided) | |
| searchEngine | No | Search engine to track positions on | |
| location | No | Geographic location for localized results |
Implementation Reference
- src/tools/seo/SEOHandlers.ts:222-235 (handler)The handler function that executes the tool logic for wp_seo_track_serp. Currently throws 'not yet implemented'.export async function handleTrackSERPPositions( client: WordPressClient, args: Record<string, unknown>, ): Promise<unknown> { const logger = LoggerFactory.tool("wp_seo_track_serp"); try { // This would need implementation in SEOTools throw new Error("SERP tracking not yet implemented"); } catch (error) { logger.error("Failed to track SERP positions", { error, args }); throw error; } }
- The input schema and Tool definition for the wp_seo_track_serp tool, including parameters like keywords, url, searchEngine, etc.export const trackSERPPositionsTool: Tool = { name: "wp_seo_track_serp", description: "Track search engine result page positions for target keywords", inputSchema: { type: "object", properties: { keywords: { type: "array", items: { type: "string" }, description: "Keywords to track positions for", }, url: { type: "string", description: "Specific URL to track (optional, uses site home if not provided)", }, searchEngine: { type: "string", enum: ["google", "bing", "yahoo"], description: "Search engine to track positions on", }, location: { type: "string", description: "Geographic location for localized results", }, site: { type: "string", description: "Site identifier for multi-site setups", }, }, required: ["keywords"], }, };
- src/tools/seo/SEOTools.ts:378-399 (registration)The getHandlerForTool method registers 'wp_seo_track_serp' by mapping it to handleTrackSERPPositions, used in getTools() for MCP registration.private getHandlerForTool(toolName: string): unknown { const handlers: Record<string, unknown> = { wp_seo_analyze_content: handleAnalyzeContent, wp_seo_generate_metadata: handleGenerateMetadata, wp_seo_bulk_update_metadata: handleBulkUpdateMetadata, wp_seo_generate_schema: handleGenerateSchema, wp_seo_validate_schema: handleValidateSchema, wp_seo_suggest_internal_links: handleSuggestInternalLinks, wp_seo_site_audit: handlePerformSiteAudit, wp_seo_track_serp: handleTrackSERPPositions, wp_seo_keyword_research: handleKeywordResearch, wp_seo_test_integration: handleTestSEOIntegration, wp_seo_get_live_data: handleGetLiveSEOData, }; return ( handlers[toolName] || (() => { throw new Error(`Unknown SEO tool: ${toolName}`); }) ); }