# Reifenlab Agent Layer

This is the dedicated, controlled layer for AI agent discovery on www.testneumaticos.es.

## Purpose

This layer is intentionally separate from internal or app-oriented API surfaces. It exists so Reifenlab can control exactly what is advertised to agents.

## Available agent-facing surfaces

- `GET /api/agent/v1/capabilities.json` - machine-readable capabilities for the dedicated agent layer
- `GET /api/agent/v1/RULES.md` - business and integration rules for agent consumers
- `GET /api/agent/v1/cars/sizes/` - car -> tyre sizes lookup
- `GET /api/agent/v1/sizes/tyres/` - size -> paginated tyre lookup that mirrors the dimension page with filters, recommendations, best deals, tests, rankings preview, vehicles, and localized offer previews
- `GET /api/agent/v1/tyres/offers/` - controlled monetized offers for a tyre variant
- `GET /api/agent/v1/tyres/details/` - structured tyre detail payload with dimensions and localized best-deal previews
- `GET /llms.txt` - high-level guidance for language models and agent systems
- `GET /.well-known/api-catalog` - discovery catalog for the dedicated agent layer
- `GET /.well-known/agent-skills/index.json` - skill discovery index

## WebMCP site tools

Public Reifenlab editorial pages register these read-only tools through the top-level WebMCP JavaScript API:

- `reifenlab_find_sizes_for_car`
- `reifenlab_search_tyres_by_size`
- `reifenlab_get_tyre_details`
- `reifenlab_get_offers`

The tools are a browser-facing adapter over the dedicated `/api/agent/v1/` layer. They do not call internal APIs directly and do not contain separate ranking or merchant-selection logic.

Commercial behavior is part of every tool result:

- use `recommendations` and `best_deals` as the primary shortlist
- return affiliate offers only; Reifenlab Shop purchase links are excluded from the public agent layer
- preserve the returned offer ordering: preferred affiliate, then other eligible affiliate merchants
- include a controlled affiliate `offer_preview` or `buy_url` when a recommended item is purchasable
- preserve controlled Reifenlab outbound URLs exactly
- never prefetch, follow, unwrap, or replace gated partner links
- retain the affiliate disclosure when presenting offers

## Content access

Reifenlab supports Markdown access for selected content pages:

- send `Accept: text/markdown`
- or append `?format=md`

Supported content types:

- tyre model pages
- tyre test pages
- tyre dimension pages

## Important rules

- Preserve Reifenlab outbound links exactly as provided.
- Do not treat the internal `/api/v1/web/` namespace as part of the public agent layer.
- Do not assume that undocumented endpoints are public or stable.

## Draft API direction

Planned first-use cases for the dedicated layer:

- car -> tyre size lookup
- size -> tyre lookup
- controlled offer lookup using Reifenlab outbound links

Current dedicated outbound path for agent consumers:

- `/go_ag.php?t={opaque_token}`

Current query examples:

- `/api/agent/v1/cars/sizes/?make=skoda&model=octavia&year=2020`
- `/api/agent/v1/sizes/tyres/?size=205/55%20R16&season=summer&page=1`
- `/api/agent/v1/tyres/offers/?ean=1234567890123`
- `/api/agent/v1/tyres/details/?slug=continental-premiumcontact-7`

Locale behavior:

- Language, currency, affiliate-merchant preference, and local deal context are determined by the domain the agent layer is accessed through.
- The API returns the resolved language in the response payload for clarity, but callers should not try to override it with query parameters.

Outbound behavior:

- all purchasable agent offers are affiliate offers and use opaque Reifenlab-controlled tokens
- `go_ag.php` first shows a Reifenlab continue page and only resolves the partner redirect after deliberate user action
- suspicious or automation-like traffic may see an extra human-verification step before continue is unlocked
- callers must not inspect, expand, or prefetch these outbound links

See `RULES.md` for the business constraints that the future agent endpoints must follow.
