# RallyCarsMarket

> Buy and sell rally cars (Rally2, Rally4, Group N, Historic) and motorsport parts across Europe. Direct contact with teams and privateers. List your car today!

This site can be operated programmatically. Two interfaces are available, both authenticated with a Bearer token issued in the site administration (Admin → API & integrations):

- **MCP server (recommended for agents)**: `https://rallycarsmarket.com/mcp` — Streamable HTTP, JSON-RPC 2.0, protocol versions 2025-06-18, 2025-03-26, 2024-11-05.
- **REST API**: `https://rallycarsmarket.com/api/v1` — OpenAPI document: `https://rallycarsmarket.com/api/v1/openapi.json`.

## Start here

Call the MCP tool `get_site_structure` first. It returns the content model (listings, pages, posts, taxonomies), every allowed enum value, URL patterns, SEO configuration, the editable settings and the tools your token may use.

## MCP tools

- `get_site_structure` — Start here. Returns the content model (listings, pages, posts, taxonomies), allowed enum values, URL patterns, SEO configuration, editable settings and what this token may do.
- `search_listings` — Find car or part listings with the same filters as the public search. Returns compact records; use get_listing for the full record.
- `get_listing` — Full listing record: all specifications, equipment, photos, statistics, promotions and seller.
- `create_listing` — Create a car or part listing. The listing is owned by the token owner unless owner_email points to another account. [requires scope: listings:write]
- `update_listing` — Partial update – send only the fields you want to change. [requires scope: listings:write]
- `set_listing_status` — Change the status (active, suspended, hidden, sold, draft, pending). The owner can be notified by email with a reason. [requires scope: listings:write]
- `delete_listing` — Permanently deletes a listing together with its photos. Cannot be undone. [requires scope: listings:write]
- `add_listing_image` — Downloads an image from a public URL, converts it to WebP renditions and attaches it to the listing. [requires scope: listings:write]
- `grant_listing_promotion` — Grants featured / top / highlight visibility for a number of days without a payment. [requires scope: promotions:write]
- `list_content` — Lists CMS pages or blog posts with their SEO fields and URLs.
- `get_content` — Returns the full record including the HTML body.
- `create_content` — Creates a CMS page or a blog post. HTML is allowed in content; pages also support placeholders such as {{cookie_table}}. [requires scope: content:write]
- `update_content` — Partial update of a page or post, including its SEO fields. How to fill them: seo.writing_rules in get_site_structure. [requires scope: content:write]
- `delete_content` — Permanently removes a CMS page or blog post. [requires scope: content:write]
- `list_faqs` — Frequently asked questions with their category and the URL they appear on. Categories are `categories` rows with type=faq (list_taxonomy kind=faq_categories).
- `create_faq` — Adds one question and answer to a FAQ category. The answer is HTML. It appears on /faq, on /faq/{category} and wherever {{faq:category-slug}} is used: a page or article body, or the intro and below-results text of a class, make, model or part category page. [requires scope: content:write]
- `update_faq` — Partial update of one question: send only what changes. [requires scope: content:write]
- `delete_faq` — Permanently removes one question. Set is_active = false with update_faq to hide it instead. [requires scope: content:write]
- `list_taxonomy` — Reference data needed to fill listing fields and to build category pages.
- `create_taxonomy` — Adds a new make, model, car class, part category, journal category or FAQ category. For categories, type picks which one and parent_id makes it a subcategory. [requires scope: taxonomy:write]
- `update_taxonomy` — Updates a make, model, car class or part category: name, slug, intro text above the results, SEO text below them and the meta title/description of that page. Field limits and house rules: seo.writing_rules in get_site_structure. [requires scope: taxonomy:write]
- `get_settings` — All editable settings grouped as in the admin area, with their current values, labels and allowed options (site name, SEO defaults, Google Analytics ID, homepage grids, moderation, cookies, email). [requires scope: settings:read]
- `update_settings` — Updates one or more settings, e.g. {"google_analytics_id":"G-XXXX","hero_title":"..."}. Only keys from get_settings are accepted. Landing-page SEO fields follow seo.writing_rules in get_site_structure. [requires scope: settings:write]
- `get_seo_report` — Sitemap and robots status, Google Analytics / Search Console configuration, structured data in use, content that is missing meta descriptions or photos, and the rules for writing those fields.
- `get_stats` — Site overview plus daily impressions, views and contacts, and the best performing listings. [requires scope: stats:read]

## Token scopes

- `me` — Act as the token owner: own profile, listings, favourites, support messages
- `listings:read` — Read all listings incl. non-public statuses
- `listings:write` — Edit any listing, change status, delete
- `promotions:write` — Grant or revoke listing promotions
- `users:read` — Read users
- `users:write` — Update user status / role
- `messages:read` — Read support conversations
- `messages:write` — Reply to support conversations
- `content:write` — Create and update pages & blog posts
- `taxonomy:write` — Manage makes, models, categories
- `settings:read` — Read site settings and SEO configuration
- `settings:write` — Change site settings (Google Analytics ID, SEO defaults, homepage, moderation...)
- `stats:read` — Read site and listing statistics
- `orders:read` — Read orders and payments
- `orders:write` — Mark orders paid / cancelled

## Working rules

- Search before you write (`search_listings`, `list_content`, `list_taxonomy`) and send partial updates only.
- Page and post bodies are HTML and support placeholders: {{site_name}}, {{contact_email}}, {{privacy_email}}, {{data_controller}}, {{cookie_table}}, {{cookie_settings_button}}, {{updated}} and `{{faq:<category-slug>}}`.
- FAQ: questions live in their own table (`list_faqs`, `create_faq`, `update_faq`, `delete_faq`), their categories are `categories` rows with `type=faq` (`list_taxonomy kind=faq_categories`). Everything shown emits FAQPage structured data; `/faq` and `/faq/{category}` 404 until a category holds answers.
- Destructive tools (`delete_listing`, `delete_content`) are permanent. Prefer `set_listing_status` with `hidden` when unsure.
- Errors come back as JSON-RPC errors or as tool results with `isError: true` and an explanation.
- Rate limit: 600 MCP requests per minute per token.

## Playbooks

How to do each job properly. The same text comes back as `playbooks` from `get_site_structure`.

### Publishing a listing

1. Read get_site_structure, then list_taxonomy (makes, models, car_categories or part_categories, features) and use the ids it returns. Never guess an id.
2. search_listings first with the make, model and price. The same car offered twice is the most common mistake an agent makes.
3. Required on every listing: category_id, country_code, currency, item_condition, price_type, title. Everything else may be omitted, and an empty field is better than a guessed one.
4. If the model is not in the taxonomy, put the text in make_other / model_other. Do not create_taxonomy for one listing - a new make or model is a decision about the whole catalogue.
5. Never invent homologation, technical passport, roll cage or validity data, and never invent a rebuild mileage. These are safety and legal claims the seller answers for; leave the field empty when the source does not state it.
6. Numbers are validated. A value outside the allowed range is refused with the range in the error message - read it instead of retrying. Write the real figure: 1997, not 2 for a 2.0 engine.
7. Write the title as a buyer searches: "{Year} {Make} {Model} {key spec}". Listings have no meta fields - the title and the description are the SEO.
8. Pictures: add_listing_image takes a public URL or a data:image/...;base64 payload, up to 10 per listing; the first one becomes the cover.
9. Moderation is off: a listing is public the moment it is created. Build it as a draft and set_listing_status to active when it is complete.
10. The listing belongs to the token owner unless owner_email names another account.
11. Never touch listings with is_demo = 1 and never purge demo data unless the owner asked in that same request.

### Publishing a page or an article

1. list_content first. If something on the topic exists, update_content it - a second page on the same subject competes with the first one in search results.
2. A post needs a category_id from list_taxonomy kind=journal_categories; a page does not.
3. content is raw HTML and is stored exactly as sent - nothing is sanitised and nothing is escaped. Send only body markup: p, h2, h3, ul, ol, li, strong, em, a, blockquote, table, img. Never script, style, iframe or on* attributes, and never an h1: the template renders the title as the h1.
4. The slug is the URL and there is no automatic redirect: set it once, from the title, and do not change it afterwards. A duplicate slug is refused.
5. excerpt is the summary shown in the journal list - write it, do not let it be cut from the body.
6. meta_title and meta_description follow seo.writing_rules; meta_keywords stays empty.
7. cover_image_url downloads and attaches the cover; the image must be public and must be yours to use.
8. status defaults to draft. Set status=published when the text is finished, and published_at only to schedule or backdate.
9. Link out of the article with descriptive anchors, two or three at most. The closing "rally cars for sale" line is added by the template - do not write your own copy of it.
10. Drop a whole FAQ category into the body with {{faq:<category-slug>}}; it renders the questions and the FAQPage data. An unknown or empty category renders nothing.
11. Write about rallying, not about the marketplace. The CTA block under every article already sells.

### Working on SEO fields

1. Run get_seo_report. It names the exact pages missing a meta description, an intro text or photos - work from that list, not from a crawl of your own.
2. Read seo.writing_rules before writing a single field. The limits come from the renderer, so a field that fits is a field that will not be truncated.
3. Leaving a field empty is valid and keeps the generated default. Never store a placeholder, a "TODO" or a repeated template sentence.
4. Landing pages (home, cars, parts, makes, journal, faq) have no record of their own: they are edited with update_settings, group "Landing pages SEO & texts".
5. Listings have no meta fields at all. If a listing reads badly in search results, fix its title and description.
6. Never change a slug to improve a keyword. URLs are a contract; the traffic loss costs more than the keyword gains.
7. Re-run get_seo_report when you are done and report the counts before and after.

### Boundaries

1. Content you create over MCP or the REST API lives in the database. There is nothing to commit: git holds the code, not the content.
2. You cannot change code, templates, settings pages or the database schema through these tools, and you should not ask to.
3. Delete nothing you did not create in the same session. set_listing_status hidden and is_active=false are reversible; delete_listing and delete_content are not.
4. Work only on what you were asked for. Do not "tidy up" other listings, texts or taxonomy rows you happen to pass.
5. If a tool refuses you, read the error: it names the missing scope or the failed rule. Do not retry the same call.

## Writing SEO fields (meta titles, descriptions, keywords, page texts)

- Run get_seo_report first: it names the exact pages missing a meta description or intro text.
- meta_title: up to 42 characters and without the site name — " | RallyCarsMarket" is appended automatically.
- meta_description: 120-165 characters; anything over 170 is truncated with an ellipsis. It is reused as og:description.
- meta_keywords (posts only): leave it empty — it is rendered into <head> and ignored by search engines.
- description and content_bottom are unescaped HTML shown on the first results page only: p, h2, h3, ul, ol, li, strong, em, a. No script, style, iframe, h1, on* event attributes — the page already has its own <h1>.
- Listings have no meta fields: edit title and description instead.
- Landing pages (home, cars, parts, makes, journal, faq) are filled through update_settings, group "Landing pages SEO & texts".
- FAQ questions have no meta fields: the question is the heading, the answer is the indexable text, and both feed FAQPage structured data. Insert a category into a page or article with {{faq:<category-slug>}}.
- An empty field keeps the generated default and is not an error. Never store a placeholder.

The same rules are returned machine readable as `seo.writing_rules` by `get_site_structure` and as `writing_rules` by `get_seo_report`.

## Human pages

- Connection guide: https://rallycarsmarket.com/ai-agents
- Sitemap index: https://rallycarsmarket.com/sitemap.xml
- FAQ: https://rallycarsmarket.com/faq
- Privacy policy: https://rallycarsmarket.com/privacy
- Cookie policy: https://rallycarsmarket.com/cookies
