Hreflang Check
hreflang_checkValidate hreflang annotations on a page: check BCP-47 codes, self-referencing, x-default fallback, and duplicates. Optionally verify reciprocal links to catch ignored hreflang tags.
Instructions
Validate a page's <link rel="alternate" hreflang> annotations: language/region code validity (BCP-47), the required self-referencing entry, the x-default fallback, and duplicate codes.
With check_reciprocity=true it fetches each alternate and confirms it links back to this page — non-reciprocal hreflang is silently ignored by Google, and it is impossible to detect from one page in isolation.
Args:
url (string): the page to check.
check_reciprocity (boolean): verify alternates link back (default false).
response_format ('markdown' | 'json'): output format (default 'markdown').
Returns: { declared_lang, entries[{hreflang, href, valid_code, is_self, reciprocates}], has_x_default, self_referencing, duplicate_codes[], invalid_codes[], findings[] }.
Example: "Is hreflang set up correctly on https://example.com/es/pagina?" -> hreflang_check(url="https://example.com/es/pagina", check_reciprocity=true).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Page URL to analyse, e.g. 'https://example.com/blog/post'. The scheme defaults to https://. | |
| response_format | No | Output format: 'markdown' for a human-readable summary (default) or 'json' for the full structured payload. | markdown |
| check_reciprocity | No | Fetch each alternate to confirm it links back. Catches the most common hreflang bug. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | ||
| entries | Yes | ||
| findings | Yes | ||
| final_url | Yes | ||
| declared_lang | Yes | ||
| has_x_default | Yes | ||
| invalid_codes | Yes | ||
| duplicate_codes | Yes | ||
| self_referencing | Yes | ||
| reciprocity_checked | Yes |