# The tools

The full reference is at https://agentdiscover.me/agents. Every tool answers a refusal as a tool error whose
text starts with a code (`statuses.md` lists them).

## search_businesses

- In: `query` (what is needed, or a name), `place` (town, region or postcode; every word has to
  match), `website_domain`, `phone`, `only_connected`, `limit` (1 to 10, default 5). At least
  one of the first four is needed.
- Out: `results[]` with `slug`, `name`, `labels`, `locality`, `region`, `phone`, `joined`,
  `connected`, `has_booking_link`, `facts_confirmed_at`, `matched`, `reach` (`in_person`,
  `online`, `ships_to`, `ships_worldwide`) and `products` (up to 3 that `query` names). `note`
  says when a look-up found nothing and the words were searched instead.
- With `place`, a business that works online or ships to the place's country is listed too,
  after those in the place and near it.
- Order: more of the words matched first; among equals the order changes every day. Nothing is
  sold for placement.

## search_products

- In: `query` (what the user wants), `place` (optional: a town, region or postcode the business
  has to serve, in person, online or by shipping), `in_stock_only`, `limit` (1 to 20, default 10).
- Out: `results[]` with `id`, `name`, `description`, `price` (`amount`, `currency`) or
  `price_note`, `in_stock`, `source`, `buy_url`, `business` (`slug`, `name`, `locality`,
  `region`, `joined`, `connected`, `reach`) and `matched`.
- `buy_url` is our link to buy the product on the business's own website or store, given only where
  the business proved that site or store is its own: the user buys there. Without it, a question or
  a quote request to the business can ask about the product.

## get_business

- In: `slug`.
- Out: the public facts (phone, address, places served, hours, services), `reach`, `offers`
  (`services`, `products` or `both`), `products` (`total`, and its first 20 `items`, each as
  `search_products` gives it), `verification`, `ratings` (once there are 3), `booking` (our link
  to the business's own booking page, when it has one, for the user), `handle` and
  `page_url` (its page, at its own name when it has one), and `request`: `accepted_kinds`,
  `customer_confirmation_required`, `answer_expected_within_hours`, `instant_booking`, and
  `questions[]` (`id`, `label`, `kind`, `required`, `answer_with`, `options`, `for_kinds`).

## get_availability

- In: `slug`, `from` (`YYYY-MM-DD`, business's local date), `days` (1 to 14).
- Out: `slots[]` (`start`, `end` with the business's offset), `timezone`, `more`. Empty when
  `instant_booking` is false.

## send_request

- In: `slug`, `kind` (`booking`, `quote`, `question`), `summary` (the user's need in plain
  words), `customer` (`name`, and `phone` or `email`), `user_requested: true`, optional
  `preferred_windows` (up to 3 `{start, end}`), `slot_start`, `timing_note`, `answers` (by
  question `id`), `declared_client` (the assistant's name), `idempotency_key`.
- Out: `outcome` `created` (with `public_ref`, `status`, `status_url`, `respond_by`,
  `needs_customer_confirmation`, `open_questions`, `slot_outcome`, `booking`, `next_step`) or
  `not_connected` (nothing sent, with `fallback.phone` and up to 3 `alternatives`, to none of
  which anything was sent).

## request_match

- In: `kind`, `query`, `summary`, `customer`, `user_requested: true`, optional `place`,
  `time_window`, `timing_note`, `quantity`, `answers`, `max_businesses` (1 to 8, default 5),
  `idempotency_key`. Without `place`, only businesses that work online or ship here are asked; a
  booking with a `place` goes only to businesses in it or near it.
- Out: `outcome` `created` (with `public_ref` and `match`: `status`, `sent_to`, `businesses`,
  `chosen_by`) or `no_match` (nothing sent; `contacts` lists what an ordinary search finds).
- Each business may accept, reply, pass or put a question to the user. Every answer reaches the
  user, who chooses one business; only that one is given the user's name and contact.

## answer_request

- In: `public_ref`, and exactly one of `answers` (for `needs_info`), `reply` (the user's words to
  the business's `follow_up`, at most 500 characters; for a match, with that business's
  `request_ref` from `match.replies`), or `choose` (for a match, with its `public_ref`: the slug
  of the business the user chose, as their own choice).
- Out: as `send_request`. Only the address the request was sent on can answer it.

## get_request_status

- In: `public_ref`.
- Out: `status`, `business`, `respond_by`, `response` (`accepted`, `declined` or `replied`, and
  a proposed time), `open_questions`, `follow_up`, `booking`, `match` (for a match, with
  `replies`: each business's `request_ref`, `status`, `response`, `follow_up`, `may_choose`,
  `chosen`), `fallback`, `what_this_means`. The business's note goes to the user by text or email and is never
  returned.
