# Website tools guide

## Rules
This server manages the websites a web agency builds and runs for local businesses.
- Find sites with list_sites; every other tool takes a site_id from there. read_guide explains every page field and business profile field.
- Each site has a draft and a published version. The update_* and undo tools change the draft only; nothing goes live until publish_site.
- Facts (phone, address, hours, license, years in business, guarantees, prices, offers, reviews) may only come from the business profile. Copy that claims something the profile does not back is rejected at publish. When the user tells you a new fact, record it with update_business (notes, license, founded or offer) before using it on a page.
- The business name, phone, address and hours live in the business profile, not on pages.
- Read a page with get_page before update_page; pass only the top-level fields you change.
- Run check_site before publish_site and fix the blocking problems it lists. Warnings do not block.
- Every change is recorded; list_changes and undo_change can revert one.
- Client sites are white-label: never put the agency's name or this platform's name on a client site.
- The agency usually writes in Chinese; site copy stays in the site's own language (usually English).

## Tools
- `list_sites` (read-only): List every full website of this agency: id, business name, city, whether it is live, and its domain.
- `site_overview` (read-only): Business profile (phone, hours, address, facts) and the last 30 days of visitors, calls and requests for one site.
- `compare_sites` (read-only): Visitors, calls and contact-form requests for every live site over the last N days, with the N days before for comparison.
- `inbox_summary` (read-only): What is waiting for the agency: new inquiries, drafts and owner requests ready to publish, monthly reports, problems, growth suggestions.
- `list_pages` (read-only): List every page on the site with its path, type and label.
- `get_page` (read-only): Get the current fields and search title/description of one page.
- `update_page`: Replace some top-level fields of one page. Pass only the fields you change; array fields are replaced as a whole.
- `update_seo`: Change the search-result title and/or description of one page (shown in Google, not on the page).
- `get_business` (read-only): Get the business profile: contact details, hours, brand color, facts (license, founded, offer, notes), rating and reviews.
- `update_business`: Change fields of the business profile. Pass only the fields you change. Facts the site may claim (license, years, guarantees, free estimates) belong in license, founded, offer or notes.
- `check_site` (read-only): Run the pre-publish quality check on the current draft. Returns blocking problems and warnings.
- `list_changes` (read-only): List the most recent changes to the draft (newest first), with their ids.
- `undo_change`: Undo one change by id. Refused if the same content changed again afterwards.
- `publish_site`: Publish the current draft of one site so visitors see it. Refused if check_site has blocking problems.
- `list_inquiries` (read-only): Recent contact-form inquiries across all sites: who, phone, message, which site, AI category and suggested reply.
- `read_guide` (read-only): The full guide for AI: rules, every tool, every page type with its fields, and every business profile field.

## Page types and fields
update_page takes a JSON object of top-level fields. Lists are replaced as a whole: send the full list.

### home
- `headline` (string): Big heading at the top: what the business does and where
- `subhead` (string): One or two sentences under the headline
- `cta` (string): Label of the main button (a quote request or a call)
- `services` (list of { title, blurb, path }): Service cards, each linking to its service page
  - `title` (string): Card title
  - `blurb` (string): One or two sentences under the title
  - `path` (string): Page it links to; do not change
- `areas` (list of { title, blurb, path }): Service-area cards, each linking to its area page
  - `title` (string): Card title
  - `blurb` (string): One or two sentences under the title
  - `path` (string): Page it links to; do not change
- `reasons` (list of string): Short "why choose us" points; facts must be in the business profile
- `process` (list of { title, text }): How it works, in steps
  - `title` (string): Step name
  - `text` (string): What happens in this step
- `faq` (list of { q, a }): Questions and answers
  - `q` (string): Question, as a customer would ask it
  - `a` (string): Answer, using only business profile facts

### service
- `title` (string): Page heading, usually the service and the city
- `intro` (string): Opening paragraph
- `body` (list of string): Paragraphs
- `faq` (list of { q, a }): Questions and answers about this service
  - `q` (string): Question, as a customer would ask it
  - `a` (string): Answer, using only business profile facts

### area
- `title` (string): Page heading, usually the services and the area
- `intro` (string): Opening paragraph
- `body` (list of string): Paragraphs, specific to this area

### about
- `title` (string): Page heading
- `body` (list of string): Paragraphs about the business; facts must be in the business profile

### contact
- `title` (string): Page heading above the contact form
- `intro` (string): Sentence above the form

### legal
- `title` (string): Page heading, e.g. Privacy Policy
- `body` (list of string): Paragraphs

## Business profile (get_business / update_business)
logo, photos, rating, reviews, ownerEmail and reviewUrl are set in the dashboard, not with update_business.
- `name` (string): Business name, shown in the header, footer and titles
- `phone` (string): Main phone number; every call button uses it
- `city` (string): City and state, e.g. "Austin, TX"
- `address` (string): Street address; empty for service-area businesses
- `hours` (string): Opening hours as visitors should read them, complete for the whole week
- `brandColor` (string): Main color, #rrggbb
- `founded` (integer or null): Year founded; copy may say "since <year>" only if set
- `license` (string): License or certification numbers; copy may say "licensed" only if set
- `rating` ({ value, count, source } or null): Average rating on a map listing, e.g. 4.9 from 127 Google reviews
  - `value` (number): Average stars, e.g. 4.9
  - `count` (integer): Number of reviews
  - `source` (string): Which listing, e.g. Google
- `reviews` (list of { text, author, rating, source }): Real customer reviews shown on the site; never write new ones
  - `text` (string): What the customer wrote, verbatim
  - `author` (string): Customer name as shown on the review
  - `rating` (integer): Stars, 1–5
  - `source` (string): Where the review was posted, e.g. Google, Yelp
- `notes` (string): Other true facts from the owner (guarantees, free estimates, weekend service…); copy may use them
- `offer` (string): Current offer shown on the site, e.g. "$50 off your first cleaning"; empty hides it
- `logo` (string): Logo path on the site (/media/...); empty shows the name instead
- `photos` (list of string): The business's own photos; the first is the home page hero. Empty uses stock photos
- `ownerEmail` (string): Where inquiry notifications and monthly reports go; never shown on the site
- `reviewUrl` (string): Google "write a review" link; <site>/review redirects here