seo_generate_code_fix
Generate framework-aware code fixes for missing titles, meta descriptions, canonical URLs, JSON-LD schemas, and WebMCP discovery links, with unified diff preview before applying.
Instructions
Generates framework-aware code fixes (Laravel Blade, Next.js App/Pages Router, HTML, PHP, Astro, Svelte) for missing titles, meta descriptions, canonical URLs, JSON-LD schemas, and WebMCP discovery links with unified diff preview.
USAGE GUIDELINES:
Use after audit tools detect specific SEO, schema, or WebMCP issues in a source file.
Do NOT use for general code refactoring unrelated to metadata, schema, or SEO tags.
Always run 'seo_validate_code_fix' immediately after applying changes to verify syntax and prevent duplicate tags.
BEHAVIORAL TRANSPARENCY:
Non-destructive by default: Returns unified diff preview without modifying files.
Modifies disk ONLY when 'applyDirectly' is explicitly set to true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | No | New or updated title tag text. | |
| filePath | Yes | Path to source code file to modify (e.g., "./pages/index.tsx" or "resources/views/welcome.blade.php"). | |
| canonicalUrl | No | Canonical URL (e.g. "https://example.com/page"). | |
| jsonLdSchema | No | Valid Schema.org JSON-LD object to inject into HTML head. | |
| applyDirectly | No | Whether to apply changes directly to disk. Default: false (returns diff preview only for review). | |
| webMcpEndpoint | No | WebMCP endpoint URL to inject into HTML head via <link rel="mcp-server" /> (e.g. "/mcp" or "/api/mcp"). | |
| metaDescription | No | New or updated meta description string. | |
| addWebMcpDiscovery | No | Whether to inject standard <link rel="mcp-server" href="/mcp" /> tag. Default: false. |