> ## Documentation Index
> Fetch the complete documentation index at: https://docs.peec.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Tools Reference

> Every tool the Peec AI MCP Server exposes, with parameters and response fields.

The Peec AI MCP Server exposes two sets of tools:

### **Read tools** (57) return data:

* Projects, brands, model channels
* Prompts and prompt suggestions
* Chats and chat reports
* Brand/domain/URL/links reports
* Actions
* Content optimization articles, suggestions, and connected CMS pages
* Brand perception attributes and objections
* Fact-checking facts
* Scraped source content and how it changed between scrapes
* Custom classifications
* The Brand Profile
* Project members
* Products, merchants and the shopping catalog
* Shopping performance/demand/trend metrics
* The Peec documentation
* AI referral traffic
* Agent Analytics (known bots and access-log visit counts)

### **Write tools** (50) create, update, archive, or delete:

* Projects
* Brands, prompts, tags, tag groups, topics
* Products, categories, facts
* Custom domain/URL classifications
* Attribute clusters
* Actions (write your own, edit any action, update statuses and steps)
* Content optimization articles (rewrite passages, apply or dismiss suggestions, reconcile CMS changes)
* Connected CMS pages (save drafts and publish reviewed content)
* The Brand Profile
* Generate topics and prompt suggestions

Your AI assistant calls these tools automatically based on your questions. You don't need to invoke them directly, but this reference helps you understand what is available.

A few tools are only available when the feature behind them is enabled for your project:

* Fact tools → **Fact-checking**
* `get_cms_page`, `get_cms_drift`, `sync_cms_content`, and `publish_cms_content` require **CMS publishing** and project-owner access.
* `get_optimize_content`, `edit_optimize_content`, and `resolve_optimize_content_suggestions` → **Content optimization**. The other action tools are always available, but they return `CONTENT_OPTIMISATION` actions only when it's enabled.
* `get_ai_referrals` → **My website**

A Company Member can turn these on under **Settings → Company Settings → Early access**.

Until a feature is enabled, your assistant doesn't see its tools at all. Calling one by name will return **"tool not found"**.

> [!NOTE]
>
> All tools except `list_projects`, `create_projects`, `search_docs`, `read_doc`, and `list_referral_sources` require a `project_id`. Your AI assistant handles this automatically after you pick a project.
>
> Write tools require project-owner access; company owners also qualify. `create_projects` needs company member access instead. CMS tools require project-owner access, including their read tools. Other read tools are available to any project member.
>
> Tool calls are rate limited to 1,000 calls per minute per user. If you hit the limit, the server tells your assistant to retry after a few seconds.

## Response format

Most tools return compact **columnar JSON**:

```json theme={null}
{
  "columns": ["brand_id", "brand_name", "visibility", "..."],
  "rows": [
    ["b_1", "Acme", 0.42, "..."],
    ["b_2", "Contoso", 0.18, "..."]
  ],
  "rowCount": 2
}
```

Each row is an array of values matching the `columns` order. List tools (`list_brands`, `list_topics`, `list_tags`, `list_prompts`, `list_chats`, `list_search_queries`, `list_shopping_queries`, `list_products`, `list_categories`, `list_global_brands`, `list_shopping_demand`, `list_shopping_performance`, `list_domain_classifications`, `list_url_classifications`, `list_url_content_versions`) also return a `totalCount` field with the total matching records across pages, so you can tell whether to paginate. `get_chat`, `get_url_content`, `get_url_content_diff`, `get_project_profile`, `get_product`, `get_shopping_trend`, `get_shopping_attributes`, `read_doc`, `list_bots`, and `get_agent_visits` are exceptions: they return their object directly.

## list\_projects

Lists all projects your account has access to. This is always called first.

**Columns:** `id`, `name`, `status`

***

## list\_brands

List brands (your brand and tracked competitors) in a project.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `limit` | number | No | Max results (default: 100) |
| `offset` | number | No | Results to skip (default: 0) |
| `fields` | string\[] | No | Columns to return. Omit for all of them. |

**Columns:** `id`, `name`, `domains`, `aliases`, `is_own`, `regex`, `color`, `source`

`aliases` are alternate names the brand is matched under. `is_own` indicates whether this is your brand (`true`) or a competitor (`false`). A nonempty `regex` overrides name and alias matching; `null` means none is set.

`color` is the brand's hex color, or `null` when none is set and Peec shows an automatic one. `source` is how the brand was added: `onboarding` for competitors Peec suggested when the project was created, `suggestion` for a brand suggestion someone accepted, and `manual` for a brand created in the app, through the API, or through MCP. `null` means the brand was added before Peec recorded this.

***

## list\_topics

Lists topic groupings in a project. Each prompt belongs to one topic.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `limit` | number | No | Max results (default: 100) |
| `offset` | number | No | Results to skip (default: 0) |

**Columns:** `id`, `name`

***

## list\_tags

Lists tags (cross-cutting labels) in a project.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `group` | string | No | Filter to tags in this user-defined group |
| `limit` | number | No | Max results (default: 100) |
| `offset` | number | No | Results to skip (default: 0) |

**Columns:** `id`, `name`, `is_system`, `group`

System tags (`is_system: true`) are Peec-managed branding/intent tags; their `group` is `branding` or `intentType`. User tags carry their user-defined group name in `group` (or `null` when ungrouped). Use [`list_tag_groups`](#list-tag-groups) to enumerate the user-defined groups.

***

## list\_tag\_groups

Lists the user-defined tag groups in a project, each with its shared color and tag count. System groups (branding/intentType) are not included — see [`list_tags`](#list-tags).

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |

**Returns:** `{ data: [{ group, color, tag_count }] }`.

***

## list\_models

Lists all AI engines (models) configured for a project. Use this to resolve model names (e.g. "ChatGPT", "Perplexity") to IDs before filtering reports, and to label model IDs with human-readable names when presenting results.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |

**Columns:** `id`, `name`, `is_active`

The `is_active` field indicates whether the model is enabled for this project. Inactive models return empty data in reports.

> [!NOTE]
>
> Filtering and breaking down reports by `model_id` is deprecated. Prefer `model_channel_id` (see [`list_model_channels`](#list-model-channels)) — channels are stable engine identifiers that survive model version upgrades.

***

## list\_model\_channels

Lists the AI engine channels tracked by Peec. A **model channel** is a stable identifier for an engine (e.g. `openai-0` = ChatGPT UI) that persists as the underlying model is upgraded. Use it to filter or break down reports without tying yourself to a specific model version.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |

**Columns:** `id`, `description`, `current_model_id`, `is_active`, `unsupported_country_codes`

* `current_model_id` is the model ID currently active in the channel. Pass this as `model_id` if a report still requires the deprecated filter.
* `is_active` mirrors the engine's status for this project. Inactive channels return empty data.
* `unsupported_country_codes` lists ISO 3166-1 alpha-2 codes the channel can't serve. Chats requested for those countries are not created.

***

## list\_prompts

Lists prompts in a project. You can filter by topic or tag.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `topic_id` | string | No | Filter by topic ID |
| `tag_id` | string | No | Filter by tag ID |
| `limit` | number | No | Max results (default: 100) |
| `offset` | number | No | Results to skip (default: 0) |

**Columns:** `id`, `text`, `tag_ids`, `topic_id`, `volume`

`tag_ids` is an array of tag IDs. `topic_id` is the topic ID or `null`. `volume` is a relative search-volume bucket: `very low`, `low`, `medium`, `high`, `very high`, or `null` when the prompt does not have a volume signal yet.

***

## list\_prompt\_suggestions

Lists the prompts Prompt discovery generated and left awaiting review. A suggestion isn't tracked and produces no data until you accept it, so this is the review queue rather than part of your prompt set. Filter by `topic_id` to work through one topic at a time.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `topic_id` | string | No | Only suggestions on this topic |
| `fields` | string\[] | No | Columns to return. Omit for all of them. |
| `limit` | number | No | Max results (default: 100, max: 1000) |
| `offset` | number | No | Results to skip (default: 0) |

**Columns:** `id`, `text`, `topic_id`, `tag_ids`, `country`, `volume`

| Field | Description |
| - | - |
| `id` | Prefixed `pr_`. A suggestion keeps its ID when accepted, so the tracked prompt is findable under the same ID with [`list_prompts`](#list-prompts). |
| `tag_ids` | Tag IDs. Resolve the names with [`list_tags`](#list-tags). |
| `country` | The market the suggestion was generated for |
| `volume` | Relative search volume, or `null` when it isn't available |

Accept or reject them with [`finalize_prompt_suggestions`](#finalize-prompt-suggestions), or edit one first with [`update_prompt_suggestions`](#update-prompt-suggestions).

***

## get\_prompt\_suggestion\_generation

Reads the status of a generation run started by [`generate_prompt_suggestions`](#generate-prompt-suggestions). `QUEUED` and `RUNNING` mean it's still working. `SUCCEEDED` and `FAILED` are final, and a successful run can still produce zero suggestions.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `generation_id` | string | Yes | The generation ID returned by `generate_prompt_suggestions` |

Once a run succeeds, read what it produced with [`list_prompt_suggestions`](#list-prompt-suggestions).

***

## list\_chats

List individual AI responses (chats) for a project over a date range. Each chat is one prompt run against one AI engine on a given date. Combine with `get_chat` to inspect the full response.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `start_date` | string | Yes | Start date (YYYY-MM-DD) |
| `end_date` | string | Yes | End date (YYYY-MM-DD) |
| `brand_id` | string | No | Only chats that mentioned this brand |
| `prompt_id` | string | No | Only chats produced by this prompt |
| `model_id` | string | No | Only chats from this AI engine. **Deprecated** — prefer `model_channel_id`. Ignored if `model_channel_id` is also provided. |
| `model_channel_id` | string | No | Only chats from this stable engine channel |
| `features` | string\[] | No | Only chats whose response contains all of the given features. Values: `SHOPPING`, `PRODUCT_COMPARISON`, `AD`, `MAP`, `WEB_SEARCH`, `LINKS`, `CHART`. Multiple values are AND'd (a chat must contain every listed feature to match). |
| `include_archived_prompts` | boolean | No | Include chats whose prompt has been archived. Default `false`. Set to `true` only when historical chats for prompts that are no longer active are needed. Chats for deleted prompts are always excluded regardless of this flag. |
| `limit` | number | No | Max results (default: 100, max: 10000) |
| `offset` | number | No | Results to skip (default: 0) |

**Columns:** `id`, `prompt_id`, `model_id`, `model_channel_id`, `date`, `features`

`features` is an array of feature flags marking special elements detected in the assistant response. Use the same values listed under the `features` filter above.

By default, chats are excluded if their prompt has been deleted or archived. Pass `include_archived_prompts=true` to include chats for archived prompts (e.g. for a historical lookback against a prompt no longer being tracked). Chats for deleted prompts are always excluded.

***

## get\_chat

Get the full content of a single chat: the user prompt, the AI response, every source URL the model retrieved, every brand it mentioned, every search query it issued, and any extracted products.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `chat_id` | string | Yes | The chat ID (from `list_chats`) |

**Returns:**

| Field | Description |
| - | - |
| `messages` | The user prompt and assistant response(s) |
| `brands_mentioned` | Brands detected in the response with their position |
| `sources` | URLs the model retrieved, with citation counts and position |
| `links` | URLs the answer wrote into its own text, such as a brand name hyperlinked to its homepage. Each entry: `{ url, url_normalized, domain, text, link_count, link_position }`. A link is never also a source. |
| `queries` | Search queries the model issued |
| `products` | Product gallery entries extracted from the response |
| `features` | Feature flags for special elements detected in the assistant response. Values: `SHOPPING`, `PRODUCT_COMPARISON`, `AD`, `MAP`, `WEB_SEARCH`, `LINKS`, `CHART`. |
| `maps` | Local-business map cards (one per business pinned in a map widget). Each entry: `{ name, url? }`, where `url` is the Google Maps directions deeplink. |
| `ads` | Paid ad placements rendered by the model. Each entry: `{ brandName, url, id?, adUnitType?, adsRequestId?, cards }`, where `cards` is an array of `{ title?, body?, imageUrl?, targetUrl? }`. `targetUrl` is the clickout URL with attribution UTM params. |
| `prompt` | `{id}` |
| `model` | `{id}` — **Deprecated**, prefer `model_channel` |
| `model_channel` | `{id}` — stable engine channel ID (e.g. `openai-0`) |

***

## get\_chats\_report

Aggregate counts and rich-answer shares across a project's chats over a date range. Reach for it instead of paging through [`list_chats`](#list-chats) when the question is how many chats there were, what share of answers rendered a shopping gallery or a map, or how many distinct prompts and engines a tag spans.

### Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `start_date` | string | Yes | Start date (YYYY-MM-DD) |
| `end_date` | string | Yes | End date (YYYY-MM-DD) |
| `dimensions` | string\[] | No | Group by: `prompt_id`, `model_id` (deprecated, prefer `model_channel_id`), `model_channel_id`, `tag_id`, `topic_id`, `date`, `week`, `month`, `country_code`, `chat_id`. Omit for a single total row. |
| `filters` | object\[] | No | Restrict which chats are counted. `{field, operator, values}` with operator `in` or `not_in`, AND'd together. Fields: `model_id` (deprecated), `model_channel_id`, `country_code`, `prompt_id`, `tag_id`, `topic_id`, `chat_id`. |
| `order_by` | object\[] | No | Sort by one or more fields (see [Sorting](#sorting)). Sorting by `date`, `week` or `month` requires that dimension. |
| `limit` | number | No | Max rows (default: 100, max: 1000) |
| `offset` | number | No | Rows to skip (default: 0) |

### Response fields

| Field | Description |
| - | - |
| `chat_count` | Chats in the group, and the denominator of every percentage below |
| `prompt_count` | Distinct prompts the group spans |
| `model_channel_count` | Distinct engine channels the group spans |
| `country_count` | Distinct countries the group spans, excluding chats with no country |
| `shopping_count` / `shopping_percentage` | Answers that rendered a shopping or product gallery |
| `product_comparison_count` / `product_comparison_percentage` | Answers that rendered a product comparison |
| `ad_count` / `ad_percentage` | Answers that carried an ad |
| `map_count` / `map_percentage` | Answers that rendered a map or local-business result |
| `web_search_count` / `web_search_percentage` | Answers built on web-search sources |
| `links_count` / `links_percentage` | Answers that link to a page in their own text. Use [`get_links_report`](#get-links-report) to see which domains |
| `chart_count` / `chart_percentage` | Answers that contain a structured chart |

Percentages are 0-1 ratios of `chat_count`, so `0.75` means 75%. Rows grouped by `tag_id`, `topic_id` or `model_channel_id` also carry a matching `*_name` column.

> [!NOTE]
>
> Coverage counts collapse to 1 for whichever dimension you group by, so read `prompt_count`, `model_channel_count` and `country_count` against dimensions you didn't split on. Grouping by `prompt_id` makes `prompt_count` 1 in every row.

> [!TIP]
>
> For a time or high-cardinality breakdown, raise `limit` to the row count you need rather than to the maximum. If `rowCount` comes back equal to `limit`, the results were truncated.

***

## list\_search\_queries

Lists the search sub-queries an AI engine fanned out to while answering prompts in a project over a date range. Each row is one sub-query issued for a given chat. Combine with `get_chat` to inspect the full response.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `start_date` | string | Yes | Start date (YYYY-MM-DD) |
| `end_date` | string | Yes | End date (YYYY-MM-DD) |
| `prompt_id` | string | No | Only queries from chats produced by this prompt |
| `chat_id` | string | No | Only queries from this chat |
| `model_id` | string | No | Only queries from this AI engine |
| `model_channel_id` | string | No | Only queries from this model channel |
| `topic_id` | string | No | Only queries from chats whose prompt belongs to this topic |
| `tag_id` | string | No | Only queries from chats whose prompt carries this tag |
| `view` | string | No | `rows` (default), `queries`, `terms` or `brands` |
| `terms` | string\[] | No | Terms to report in the `terms` view; in `queries` and `brands`, only count queries containing one of them |
| `dimensions` | string\[] | No | `queries`: `prompt_id`, `topic_id`, `model_channel_id`. `terms`: `model_channel_id` and one of `date`, `week`, `month` |
| `movement` | string | No | `terms` view without dimensions: `top` (default), `trending`, `losing` or `new` |
| `limit` | number | No | Max results (default: 100, hard cap 1000) |
| `offset` | number | No | Results to skip (default: 0) |

**Columns** (`rows`): `prompt_id`, `chat_id`, `model_id`, `model_channel_id`, `date`, `query_index`, `query_text`

The other views aggregate web search, shopping and synthetic fanouts, the numbers the Query fanouts page shows. They take `prompt_id`, `model_channel_id`, `topic_id` and `tag_id`, not `chat_id` or `model_id`, and ignore `fields`.

* `queries`: `query_text`, `type`, one column per dimension, `occurrences`. Also returns `distinct_queries` and `total_occurrences`.
* `terms`: `term`, `occurrences`, `occurrences_previous`, `change`, `share`, compared with the same number of days before `start_date`. With dimensions: `term`, the bucket and `model_channel_id` columns, `occurrences`, `total_occurrences`, `share`. Without `terms`, the ten top terms are broken down.
* `brands`: `brand_name`, `domain`, `is_own`, `chats`.

***

## list\_shopping\_queries

Lists the product/shopping sub-queries an AI engine fanned out to while answering prompts. Each row is one shopping sub-query and the distinct products returned for it in a given chat.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `start_date` | string | Yes | Start date (YYYY-MM-DD) |
| `end_date` | string | Yes | End date (YYYY-MM-DD) |
| `prompt_id` | string | No | Only queries from chats produced by this prompt |
| `chat_id` | string | No | Only queries from this chat |
| `model_id` | string | No | Only queries from this AI engine |
| `model_channel_id` | string | No | Only queries from this model channel |
| `topic_id` | string | No | Only queries from chats whose prompt belongs to this topic |
| `tag_id` | string | No | Only queries from chats whose prompt carries this tag |
| `limit` | number | No | Max results (default: 100, max: 10000) |
| `offset` | number | No | Results to skip (default: 0) |

**Columns:** `prompt_id`, `chat_id`, `model_id`, `model_channel_id`, `date`, `query_text`, `products`

`products` is an array of product names extracted for that sub-query.

***

## list\_products

List a project's products with headline AI-visibility metrics over a date range.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `start_date` | string | Yes | Start date (YYYY-MM-DD) |
| `end_date` | string | Yes | End date (YYYY-MM-DD) |
| `search` | string | No | Filter by product or brand name |
| `source` | string | No | `CATALOG` (claimed, customer-uploaded) or `LLM` (AI-detected) |
| `chat_scope` | string | No | Visibility denominator: `shopping` (product-gallery chats, default) or `all` |
| `order_by` | string | No | `visibility` (default), `win_rate`, `avg_position`, `mention_count`, `name` |
| `direction` | string | No | `asc` or `desc` (default `desc`) |
| `tag_operator` | string | No | Match any (`or`, default) or all (`and`) of `tag_ids` |
| `brand_ids`, `category_ids`, `product_ids`, `merchant_ids`, `country_codes`, `model_channel_ids`, `topic_ids`, `tag_ids` | string\[] | No | Standard shopping filters. `brand_ids` are `global_brand_id` values; selecting a parent category also matches its descendants |
| `limit` | number | No | Max results (default: 100, max: 1000) |
| `offset` | number | No | Results to skip (default: 0) |

**Columns:** `id`, `name`, `brand`, `image_url`, `price_range`, `categories`, `mention_count`, `win_count`, `avg_position`, `visibility`, `share_of_voice`

***

## get\_product

Detailed metrics for one product over a date range — the drill-down companion to [`list_products`](#list-products).

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `product_id` | string | Yes | The product id (resolve via `list_products`) |
| `start_date` | string | Yes | Start date (YYYY-MM-DD) |
| `end_date` | string | Yes | End date (YYYY-MM-DD) |
| `chat_scope` | string | No | `shopping` (default) or `all` |
| `country_codes`, `model_channel_ids`, `topic_ids`, `tag_ids` | string\[] | No | Metric filters |

**Returns:** `{ data, primary_currency }`. `data` is `null` if the product isn't in the project, otherwise: `id`, `name`, `brand`, `description`, `image_url`, `source`, `first_seen_at`, `price_range`, `visibility`, `win_rate`, `avg_position`, `mention_count`, a `*_delta` for each metric (vs the immediately preceding equal-length period), and `ai_price_map` / `ai_price_delta_map` (per-currency median price across the product's AI mentions).

***

## get\_shopping\_attributes

The LLM-extracted attribute grid — characteristics the AI associates with a product (or the whole catalog), compared against competitors.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `start_date` | string | Yes | Start date (YYYY-MM-DD) |
| `end_date` | string | Yes | End date (YYYY-MM-DD) |
| `scope` | string | No | `product` (default, needs `product_id`) or `overview` (whole catalog) |
| `product_id` | string | No | Required when `scope=product` |
| `tab` | string | No | `characteristics` (default), `facts`, or `dimensions` |
| `compare_by` | string | No | Grid columns: `brand` (default) or `product` (`scope=product` only) |
| `competitor_count` | number | No | Competitor columns (default: 6; `0` disables competitor lookup) |
| `category_ids`, `model_ids`, `model_channel_ids`, `country_codes`, `topic_ids`, `tag_ids` | string\[] | No | Filters |
| `search` | string | No | Substring match on dimension name |

**Returns:** a nested grid `{ tab, competitors[], groups[], total_groups }` (not columnar). Every group's per-competitor arrays align to the `competitors` order. Group shape depends on `tab` (`characteristics`, `facts`, or `dimensions`). Deltas are computed against an explicit comparison window (`previous_start_date` / `previous_end_date`) or the equal-length window immediately before.

***

## get\_shopping\_summary

Aggregate shopping metrics for a project over a date range, as a single columnar row. Deltas compare against the explicit `previous_start_date` / `previous_end_date` window when given, otherwise the auto-derived previous period.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `start_date` | string | Yes | Start date (YYYY-MM-DD) |
| `end_date` | string | Yes | End date (YYYY-MM-DD) |
| `previous_start_date`, `previous_end_date` | string | No | Explicit comparison window for deltas. Provide both, or omit both to auto-derive |
| `chat_scope` | string | No | Visibility denominator: `shopping` (default) or `all` |
| `brand_ids` | string\[] | No | Filter products to these `global_brand_id` values |
| `product_ids`, `category_ids`, `merchant_ids`, `country_codes`, `model_channel_ids`, `topic_ids`, `tag_ids` | string\[] | No | Standard shopping filters |
| `tag_operator` | string | No | Match any (`or`, default) or all (`and`) of `tag_ids` |
| `fields` | string\[] | No | Subset of columns to return |

**Columns:** `avg_visibility`, `avg_visibility_delta`, `avg_win_rate`, `avg_win_rate_delta`, `avg_position`, `avg_position_delta`

***

## get\_shopping\_trend

A product or brand shopping time series. Requires `bucket` and exactly one of `product_ids` or `brand_ids`.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `start_date` | string | Yes | Start date (YYYY-MM-DD) |
| `end_date` | string | Yes | End date (YYYY-MM-DD) |
| `bucket` | string | Yes | `day`, `week`, or `month` |
| `product_ids` | string\[] | Sometimes | Products to chart (exactly one of `product_ids` or `brand_ids`) |
| `brand_ids` | string\[] | Sometimes | `global_brand_id` values to chart (exactly one of `product_ids` or `brand_ids`) |
| `category_ids`, `merchant_ids`, `country_codes`, `model_channel_ids`, `topic_ids`, `tag_ids` | string\[] | No | Standard shopping filters |
| `tag_operator` | string | No | Match any (`or`, default) or all (`and`) of `tag_ids` |
| `fields` | string\[] | No | Subset of point fields to return |

**Returns:** a nested object `{ entity_type, series }` (not columnar). Each `series` entry is `{ entity_id, points }`, and each point carries `date`, `visibility`, `win_rate`, `avg_position`, `sov`, `has_data`.

***

## list\_shopping\_demand

Ranked shopping queries, search fan-out queries, or query terms over a date range — what shoppers are asking that surfaces your category.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `kind` | string | Yes | `shopping_query`, `fanout_query`, or `query_term` |
| `start_date` | string | Yes | Start date (YYYY-MM-DD) |
| `end_date` | string | Yes | End date (YYYY-MM-DD) |
| `previous_start_date`, `previous_end_date` | string | No | Explicit comparison window for `delta`. Provide both, or omit both to auto-derive |
| `mode` | string | No | `top` (default), `trending`, `losing`, or `new` |
| `category_ids`, `country_codes`, `model_channel_ids`, `topic_ids`, `tag_ids` | string\[] | No | Filters |
| `tag_operator` | string | No | Match any (`or`, default) or all (`and`) of `tag_ids` |
| `n` | number | No | n-gram width for `kind=query_term` (1–3, default 2) |
| `limit` | number | No | Max results (default: 20, max: 1000) |

**Columns:** `kind`, `text`, `distinct_chat_count`, `distinct_chat_count_previous`, `delta`

***

## list\_shopping\_performance

Ranked product or category shopping performance over a date range.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `entity_type` | string | Yes | `product` or `category` |
| `start_date` | string | Yes | Start date (YYYY-MM-DD) |
| `end_date` | string | Yes | End date (YYYY-MM-DD) |
| `previous_start_date`, `previous_end_date` | string | No | Explicit comparison window for deltas. Provide both, or omit both to auto-derive |
| `mode` | string | No | `top` (default), `trending`, or `losing` |
| `order_by` | string | No | `visibility` (default), `win_rate`, or `appearances` |
| `direction` | string | No | `asc` or `desc` (default `desc`) |
| `brand_ids` | string\[] | No | For products, filter to these `global_brand_id` values |
| `product_ids` | string\[] | No | Filter to these products |
| `category_id` | string | No | For categories, return only this category |
| `category_ids`, `merchant_ids`, `country_codes`, `model_channel_ids`, `topic_ids`, `tag_ids` | string\[] | No | Standard shopping filters |
| `tag_operator` | string | No | Match any (`or`, default) or all (`and`) of `tag_ids` |
| `limit` | number | No | Max results (default: 20, max: 1000) |
| `offset` | number | No | Results to skip (default: 0) |

**Columns:** `entity_type`, `entity_id`, `name`, `visibility`, `visibility_delta`, `win_rate`, `win_rate_delta`, `avg_position`, `avg_position_delta`, `appearances`, `appearances_delta`

***

## list\_merchants

Ranks the merchants whose product offers surfaced in AI answers over a date range, so you can see which sellers own the buy box for your category. A merchant is a seller such as Amazon or eBay, not a brand.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `start_date` | string | Yes | Start date (YYYY-MM-DD) |
| `end_date` | string | Yes | End date (YYYY-MM-DD) |
| `fields` | string\[] | No | Columns to return. Omit for all of them. |
| `category_ids` | string\[] | No | Narrow the population to these categories, for a per-category seller breakdown |
| `product_ids` | string\[] | No | Narrow the population to these products (from [`list_products`](#list-products)). Share of voice is then the share among that product's sellers. |
| `merchant_ids` | string\[] | No | Keep only these merchants' rows without shrinking the share-of-voice denominator, for comparing two known sellers |
| `order_by` | string | No | Metric to rank by: `mention_count` (default), `win_rate`, `avg_rating`, `avg_position` |
| `direction` | string | No | `asc` or `desc` (default: `desc`) |
| `limit` | number | No | Max results (default: 20, max: 200) |
| `offset` | number | No | Results to skip (default: 0) |

**Columns:** `merchant_id`, `name`, `domain`, `mention_count`, `share_of_voice`, `win_rate`, `avg_position`, `avg_rating`, and a `*_delta` for each metric against the previous window.

| Field | Description |
| - | - |
| `share_of_voice` | 0-1. This merchant's mentions over all merchants' mentions in the filtered population. |
| `win_rate` | 0-1 buy-box rate. Position-1 mentions over all mentions. |
| `avg_position` | Rank, so lower is better |
| `avg_rating` | Mean star rating out of 5, or `null` when the merchant is unrated |

Merchants with no mentions in the current window are left out entirely.

> [!TIP]
>
> Pass a `merchant_id` from here into [`get_product`](#get-product) as `merchant_ids` to see that seller's rating and price for a specific product.

***

## list\_categories

List the project's product categories. Categories are an org-wide tree (e.g. `Footwear > Shoes > Running Shoes`); each row carries its full `path` and `parent_id`, so the flat list rebuilds the tree. Use a row's `id` as a `category_id` when creating or updating products.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `fields` | string\[] | No | Subset of columns to return |

**Columns:** `id`, `name`, `path`, `parent_id`

***

## list\_global\_brands

Search Peec's global brand catalog — the shared registry of real-world brands (e.g. Nike, Apple) that products attach to. Use it to find the `global_brand_id` before [`create_products`](#create-products). This is **not** the same as [`list_brands`](#list-brands): that returns the brands tracked inside a project, while this searches every brand in Peec's catalog. The two have different ids.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `search` | string | No | Look up a brand by name or alias (the primary way to use this tool) |
| `ownership` | string | No | Instead of searching the catalog, list the project's shopping brands by `global_brand_id`, ranked by all-time shopping mentions: `own`, `competitor`, or `all` |
| `fields` | string\[] | No | Subset of columns to return |
| `limit` | number | No | Max results (default: 100, max: 1000) |
| `offset` | number | No | Results to skip (default: 0) |

**Columns:** `id`, `name`, `domain`, `description`, `mention_count`, `is_own`

***

## list\_bots

Lists every AI agent bot tracked in [Agent Analytics](https://docs.peec.ai/crawl-insights.md). Each entry has the bot's ID (the user agent string Peec matches), its provider, and its type. Use the returned IDs with [`get_agent_visits`](#get-agent-visits) to filter visit counts by specific bots.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `limit` | number | No | Max results (default: 1000, max: 10000) |
| `offset` | number | No | Results to skip (default: 0) |

**Returns:** `{ data: [{ id, provider, type }] }`.

| Field | Description |
| - | - |
| `id` | Bot identifier — the user agent name (e.g. `GPTBot`, `ClaudeBot`, `PerplexityBot`) |
| `provider` | Vendor behind the bot (e.g. `OpenAI`, `Anthropic`, `Google`) |
| `type` | Bot purpose. One of `training`, `search`, `userQuery`, `other` |

Bot types:

* `training` — crawlers that collect data to build or refine AI models (e.g. `GPTBot`, `ClaudeBot`)
* `search` — bots that browse the web to find up-to-date information for AI-powered search (e.g. `PerplexityBot`)
* `userQuery` — bots triggered by a real-time user query that fetch content on the user's behalf
* `other` — miscellaneous bots

> [!NOTE]
>
> Agent Analytics requires a connected data source (Cloudflare Workers or a CSV/CLF log upload). See [Crawl Insights](https://docs.peec.ai/crawl-insights.md) for setup.

***

## get\_agent\_visits

Aggregate AI bot visit counts from your connected access logs over a date range. Without `group_by`, returns the total as a single `{ visits: N }` row. With `group_by`, returns one row per distinct value of the chosen dimension(s), sorted by `visits` descending.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `start_date` | string | Yes | Start date (YYYY-MM-DD) |
| `end_date` | string | Yes | End date (YYYY-MM-DD) |
| `group_by` | string\[] | No | Dimension(s) to group visit counts by. Omit for the total. Values: `bot_id`, `response_status`, `request_host`, `request_path`. |
| `bot_ids` | string\[] | No | Filter to specific bot IDs. Resolve via [`list_bots`](#list-bots). |
| `time_bucket` | string | No | Bucket results by time period. One of `hour`, `day`, `week`, `month`. Each row gets a `time_bucket` timestamp marking the start of the bucket. |
| `limit` | number | No | Max grouped rows (default: 100, max: 10000) |
| `offset` | number | No | Grouped rows to skip (default: 0) |

### Group-by dimensions

| Dimension | Description |
| - | - |
| `bot_id` | Break down by bot. Combine with [`list_bots`](#list-bots) to resolve IDs to provider names. |
| `response_status` | Break down by HTTP response status (`200`, `404`, etc.) |
| `request_host` | Break down by hostname |
| `request_path` | Break down by URL path |

Multiple values produce a cross-dimensional breakdown — for example, `["bot_id", "response_status"]` gives per-bot, per-status counts. Combine with `time_bucket` to get e.g. per-bot, per-day counts.

### Response fields

`{ data: [...], totalCount }`.

| Field | Description |
| - | - |
| `visits` | Visit count for the row |
| `bot_id` | Present when `bot_id` is in `group_by` |
| `response_status` | Present when `response_status` is in `group_by` |
| `request_host` | Present when `request_host` is in `group_by` |
| `request_path` | Present when `request_path` is in `group_by` |
| `time_bucket` | Present when `time_bucket` is set. ISO-style timestamp marking the start of the bucket. |
| `totalCount` | Total grouped rows ignoring `limit`/`offset`. Equals `1` when `group_by` is omitted. |

> [!TIP]
>
> Pair `get_agent_visits` with the report tools to connect bot activity to AI visibility. For example, `request_path` grouping surfaces which of your pages bots hit most; [`get_url_report`](#get-url-report) shows how those same pages perform as AI sources.

***

## get\_ai\_referrals

People who arrived on your own website from an AI assistant, measured through the project's connected Google Analytics property. This is traffic that reached your site, which is a different question from whether AI answers cite you ([`get_url_report`](#get-url-report)) or whether AI crawlers fetch your pages ([`get_agent_visits`](#get-agent-visits)).

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `start_date` | string | Yes | Start date (YYYY-MM-DD). Ranges are capped at 366 days. |
| `end_date` | string | Yes | End date (YYYY-MM-DD) |
| `group_by` | string\[] | No | Up to 3 dimensions. Omit for period totals. Pass exactly one to list that dimension's values. |
| `metrics` | string\[] | No | `events`, `session_starts`, `conversions`, `revenue`. Omit for all of them. |
| `time_bucket` | string | No | `day`, `week` or `month`. Adds a `time_bucket` column holding the first day of each bucket. There's no hourly bucket, because the data is daily. |
| `assistants` | string\[] | No | Filter by assistant display name. Names must match exactly and an unrecognized one is rejected rather than ignored, so resolve them with [`list_referral_sources`](#list-referral-sources). |
| `sources` | string\[] | No | Filter by raw referrer host, e.g. `chatgpt.com` |
| `countries` | string\[] | No | ISO 3166-1 alpha-2 country codes |
| `devices` | string\[] | No | Device categories such as `mobile`. Property-specific and case-sensitive: an unmatched value returns zeros rather than an error. |
| `event_names` | string\[] | No | GA4 event names. Property-specific, so discover them with `group_by: ["event_name"]` first. |
| `mediums` | string\[] | No | GA4 session mediums, e.g. `ai-assistant`, to isolate traffic identified by medium rather than by a known referrer host |
| `order_by` | string | No | Must be one of the requested metrics, or `time_bucket` |
| `limit` | number | No | Max grouped rows |
| `offset` | number | No | Grouped rows to skip |

### Group-by dimensions

| Dimension | Description |
| - | - |
| `assistant` | ChatGPT, Perplexity, Claude, Gemini, Copilot, Grok and around 57 more. Rolls up every host an assistant uses, so prefer it over `source`. |
| `platform` | The company behind the assistants: OpenAI, Google, Microsoft, Anthropic and so on |
| `source` | The raw referrer host. Rows grouped by `source` also carry `assistant` and `platform`, so naming a host never needs a second call. An unrecognized referrer appears under its own hostname. |
| `medium` | GA4 session medium. Only `ai-assistant` and the mediums AI referrers arrive on, since non-AI traffic is out of scope here. |
| `country` | ISO country code |
| `device` | `desktop`, `mobile` or `tablet` |
| `event_name` | The GA4 event, such as `page_view` or `purchase` |
| `landing_page` | The session's entry page, repeated on every event in that session |
| `page_path` | The page the event fired on, with UUIDs collapsed to `*`. Doesn't join to `landing_page`. |
| `host` | Which of your own hostnames |

### Response fields

`{ columns, rows, rowCount, total_count, currency }`.

| Field | Description |
| - | - |
| `events` | GA4 event count |
| `session_starts` | GA4 `session_start` events. Not GA4's "sessions" metric. |
| `conversions` | GA4 key events. One visit can contribute several, and which events count is your property's own configuration. |
| `revenue` | Purchase revenue in the property's reporting currency, which comes back as `currency` on the result |
| `total_count` | The number of grouped rows the filters match, not a sum of any metric |

Unknown dimension values come back as `(not set)`.

> [!NOTE]
>
> There's no `list_event_names` or `list_countries` tool. To discover a dimension's values, call this with `group_by` set to that one dimension. When you build a filter, don't also filter on the dimension you're listing, or every option you haven't already picked disappears.

> [!NOTE]
>
> Referral figures are a lower bound. Only referrer-visible traffic reaches GA4, so assistant native apps land as Direct and Gemini often counts as Organic Search.

***

## list\_referral\_sources

Every AI assistant Peec can attribute referral traffic to, whether or not your project has seen traffic from it. Use it to resolve the exact display name for the `assistants` filter on [`get_ai_referrals`](#get-ai-referrals), and to recognize a raw host in that tool's results.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `fields` | string\[] | No | Columns to return. Omit for all of them. |
| `limit` | number | No | Max rows (default and max: 1000) |
| `offset` | number | No | Rows to skip (default: 0) |

**Columns:** `source`, `assistant`, `platform`

One row per referrer host, so an assistant reachable on several hosts appears once per host. The list is maintained by hand and reviewed quarterly, so a very new assistant may be missing.

> [!NOTE]
>
> This tool takes no `project_id` and no date range. For the assistants that actually sent your project traffic, call [`get_ai_referrals`](#get-ai-referrals) with `group_by: ["assistant"]` instead.

***

## list\_domain\_classifications

Lists the custom domain classifications defined for a project. These complement the built-in classifications (`Corporate`, `Competitor`, `Editorial`, `Institutional`, `Other`, `Reference`, `UGC`, `You`, `Related`) and can be assigned to specific domains via [`assign_domain_classification`](#assign-domain-classification).

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `limit` | number | No | Max results (default: 100) |
| `offset` | number | No | Results to skip (default: 0) |

**Columns:** `name`, `color`

***

## list\_url\_classifications

Lists the custom URL classifications defined for a project. These complement the built-in classifications (`Homepage`, `Category Page`, `Product Page`, `Listicle`, `Comparison`, `Profile`, `Alternative`, `Discussion`, `How-To Guide`, `Article`, `Other`) and can be assigned to specific URLs via [`assign_url_classification`](#assign-url-classification).

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `limit` | number | No | Max results (default: 100) |
| `offset` | number | No | Results to skip (default: 0) |

**Columns:** `name`, `color`

***

## get\_brand\_report

Returns brand visibility, sentiment, position, and share of voice across AI search engines.

### Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `start_date` | string | Yes | Start date (YYYY-MM-DD) |
| `end_date` | string | Yes | End date (YYYY-MM-DD) |
| `limit` | number | No | Max results (default: 100) |
| `offset` | number | No | Results to skip (default: 0) |
| `dimensions` | string\[] | No | Break down by: `prompt_id`, `model_id` (deprecated, prefer `model_channel_id`), `model_channel_id`, `tag_id`, `topic_id`, `date`, `country_code`, `chat_id` |
| `filters` | object\[] | No | Filter results (see [Filtering](#filtering)) |
| `order_by` | object\[] | No | Sort by one or more fields (see [Sorting](#sorting)). Sortable: `visibility`, `visibility_count`, `mention_count`, `sentiment`, `position`, `share_of_voice`. |

### Response fields

| Field | Type | Description |
| - | - | - |
| `brand_id` | string | The brand ID |
| `brand_name` | string | The brand name |
| `visibility` | number | 0 to 1. Fraction of AI responses that mention the brand |
| `mention_count` | number | Total times the brand was mentioned |
| `share_of_voice` | number | 0 to 1. Brand's share of total mentions across all brands |
| `sentiment` | number | 0 to 100. How positively AI platforms describe the brand. Most brands score 65 to 85 |
| `position` | number | Average rank when mentioned. Lower is better (1 = mentioned first) |

The response also includes raw aggregation fields (`visibility_count`, `visibility_total`, `sentiment_sum`, `sentiment_count`, `position_sum`, `position_count`) for custom calculations across segments.

***

## get\_domain\_report

Returns source domain retrieval and citation metrics across AI search engines.

### Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `start_date` | string | Yes | Start date (YYYY-MM-DD) |
| `end_date` | string | Yes | End date (YYYY-MM-DD) |
| `limit` | number | No | Max results (default: 100) |
| `offset` | number | No | Results to skip (default: 0) |
| `dimensions` | string\[] | No | Break down by: `prompt_id`, `model_id` (deprecated, prefer `model_channel_id`), `model_channel_id`, `tag_id`, `topic_id`, `date`, `country_code`, `chat_id` |
| `filters` | object\[] | No | Filter results (see [Filtering](#filtering)) |
| `order_by` | object\[] | No | Sort by one or more fields (see [Sorting](#sorting)). Sortable: `citation_rate`, `retrieval_count`, `citation_count`. (`retrieved_percentage` and `retrieval_rate` are computed from a separate aggregate and aren't sortable.) |

### Response fields

| Field | Type | Description |
| - | - | - |
| `domain` | string | The source domain (e.g. `example.com`) |
| `classification` | string | Domain type: `You`, `Corporate`, `Editorial`, `Institutional`, `UGC`, `Reference`, `Competitor`, `Related`, `Other`, the name of a custom classification, or `null` |
| `retrieved_percentage` | number | 0 to 1. Fraction of chats that retrieved this domain |
| `retrieval_rate` | number | Average URLs retrieved per chat. Can exceed 1.0 (this is an average, not a percentage) |
| `citation_rate` | number | Average citations per distinct chat that retrieved this domain: `citation_count / retrieved_chat_count`. Can exceed 1.0. This is **not** `citation_count / retrieval_count` — dividing by `retrieval_count` gives the per-retrieval average, which is the deprecated `citation_avg` |
| `retrieval_count` | number | Total distinct URL retrievals from this domain across all chats (raw numerator of `retrieval_rate`). A single chat can retrieve several URLs from the same domain, so this is `>= retrieved_chat_count` |
| `citation_count` | number | Total citations from this domain (raw count) |
| `retrieved_chat_count` | number | Number of distinct chats in which this domain was retrieved (denominator of `citation_rate`) |
| `mentioned_brand_ids` | string\[] | Brand IDs mentioned alongside URLs from this domain (may be empty) |

***

## get\_url\_report

Returns URL-level retrieval and citation metrics across AI search engines.

### Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `start_date` | string | Yes | Start date (YYYY-MM-DD) |
| `end_date` | string | Yes | End date (YYYY-MM-DD) |
| `limit` | number | No | Max results (default: 100) |
| `offset` | number | No | Results to skip (default: 0) |
| `dimensions` | string\[] | No | Break down by: `prompt_id`, `model_id` (deprecated, prefer `model_channel_id`), `model_channel_id`, `tag_id`, `topic_id`, `date`, `country_code`, `chat_id` |
| `filters` | object\[] | No | Filter results (see [Filtering](#filtering)) |
| `order_by` | object\[] | No | Sort by one or more fields (see [Sorting](#sorting)). Sortable: `retrieval_count`, `retrievals` (deprecated alias of `retrieval_count`), `citation_count`, `citation_rate`. |

### Response fields

| Field | Type | Description |
| - | - | - |
| `url` | string | The full source URL |
| `classification` | string | Page type: `Homepage`, `Category Page`, `Product Page`, `Listicle`, `Comparison`, `Profile`, `Alternative`, `Discussion`, `How-To Guide`, `Article`, `Other`, the name of a custom classification, or `null` |
| `title` | string | Page title (may be `null`) |
| `channel_title` | string | Channel or author name for YouTube videos, Reddit threads, etc. (may be `null`) |
| `citation_count` | number | Total citations across all chats |
| `retrieval_count` | number | Total distinct chats that retrieved this URL |
| `citation_rate` | number | Average citations per retrieval. Can exceed 1.0 |
| `mentioned_brand_ids` | string\[] | Brand IDs mentioned alongside this URL (may be empty) |

***

## get\_links\_report

Returns the domains AI answers linked to in their own text, such as a brand name hyperlinked to its homepage. A link is never one of the sources the answer retrieved or cited; use [`get_domain_report`](#get-domain-report) or [`get_url_report`](#get-url-report) for those. Only some engines write links (ChatGPT, Google AI Overview and AI Mode, the Gemini API and Claude), so a report filtered to other engines is empty.

### Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `start_date` | string | Yes | Start date (YYYY-MM-DD) |
| `end_date` | string | Yes | End date (YYYY-MM-DD) |
| `limit` | number | No | Max results (default: 100, max: 1000) |
| `offset` | number | No | Results to skip (default: 0) |
| `dimensions` | string\[] | No | Break down by: `url` (the linked page), `prompt_id`, `model_id` (deprecated, prefer `model_channel_id`), `model_channel_id`, `tag_id`, `topic_id`, `date`, `week`, `month`, `country_code`, `chat_id` |
| `filters` | object\[] | No | `{field, operator, values}` with operator `in` or `not_in`, AND'd together. Fields: `model_id` (deprecated), `model_channel_id`, `country_code`, `prompt_id`, `tag_id`, `topic_id`, `chat_id`, `domain`, `url`. The first seven narrow both `linked_chat_count` and `total_chat_count`; `domain` and `url` narrow only `linked_chat_count`. |
| `order_by` | object\[] | No | Sort by one or more fields (see [Sorting](#sorting)). Sortable: `linked_chat_count`, `link_count`, `average_link_position`, and `date`, `week` or `month` when that dimension is set. |

### Response fields

| Field | Type | Description |
| - | - | - |
| `domain` | string | The linked domain (e.g. `acme.com`) |
| `url` | string | The linked page, when the `url` dimension is set |
| `classification` | string | `You`, `Competitor`, the classification you assigned to the domain (a custom one or a built-in type such as `Editorial`), or `Other` |
| `linked_percentage` | number | 0 to 1. Fraction of chats in scope whose answer linked to this domain |
| `linked_chat_count` | number | Distinct chats whose answer linked to this domain |
| `link_count` | number | Total links to this domain. An answer can link the same page more than once |
| `average_link_position` | number | Average rank of this domain's links among each answer's links, where 1 is the first link in the answer |
| `total_chat_count` | number | Chats in scope, the denominator of `linked_percentage` |

***

## get\_url\_content

Returns the scraped markdown content of a source URL Peec has indexed. Use this after `get_url_report` to inspect the actual content an AI engine read. Useful for content gap analysis and comparing why a competitor URL wins citations.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `url` | string | Yes | Full URL of a source. Copy it verbatim from `get_url_report`. Trailing slashes and scheme variations change the resolved source ID. |
| `max_length` | number | No | Cap on returned content length in characters. Increase and re-request if `truncated` is `true`. |
| `version` | number | No | A stored version from `list_url_content_versions` to read instead of the current content |

### Response fields

| Field | Type | Description |
| - | - | - |
| `url` | string | The requested URL |
| `title` | string | Page title (may be `null`) |
| `domain` | string | The source domain |
| `channel_title` | string | Channel or author name for YouTube videos, Reddit threads, etc. (may be `null`) |
| `classification` | string | Domain-level classification (same values as `get_domain_report`) |
| `url_classification` | string | Page-level classification (same values as `get_url_report`) |
| `content` | string | Markdown extracted via Readability + Turndown. `null` if Peec has tracked the URL but scraping has not completed yet (can take up to 24h) |
| `content_length` | number | Original character length before truncation. `0` when content is `null` |
| `truncated` | boolean | `true` if content was truncated to `max_length` |
| `content_updated_at` | string | ISO timestamp of the scrape that produced the returned content, or `null` if not yet scraped |

Returns a 404 if the URL has never been retrieved by any Peec project, or if `version` does not exist. Peec only scrapes URLs that appear as AI sources.

***

## list\_url\_content\_versions

Lists the stored snapshots of a source URL's content, newest first. Peec stores a new version only when a re-scrape finds changed content. A URL is re-scraped when it is cited again and its last scrape is several days old, so history is uneven and many URLs have a single version. Use it to see whether and when a cited page changed, then pass two version numbers to `get_url_content_diff`, or one to `get_url_content` to read that version in full.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `url` | string | Yes | Full URL of a source, copied verbatim from `get_url_report` or `get_url_content` |
| `limit` | number | No | Max versions to return (default: 100) |
| `offset` | number | No | Versions to skip (default: 0) |

### Response fields

| Field | Type | Description |
| - | - | - |
| `version` | number | Version number. Higher is newer |
| `scraped_at` | string | ISO timestamp of the scrape that produced this version |

Returns a 404 if Peec has no record of the URL.

***

## get\_url\_content\_diff

Returns a unified diff between two stored versions of a source URL's content. Without version numbers it compares the newest version with the one before it. A diff covers everything that changed between two scrapes, including footers, dates and changes in how the page was scraped.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `url` | string | Yes | Full URL of a source, copied verbatim from `get_url_report` or `get_url_content` |
| `from_version` | number | No | Older version to compare from. Defaults to the version before `to_version` |
| `to_version` | number | No | Newer version to compare to. Defaults to the newest version |
| `max_length` | number | No | Cap on the diff in characters (default: 20,000). Increase and re-request if `truncated` is `true` |

### Response fields

| Field | Type | Description |
| - | - | - |
| `from_version` | number | The older version compared |
| `from_scraped_at` | string | ISO timestamp of the scrape that produced `from_version` |
| `to_version` | number | The newer version compared |
| `to_scraped_at` | string | ISO timestamp of the scrape that produced `to_version` |
| `diff` | string | Unified diff of the page's markdown |
| `truncated` | boolean | `true` if the diff was cut to `max_length` |

Returns a 404 if Peec has no record of the URL, if a version does not exist, or if the URL has only one version.

***

## get\_brand\_perception\_brand\_attributes

How AI models describe your own brand: attribute clusters such as "Luxury" or "Racing Heritage", each with a prominence score. This is the [Brand Perception](https://docs.peec.ai/brand-perception.md) market view, read as data.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `fields` | string\[] | No | Columns to return. Omit for all of them. |
| `model_channel_ids` | string\[] | No | Only answers from these engine channels (from [`list_model_channels`](#list-model-channels)). Omit to aggregate across every tracked channel. |
| `limit` | number | No | Max results (default: 100, max: 1000) |
| `offset` | number | No | Results to skip (default: 0) |

**Columns:** `name`, `score`, `members`

| Field | Description |
| - | - |
| `score` | 0-100. The attribute's average prominence per AI answer, so a higher score means it's mentioned earlier and more often. |
| `members` | The raw extracted attributes folded into the cluster |

This one is a snapshot of the latest brand-perception run, where the ranking and competitive-breakdown tools below aggregate across many runs. An empty result means the first run hasn't completed yet.

> [!NOTE]
>
> Scores here are not ratios. Display them as returned and never multiply by 100. Brand Perception carries no date range, so none of these tools accepts one.

***

## get\_brand\_perception\_attribute\_rankings

Where your own brand places against competitors on each brand-perception attribute, and which attributes it has never surfaced on at all.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `fields` | string\[] | No | Columns to return. Omit for all of them. |
| `model_channel_ids` | string\[] | No | Only answers from these engine channels (from [`list_model_channels`](#list-model-channels)) |
| `industry` | string | No | Read the runs dispatched for this industry. Omit for the project's default, which is the industry with the most recent completed run. |
| `search` | string | No | Case-insensitive substring filter on the attribute name |
| `limit` | number | No | Max results (default: 100, max: 1000) |
| `offset` | number | No | Results to skip (default: 0) |

**Columns:** `name`, `ranking`, `competitors`

| Field | Description |
| - | - |
| `ranking` | Your brand's position among every brand scored for the attribute, ordered by average prominence. Lower is better, and `#1` means no brand is more prominent. Answers your brand never surfaced in count against it. |
| `competitors` | The competing brand names AI associates with the attribute, most prominent first |

Rows come back best-ranked first, with unranked last. A `ranking` of `null` means your brand has never once been described that way, which is a different problem from ranking fourth.

The response also reports the `industry` and `target_market` it read, and lists your other industries under `industries` when the project has more than one. Say which industry a number describes whenever that field is present. The target market is always the industry's most recently completed one and can't be picked.

> [!TIP]
>
> Pass a returned `name` to [`get_brand_perception_attribute_sources`](#get-brand-perception-attribute-sources) to see which pages are feeding that attribute.

***

## get\_brand\_perception\_competitive\_breakdown

The full attribute by brand matrix: for every attribute, the average prominence of your brand and each competitor across AI answers.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `fields` | string\[] | No | Columns to return. Omit for all of them. |
| `model_channel_ids` | string\[] | No | Only answers from these engine channels (from [`list_model_channels`](#list-model-channels)) |
| `industry` | string | No | Read the runs dispatched for this industry. Omit for the project's default. |
| `limit` | number | No | Max attributes (default: 100, max: 1000) |
| `offset` | number | No | Attributes to skip (default: 0) |

**Columns:** `attribute`, `brand`, `score`, `is_own`

`score` is 0-100, where higher means the brand tends to be mentioned earlier when AI talks about that attribute. `is_own` marks your brand. One row per attribute and brand cell, with attributes sorted by your own score, strongest first, and brands sorted by score within each attribute.

> [!NOTE]
>
> `limit` and `offset` paginate **attributes**, not rows. Each attribute contributes one row per brand, and `totalCount` is the attribute count. Set `limit` generously and check `totalCount` before assuming you have the whole matrix.

***

## get\_brand\_perception\_attribute\_sources

The pages feeding one attribute: the URLs AI answers cited while describing your brand that way. These are the pages to go after when you want to change how AI describes you on it.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `attribute` | string | Yes | The attribute name, exactly as the attribute tools returned it |
| `fields` | string\[] | No | Columns to return. Omit for all of them. |
| `model_channel_ids` | string\[] | No | Only answers from these engine channels (from [`list_model_channels`](#list-model-channels)) |
| `order_by` | object\[] | No | Sort by `occurrences`, `retrievals` or `citation_rate`. Defaults to `occurrences` descending. |
| `limit` | number | No | Max results (default: 100, max: 1000) |
| `offset` | number | No | Results to skip (default: 0) |

**Columns:** `url`, `title`, `domain`, `url_classification`, `domain_classification`, `occurrences`, `retrievals`, `citation_rate`

| Field | Description |
| - | - |
| `occurrences` | AI answers about this attribute that cited the source. This is the influence number. |
| `retrievals` | Distinct chats the source was retrieved in |
| `citation_rate` | Mean citations per retrieved chat |

> [!NOTE]
>
> Pass the attribute name verbatim. An unknown name returns an empty result rather than an error, so a paraphrase looks like "no sources". Unlike the rankings and breakdown tools, this one isn't scoped to an industry and takes no `industry` argument.
>
> `citation_rate` is an average, not a percentage. It can exceed 1. Display it as returned.

***

## get\_brand\_perception\_objections

The recurring arguments AI makes against your brand when a buyer is deciding. An attribute measures how strongly AI links you to a quality. An objection is the engine arguing against buying you at all.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `fields` | string\[] | No | Columns to return. Omit for all of them. |
| `model_channel_ids` | string\[] | No | Only answers from these engine channels (from [`list_model_channels`](#list-model-channels)) |
| `limit` | number | No | Max results (default: 100, max: 1000) |
| `offset` | number | No | Results to skip (default: 0) |

**Columns:** `name`, `score`, `members`

`score` is average prominence per AI answer from 0 to 100, displayed as returned. `members` holds the raw phrasings folded into each objection: a "Pricing" objection made of *expensive for what you get* is a different problem from one made of *pricing is hard to find*.

There's no competitor dimension and no ranking here, because the objection is about your brand alone. Data aggregates across every objection run and takes no industry argument.

***

## get\_brand\_perception\_objection\_sources

The pages AI models retrieved when asked about one objection.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `objection` | string | Yes | The objection name, exactly as [`get_brand_perception_objections`](#get-brand-perception-objections) returned it |
| `fields` | string\[] | No | Columns to return. Omit for all of them. |
| `model_channel_ids` | string\[] | No | Only answers from these engine channels (from [`list_model_channels`](#list-model-channels)) |
| `order_by` | object\[] | No | Sort by `occurrences`, `retrievals` or `citation_rate` |
| `limit` | number | No | Max results (default: 100, max: 1000) |
| `offset` | number | No | Results to skip (default: 0) |

Returns the same columns as [`get_brand_perception_attribute_sources`](#get-brand-perception-attribute-sources), with the same meanings. An unknown objection name returns an empty result rather than an error, and `citation_rate` is an average rather than a percentage.

***

## list\_brand\_perception\_attribute\_clusters

The editable attribute taxonomy behind Brand Perception: every cluster with its ID, its label, and the raw extracted attributes grouped under it. Read this when an attribute looks mislabeled, duplicated or split, and to resolve the `cluster_id` values that [`edit_brand_perception_attribute_clusters`](#edit-brand-perception-attribute-clusters) needs.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `fields` | string\[] | No | Columns to return. Omit for all of them. |
| `limit` | number | No | Max clusters (default: 100, max: 1000) |
| `offset` | number | No | Clusters to skip (default: 0) |

**Returns:** `{ columns, rows, rowCount, totalCount, unassigned }`.

**Columns:** `cluster_id`, `name`, `is_custom`, `members`

| Field | Description |
| - | - |
| `is_custom` | Marks a cluster someone added by hand |
| `unassigned` | Extracted attributes that belong to no cluster. Not paginated. |

This tool carries no scores, so use [`get_brand_perception_brand_attributes`](#get-brand-perception-brand-attributes) when the question is about scores. It does list clusters that have no score yet, which that tool won't show.

***

## list\_facts

The facts your project uses to check claims found in AI answers. A manual fact was added by a person; a website fact was extracted from your own site.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `origin` | string | No | Filter by how the fact was added: `manual` or `website` |
| `is_active` | boolean | No | Filter by whether the fact is used in future fact-checking |
| `fields` | string\[] | No | Columns to return. Omit for all of them. |
| `limit` | number | No | Max results (default: 100, max: 1000) |
| `offset` | number | No | Results to skip (default: 0) |

**Columns:** `id`, `text`, `origin`, `is_active`, `edited_at`, `created_at`

The response also returns `fact_limit`, how many active facts the project's plan allows (`null` means unlimited), and `active_fact_count`, how many it holds now. The difference is the room left before [`create_facts`](#create-facts) is rejected.

Results are newest first. An inactive fact stays visible here but is left out of future fact-checking. Deleted facts are never returned.

> [!TIP]
>
> Call this first to resolve fact IDs before [`update_facts`](#update-facts) or [`delete_facts`](#delete-facts).

***

## get\_actions

Returns Peec's opportunity-scored action recommendations for a project and date range. Use this whenever the user asks what to do next, how to improve visibility, or wants ranked next steps instead of raw data.

The tool is two-step: always call `scope=overview` first to see which slices have the biggest opportunity, then drill into `owned`, `editorial`, `reference`, or `ugc` for the actual textual recommendations.

### Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `start_date` | string | Yes | Start date (YYYY-MM-DD) |
| `end_date` | string | Yes | End date (YYYY-MM-DD) |
| `scope` | string | Yes | One of `overview`, `owned`, `editorial`, `reference`, `ugc` |
| `tag_ids` | string\[] | No | Only include actions matching these tags |
| `topic_ids` | string\[] | No | Only include actions for these topics |
| `model_ids` | string\[] | No | Only include actions for these AI models |
| `model_channel_ids` | string\[] | No | Only include actions for these model channels |
| `country_codes` | string\[] | No | ISO 3166-1 alpha-2 codes (e.g. `US`, `DE`) |
| `url_classification` | string | Sometimes | Required for `scope=editorial`, optional for `scope=owned`. Page types like `LISTICLE`, `ARTICLE`, `COMPARISON`. Pass values surfaced by an `overview` row. |
| `domain` | string | Sometimes | Required for `scope=reference` and `scope=ugc` (e.g. `wikipedia.org`, `reddit.com`). Pass values surfaced by an `overview` row. |

### Response (`scope=overview`)

| Field | Type | Description |
| - | - | - |
| `action_group_type` | string | `OWNED`, `EDITORIAL`, `REFERENCE`, or `UGC` |
| `url_classification` | string | Page type for OWNED / EDITORIAL rows (`null` for REFERENCE / UGC) |
| `domain` | string | Domain for REFERENCE / UGC rows (`null` for OWNED / EDITORIAL) |
| `opportunity_score` | number | Continuous score. Sort and rank by this. |
| `relative_opportunity_score` | number | Strength tier: `1` = Low, `2` = Medium, `3` = High. Use this for prose labels. |
| `gap_percentage`, `coverage_percentage`, `used_ratio`, `used_total` | number | Supporting stats |

Each overview row surfaces exactly one of `url_classification` or `domain`. Pass that value into the matching scope in the follow-up call.

### Response (`scope=owned` | `editorial` | `reference` | `ugc`)

| Field | Type | Description |
| - | - | - |
| `text` | string | The recommendation, may include markdown links to targets or examples |
| `group_type` | string | `OWNED`, `EDITORIAL`, `REFERENCE`, or `UGC` |
| `url_classification` | string | Page type (may be `null`) |
| `domain` | string | Domain (may be `null`) |
| `opportunity_score` | number | Continuous score. Sort and rank by this. |
| `relative_opportunity_score` | number | Strength tier: `1` = Low, `2` = Medium, `3` = High. |

> [!TIP]
>
> For example: `scope=overview` returns a row `{action_group_type: "UGC", domain: "youtube.com", opportunity_score: 0.30, ...}`. Follow up with `scope=ugc, domain="youtube.com"` to get ranked recommendations like "Contact [AutoPedia](https://...). Ask them for a collaboration."

***

## list\_actions

The actions Peec generated for your project, the same set the Actions page shows. Each action names a page or a site and a concrete change to make to it, with the impact expected if you do it.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `types` | string\[] | No | `TEMPLATE_ACTION`, `CONTENT_BRIEF`, `CATEGORY_SITUATION_BRIEF`, `CONTRADICTIONS_EXTERNAL_SOURCES`, `CONTRADICTIONS_OWNED_SOURCES`, `SEO_ISSUE`, `ROBOTS_TXT`, `AGENT_CRAWL_ERROR`, `PDP_OPTIMISATION`, `MANUAL_ACTION`, and `CONTENT_OPTIMISATION` (only on projects with Content optimization enabled). Omit for every published type. |
| `statuses` | string\[] | No | `PENDING` is untouched, `ACCEPTED` is in progress, `COMPLETED` is done, `REJECTED` was declined. Omit for every status. |
| `categories` | string\[] | No | The off-site playbook a template action follows, or the audit check an `SEO_ISSUE` or `AGENT_CRAWL_ERROR` came from. Content briefs and `ROBOTS_TXT` actions carry no category. |
| `domains` | string\[] | No | The site an `SEO_ISSUE` or `AGENT_CRAWL_ERROR` was raised against. Every other type carries no domain. |
| `topic_ids` | string\[] | No | Only actions on these topics (from [`list_topics`](#list-topics)) |
| `model_channel_ids` | string\[] | No | Only actions affecting these engine channels |
| `country_codes` | string\[] | No | ISO 3166-1 alpha-2 markets. An action carrying no market isn't scoped to one, so every selection matches it. |
| `targets` | string\[] | No | `owned` lands on a page you control, `earned` on a third-party page. A user-generated content (UGC) action is `earned` even when you write the post yourself. |
| `groups` | string\[] | No | The kind of surface the action lands on |
| `archetypes` | string\[] | No | The kind of page a content brief says to create. Template actions carry no archetype, so this narrows the answer to content briefs. |
| `platforms` | string\[] | No | Registrable domain of a third-party site (from [`list_action_platforms`](#list-action-platforms)). Own-site actions match nothing here. |
| `fields` | string\[] | No | Columns to return. Naming any column replaces the default set entirely, so include the ones you still want. |
| `order_by` | string | No | `impact` (default) is the order the Actions page shows, strongest expected gain first. `created_at` reads newest first, which is how to find what Peec generated since you last looked. |
| `direction` | string | No | `asc` or `desc` (default: `desc`) |
| `limit` | number | No | Max results (default: 100, max: 1000) |
| `offset` | number | No | Results to skip (default: 0) |

**Default columns:** `id`, `type`, `status`, `title`, `group`, `category`, `target`, `archetype`, `platform`, `domain`, `topic_id`, `source`, `impact`, `step_count`, `created_at`, `created_by`

**Also available via `fields`:** `country_codes`, `model_channel_ids`, `completed_step_count`, `status_updated_at`, `priority`, `assignee_user_id`, `due_on`, `tag_ids`

The list holds both the actions Peec generated and the ones you wrote yourself. `created_by` says which: `peec` or `customer`. Only a `customer` action can be deleted or have its `kind` changed. `priority`, `assignee_user_id`, `due_on`, and `tag_ids` are how you use the Actions page as a task tracker.

The published types differ in what they ask of you. `CONTRADICTIONS_EXTERNAL_SOURCES` requests a correction to one third-party source page, while `CONTRADICTIONS_OWNED_SOURCES` corrects one source page on a domain you own. `TEMPLATE_ACTION` is a per-platform playbook filled in for one page, such as pitching an editor or growing reviews. `CONTENT_BRIEF` is net-new content to write, with an outline. `CATEGORY_SITUATION_BRIEF` is also net-new content, with ready-to-use briefs carried in its steps rather than an outline. `SEO_ISSUE` is a technical fix to a site you control, and applies to the whole site rather than one page. `ROBOTS_TXT` says a site's `robots.txt` blocks AI crawlers. `AGENT_CRAWL_ERROR` says pages on a site you control refuse or fail AI crawlers: `domain` is the site, `category` the kind of error (`blocked`, `not_found`, `rate_limited`, `unavailable` or `other`), and the description's sources are the affected pages. `PDP_OPTIMISATION` improves one product page. `MANUAL_ACTION` is work you described yourself that matches none of the other shapes. `CONTENT_OPTIMISATION` improves an existing page you own. [`get_optimize_content`](#get-optimize-content) returns its article, suggestions, and score.

`CONTENT_OPTIMISATION` actions follow the same rules as the Actions page. They appear only when **Content optimization** is enabled for the project.

`impact` is how much the action is expected to gain, banded against every action in the project, so it reads the same whatever filters you apply. On an `SEO_ISSUE` it bands the issue's severity instead. It's the only measure of expected gain this tool returns.

> [!NOTE]
>
> Filters combine with AND, with one exception: `targets`, `groups`, `archetypes` and `platforms` combine with OR across the four, so passing an owned target alongside a platform widens the answer instead of narrowing it.

> [!NOTE]
>
> [`get_actions`](#get-actions) is a different, older opportunity-rollup tool. Fall back to it only when this one reports the feature isn't enabled for the project.

***

## get\_action

One action in full: what to do, the content brief when there is one, and the competitor demand behind it. Everything [`list_actions`](#list-actions) returns is here too.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `action_id` | string | Yes | The action ID, copied verbatim from `list_actions` |
| `fields` | string\[] | No | Extra fields to include (default: none) |

Always returned: `title`, `description` (the case for the action, with its sources), the fields you own on the action (`kind`, `notes`, `page_url`, `priority`, `assignee_user_id`, `due_on`, `tag_ids`, `repeat`, `time_range`, `language_codes`), `content_brief_outline` (content briefs only, holding the headline options, meta title and description, your angle, the facts you may claim, the points to cover, and the whole brief as one markdown document), and `opportunity` (the competitor demand a brief answers, also briefs only). A site-audit action, `SEO_ISSUE` or `ROBOTS_TXT`, carries neither, and its `description` and steps are the whole fix. `kind` is what you wrote the action as, and is `null` on an action Peec generated.

| Extra field | What it adds |
| - | - |
| `steps` | On a template action, the work itself: each step holds one or more options, and an option is a concrete edit with the text to use. On a content brief they're instead the material the brief was written from, labeled by `gap_type`: the fan-out prompts, what communities say, and the sources winning the topic today. |
| `outline_points` | The content brief section by section: what each one argues, the questions it answers, and the evidence behind it |
| `impacted_prompts` | The prompts this action affects. For source corrections, `own_coverage_score` is your owned domains’ share of all citations for the prompt in the action’s analysis window. Other types use their documented page-coverage score. |
| `ngrams` | Terms competitors use on the topic that your own pages don't. Template actions only. |

> [!TIP]
>
> `steps` and `outline_points` are each most of the response for their kind of action, so ask for them when you're about to do the work rather than while browsing.

An ID this project has no published action for is an error, whether it belongs to another project, to an action type this tool doesn't publish for the project, or to nothing at all.

For a `CONTENT_OPTIMISATION` action, [`get_optimize_content`](#get-optimize-content) returns the article, its suggestions, and the score.

***

## list\_action\_platforms

The third-party sites your project has actions on, alphabetically. These are the values [`list_actions`](#list-actions) accepts in its `platforms` filter.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |

**Columns:** `platform`

A platform is whichever domain an AI engine cited for your brand, so unlike the other filter dimensions it's per project and open-ended. Own-site actions carry no platform and never appear here.

***

## get\_optimize\_content

Reads the article behind a `CONTENT_OPTIMISATION` action, as you see it on the Optimize content screen: the current text, the suggestions beside it, and the optimization score. Only available when **Content optimization** is enabled for the project.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `action_id` | string | Yes | The ID of a `CONTENT_OPTIMISATION` action, copied verbatim from [`list_actions`](#list-actions) |

**Returns:** `{data}` with these fields:

| Field | Description |
| - | - |
| `action_id` | The action the article belongs to |
| `page_url` | The page being optimized |
| `score` | The optimization score out of 100, reflecting the suggestions accepted so far |
| `article` | The whole article as plain text, with suggestions resolved the way the screen shows them: an accepted rewrite reads as its new wording, a pending or dismissed one as the original |
| `suggestions` | One entry per suggestion, each with `id`, `category`, `text`, `state` (`pending`, `accepted`, or `rejected`), and `kind` |

A suggestion's `kind` decides how you act on it. A `rewrite` carries wording you can accept or dismiss with [`resolve_optimize_content_suggestions`](#resolve-optimize-content-suggestions). An `edit` only names what's missing, so carrying it out means writing the text with [`edit_optimize_content`](#edit-optimize-content).

An action that isn't a content optimization, is deleted, or belongs to another project is an error.

***

## get\_project\_profile

Read the project's brand profile: the description, industry, brand-identity adjectives, target markets, audience distribution, and product or service list that Peec uses to generate prompt suggestions. Call this before `set_project_profile` so the assistant can show you the current values before changing anything.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |

**Returns:** `{ profile }`. `profile` is `null` if the project hasn't been profiled yet, otherwise an object with the fields described under [`set_project_profile`](#set-project-profile).

***

## list\_project\_members

The people who can open the project, sorted by name. Use it to find the `assignee_user_id` that [`create_actions`](#create-actions) and [`update_actions`](#update-actions) take. Pending invitations aren't listed: an invited person appears once they sign up.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |

**Returns:** `{members}`. Each member has `user_id`, `name`, and `is_you`, which marks you. `name` is `null` when the account has none.

***

## search\_docs

Search the Peec product documentation at [docs.peec.ai](https://docs.peec.ai) and return the most relevant pages. The assistant uses this for any question about how Peec works — what a metric means, how a feature behaves, setup steps, plan and credit rules — then reads the best result with [`read_doc`](#read-doc). Needs no `project_id` or project access.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `query` | string | Yes | Search terms, e.g. `share of voice` or `set up prompts` |
| `limit` | number | No | Max pages to return (default: 5, max: 20) |

**Columns:** `title`, `path`, `url`, `snippet`

Pass a result's `path` to [`read_doc`](#read-doc).

***

## read\_doc

Read the full markdown content of a single documentation page. Pass the `path` returned by [`search_docs`](#search-docs) (e.g. `metrics/brand-metrics/visibility`). Needs no `project_id` or project access.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `path` | string | Yes | Page path from a `search_docs` result |

**Returns:** `{ title, path, url, content }`. Returns a 404 if no page matches the path.

***

# Write tools

Write tools let the assistant edit your project configuration: brands, prompts, tags, topics, products, categories, and the brand profile. Every write tool is flagged `readOnlyHint: false`, and every `delete_*` tool is flagged `destructiveHint: true`. Clients that honor MCP annotations (Claude, Cursor, and most others) prompt for explicit confirmation before the call runs. Some deletes cascade, as noted below.

Brands, prompts, tags, and topics also have **bulk variants** (`create_brands`, `update_brands`, `delete_brands`, `create_prompts`, `update_prompts`, `delete_prompts`, `create_tags`, `update_tags`, `delete_tags`, `create_topics`, `update_topics`, `delete_topics`) for handling up to 50 items in one call. Bulk tools return per-item results so partial failures don't block the rest of the batch.

Products and categories are managed only in bulk (`create_products`, `update_products`, `delete_products`, `create_categories`, `update_categories`, `delete_categories`), up to 1000 items per call.

Prompts can also be **archived** (`archive_prompt` / `unarchive_prompt`) to stop or resume running them without deleting their history.

There's also a small CRUD set for **custom domain and URL classifications** that extends the built-in classification taxonomy. Create the classification once, then assign it to specific domains or URLs as you find them.

> [!NOTE]
>
> All write tools except `create_projects` require project-owner access and a `project_id`; company owners also qualify. `create_projects` needs company member access instead. Ask the assistant to look up IDs with the matching `list_*` tool before any write call so you see exactly what is about to change.

## create\_projects

Create up to 50 projects in your company in a single call, under the same plan limits, project limit, and credit pool as creating them in the app. Each project is created or rejected on its own, so a rejected project doesn't block the rest of the batch. Your assistant confirms each project's domain and credits with you before calling.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `projects` | object\[] | Yes | Up to 50 entries. Each: `name`, `domain`, `country_code`, and optionally `language_code`, `model_channel_ids`, `allocated_credits`, `timezone`, `chat_interval_weekdays`, `is_pitch`, `is_instant_pitch` |

* `allocated_credits` is required for every project except your company's first project before it has a plan, and a pitch project.
* `chat_interval_weekdays` uses ISO 8601 weekdays: 1 is Monday, 7 is Sunday.
* Only agency and partner companies can set `is_pitch`. A pitch project takes no `allocated_credits` or `model_channel_ids`, and `is_instant_pitch` requires `is_pitch`.

**Returns:** `{ created, rejected }`.

* `created`: `[{ id, name }]`
* `rejected`: `[{ name, reason }]`

***

## create\_brands

Create up to 50 brands in a single call. Duplicates (matched case-insensitively on name) are returned in `skipped` instead of failing the batch.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `brands` | object\[] | Yes | Up to 50 entries. Each: `name`, `domains`, `aliases`, `regex`, `color` |

**Returns:** `{ created, skipped }`.

* `created`: `[{ id, name }]`
* `skipped`: `[{ name, reason: "duplicate" }]`

***

## delete\_brands

Soft-delete up to 50 brands in a single call. **Destructive.**

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `brand_ids` | string\[] | Yes | Up to 50 brand IDs to delete |

**Returns:** `{ deleted, skipped }`.

* `deleted`: `[{ id }]`
* `skipped`: `[{ id, reason: "not_found" | "already_deleted" }]`

***

## update\_brands

Update up to 50 brands in a single call. Per item, set any of `name`, `regex`, `aliases`, `domains`, `color`. Changes to name, regex, or aliases trigger a background metric recalculation per brand; a brand updated mid-recalculation is rejected.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `brands` | object\[] | Yes | Up to 50 entries. Each: `brand_id` (required), `name`, `regex` (pass `null` to clear), `aliases`, `domains`, `color` |

**Returns:** `{ updatedCount, skipped, rejected }`. Successful items collapse to `updatedCount`; `skipped` and `rejected` list any items that didn't apply.

***

## create\_prompts

Create up to 50 prompts in a single call. May consume plan credits. Accepts existing `topic_id` and `tag_ids` only. This tool does not auto-create topics or tags; unknown IDs land in `rejected`.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `prompts` | object\[] | Yes | Up to 50 entries. Each: `text`, `country_code`, `topic_id`, `tag_ids` |

**Returns:** `{ created, skipped, rejected, warning? }`.

* `created`: `[{ id, text, country_code }]`
* `skipped`: `[{ text, country_code, reason: "duplicate" }]`
* `rejected`: `[{ text, country_code, reason: "limit_exceeded" | "invalid_topic" | "invalid_tag", message }]`
* `warning`: optional plan-credit warning string when the batch was partially accepted

***

## delete\_prompts

Soft-delete up to 50 prompts. **Destructive.** Each delete is enqueued asynchronously; the response reports which IDs were queued, skipped, or could not be enqueued.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `prompt_ids` | string\[] | Yes | Up to 50 prompt IDs to delete |

**Returns:** `{ queued, skipped, rejected }`.

* `queued`: `[{ id }]`
* `skipped`: `[{ id, reason: "not_found" | "already_deleted" }]`
* `rejected`: `[{ id, reason: "enqueue_failed", message }]`

***

## update\_prompts

Update the topic and/or tags of up to 50 prompts in a single call. Per item, pass `tag_ids` to fully replace the prompt's tag set, or `topic_id: null` to detach its topic. Topic and tag IDs must already exist.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `prompts` | object\[] | Yes | Up to 50 entries. Each: `prompt_id` (required), `topic_id` (or `null` to detach), `tag_ids` (replaces existing tags) |

**Returns:** `{ updatedCount, skipped, rejected }`. Successful items collapse to `updatedCount`; `skipped` and `rejected` list any items that didn't apply.

***

## archive\_prompts

Archive up to 50 prompts in one call, setting `is_archived = true` so they stop running while their chats and history stay intact. Prefer this over [`delete_prompts`](#delete-prompts) whenever the data should be kept.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `prompt_ids` | string\[] | Yes | Up to 50 prompt IDs, targeting 40 or fewer per call |

**Returns:** `{ archivedCount, skipped, rejected }`. `skipped` lists prompt IDs that weren't found.

***

## unarchive\_prompts

Unarchive up to 50 prompts, setting `is_archived = false` so they resume running.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `prompt_ids` | string\[] | Yes | Up to 50 prompt IDs, targeting 40 or fewer per call |

**Returns:** `{ unarchivedCount, skipped, rejected }`. Prompts that would take you past your plan's active-prompt limit come back under `rejected` with `plan_limit`.

***

## create\_tags

Create up to 50 tags in a single call. Duplicates (matched case-insensitively on name) land in `skipped`.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `tags` | object\[] | Yes | Up to 50 entries. Each: `name`, `color`, `group` |

**Returns:** `{ created, skipped }`.

* `created`: `[{ id, name }]`
* `skipped`: `[{ name, reason: "duplicate" }]`

***

## delete\_tags

Soft-delete up to 50 tags in a single call and detach them from every prompt they're attached to. **Destructive.**

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `tag_ids` | string\[] | Yes | Up to 50 tag IDs to delete |

**Returns:** `{ deleted, skipped }`.

* `deleted`: `[{ id }]`
* `skipped`: `[{ id, reason: "not_found" }]`

***

## update\_tags

Update up to 50 tags in a single call (name and/or color per item). System tags are skipped.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `tags` | object\[] | Yes | Up to 50 entries. Each: `tag_id` (required), `name`, `color` (from Peec's palette), `group` (set a group, `null` to ungroup, or omit to leave unchanged) |

**Returns:** `{ updatedCount, skipped, rejected }`. Successful items collapse to `updatedCount`; `skipped` (includes system tags) and `rejected` list any items that didn't apply.

***

## update\_tag\_groups

Rename or recolor up to 50 tag groups in one call. The change applies to every tag in each group.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `groups` | object\[] | Yes | Up to 50 entries. Each: `group` (the current name, required), `name` (new name), `color` (applied to every tag in the group). Provide a name, a color, or both. |

**Returns:** each updated group with its affected tag count, plus `skipped` and `rejected` items. A group with neither a new name nor a new color is rejected.

***

## delete\_tag\_groups

Delete up to 50 tag groups. By default each group's tags survive and are simply ungrouped.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `groups` | object\[] | Yes | Up to 50 entries. Each: `group` (the name to delete, required), `delete_tags` (default `false`) |

**Returns:** each group with its affected tag count, plus `skipped` and `rejected` items.

> [!NOTE]
>
> Setting `delete_tags: true` deletes the group's tags outright and detaches them from every prompt, which can't be undone. Leave it `false` to keep the tags and only drop the grouping.

***

## create\_topics

Create up to 50 topics in a single call. Duplicates (matched case-insensitively on name) land in `skipped`. Items beyond the project's topic limit land in `rejected`.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `topics` | object\[] | Yes | Up to 50 entries. Each: `name` (1-64 chars), `country_code` |

**Returns:** `{ created, skipped, rejected }`.

* `created`: `[{ id, name }]`
* `skipped`: `[{ name, reason: "duplicate" }]`
* `rejected`: `[{ name, reason: "limit_exceeded", message }]`

***

## delete\_topics

Soft-delete up to 50 topics in a single call. **Destructive.** Associated prompts are detached (not deleted); any AI-generated prompt suggestions under the topics are deleted.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `topic_ids` | string\[] | Yes | Up to 50 topic IDs to delete |

**Returns:** `{ deleted, skipped }`.

* `deleted`: `[{ id }]`
* `skipped`: `[{ id, reason: "not_found" | "already_deleted" }]`

***

## update\_topics

Rename up to 50 topics in a single call.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `topics` | object\[] | Yes | Up to 50 entries. Each: `topic_id` (required), `name` (1–64 characters) |

**Returns:** `{ updatedCount, skipped, rejected }`. Successful items collapse to `updatedCount`; `skipped` and `rejected` list any items that didn't apply.

***

## generate\_topics

Composes candidate topics for your project from its Brand Profile, the same composition [Prompt discovery](https://docs.peec.ai/setting-up-your-prompts.md#option-4-prompt-discovery) runs in the app.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `topic_count` | number | No | How many topics to compose, 1 to 50. Defaults to the number your plan allows. |

**Returns:** `{ topics: [name, ...] }`.

Nothing is saved. Review the returned names, then create the ones you want with [`create_topics`](#create-topics). Composition already accounts for your existing topics, so it proposes only what fills a gap and can come back empty when your set is already well covered.

> [!NOTE]
>
> Needs the Brand Profile to name your products and services, which you set with [`set_project_profile`](#set-project-profile). It spends one of the project's hourly topic generations, so it's never called in a loop.

***

## generate\_prompt\_suggestions

Generates prompt suggestions for your project, the same generation [Prompt discovery](https://docs.peec.ai/setting-up-your-prompts.md#option-4-prompt-discovery) runs in the app. Generation happens in the background.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `topic_id` | string | No | Generate for this topic alone instead of every topic awaiting review, replacing the suggestions it already has |
| `prompt_suggestion_id` | string | No | Replace this one suggestion, keeping its ID, topic and market |
| `segment` | object | No | Add suggestions for one slice of a topic, keeping the ones it already has. Takes `topic_id` (required), plus `branding`, `intent`, `persona_tag_id`, `country` and `count`. Any dimension you leave unset is filled from your target distribution and markets. |

**Returns:** `{ queued: true, generation_id }`. Poll it with [`get_prompt_suggestion_generation`](#get-prompt-suggestion-generation), then read the results with [`list_prompt_suggestions`](#list-prompt-suggestions) and resolve them with [`finalize_prompt_suggestions`](#finalize-prompt-suggestions).

`topic_id`, `prompt_suggestion_id` and `segment` are mutually exclusive and each narrow the run. With none of them, every topic awaiting review is generated for again and its current suggestions are replaced, so pass a scope unless you actually want a full refresh.

> [!NOTE]
>
> Needs `prompt_builder.distribution`, the branding and intent split, set through [`set_project_profile`](#set-project-profile). Markets are optional: without them your own country and language are used. It spends one of the project's hourly prompt generations, so it's never called in a loop.

***

## update\_prompt\_suggestions

Edit up to 50 pending suggestions before you finalize them: rewrite the text, replace the tag set, or both. Prefer this over rejecting and regenerating when a suggestion is close but not quite right.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `suggestions` | object\[] | Yes | Up to 50 entries. Each: `prompt_suggestion_id` (required), `text`, `tag_ids`. |

**Returns:** `{ updatedCount, skipped, rejected }`. Successful items aren't echoed back.

Editing keeps a suggestion pending, so accept it with [`finalize_prompt_suggestions`](#finalize-prompt-suggestions) to create the tracked prompt. `tag_ids` fully replaces the item's tags and must be existing IDs from [`list_tags`](#list-tags); system tags keep at most one per group, and the last one passed wins.

***

## finalize\_prompt\_suggestions

Resolves prompt suggestions in one pass over a reviewed set. IDs in `accepted_ids` become tracked prompts and promote their topics into the project; IDs in `rejected_ids` are deleted from the review list.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `accepted_ids` | string\[] | No | Suggestion IDs to turn into tracked prompts |
| `rejected_ids` | string\[] | No | Suggestion IDs to delete from the review list |

Pass either or both, up to 50 IDs across the two lists, targeting 40 or fewer per call. At least one ID is required.

**Returns:** a count per outcome, any IDs that matched no suggestion, and any allowance warning.

Rejecting never touches your tracked prompts, since a suggestion has produced none until it's accepted. A topic left with no suggestions is cleared along with them.

> [!NOTE]
>
> The accepted set is checked against your project's remaining prompt allowance as a whole and refused as a batch when it doesn't fit. Trim it and retry rather than splitting it across calls, and note that a refused accept also leaves the rejections unapplied.

***

## create\_global\_brand

Creates a brand in the shopping catalog and returns its `global_brand_id`. Use it when [`list_global_brands`](#list-global-brands) finds no match for a brand you need, or when [`create_products`](#create-products) rejects an item with `brand_not_found`.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `name` | string | Yes | The brand name |

**Returns:** `{ id, name }`. The returned name is the brand's canonical name and can differ slightly from the one you sent.

> [!NOTE]
>
> This is separate from [`create_brands`](#create-brands), which creates the brands a project tracks for AI-visibility reporting. The two carry different IDs and aren't interchangeable.

***

## create\_products

Create products in a project. Up to 1000 per call. Each product needs a `global_brand_id` (resolve via [`list_global_brands`](#list-global-brands)) and a `name` unique within that brand.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `products` | object\[] | Yes | Up to 1000 entries. Each: `global_brand_id` (required), `name` (required), `description`, `image_url`, `price_override` (per-currency min/max), `category_ids` |

**Returns:** `{ created, rejected }` per item. Rejection reasons: `name_conflict`, `brand_not_found`, `category_not_found`.

***

## update\_products

Update products by id (resolve via [`list_products`](#list-products)). Up to 1000 per call. Per item, set any of `name` (unique within the brand), `description`, `image_url`, `price_override` (replaces all overrides; `{}` clears them), `category_ids` (replaces the product's categories; `[]` uncategorizes). Omitted fields are left unchanged.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `products` | object\[] | Yes | Up to 1000 entries. Each: `product_id` (required) plus the fields to change |

**Returns:** `{ updated, skipped, rejected }` per item. An item with nothing to apply is skipped; an unsatisfiable change (name conflict, unknown category) is rejected.

***

## delete\_products

Delete products by id. **Destructive.** Up to 1000 per call.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `product_ids` | string\[] | Yes | Up to 1000 product IDs |

**Returns:** `{ deleted, skipped }` per item (`skipped` reason: `not_found`).

***

## create\_categories

Create product categories. Up to 1000 per call, applied in order. Each needs a `name` and an optional `parent_id` — omit it for a top-level category, or pass another category's id to nest it underneath. A name must be unique among its siblings.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `categories` | object\[] | Yes | Up to 1000 entries. Each: `name` (required), `parent_id` (optional) |

**Returns:** `{ created, rejected }` per item. Rejection reasons: `parent_not_found`, `name_conflict`.

***

## update\_categories

Rename and/or move categories by id (resolve via [`list_categories`](#list-categories)). Up to 1000 per call. Each item sets `name` (rename), `parent_id` (move under that category, or `null` to promote to the top level), or both.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `categories` | object\[] | Yes | Up to 1000 entries. Each: `category_id` (required), `name`, `parent_id` |

**Returns:** `{ updated, rejected }` per item. Rejection reasons: `not_found`, `name_conflict`, `invalid_move` (nesting a category inside itself).

***

## delete\_categories

Delete categories by id. **Destructive.** Up to 1000 per call. A deleted category's children and products move up to its parent — a top-level delete sends children to the top level and its products to Uncategorized.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `category_ids` | string\[] | Yes | Up to 1000 category IDs |

**Returns:** `{ deleted, rejected }` per item. Rejection reasons: `not_found`, `name_conflict` (a child moved up would clash with an existing sibling name).

***

## create\_domain\_classification

Define a new custom domain classification entity on a project. This creates the classification but does **not** assign it to any domain — use [`assign_domain_classification`](#assign-domain-classification) for that.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `name` | string | Yes | Classification name (unique per project) |
| `color` | string | No | Display color from Peec's palette |

**Returns:** `{ id }`.

***

## delete\_domain\_classification

Permanently delete a custom domain classification entity. **Destructive.** Cascades through the override table — any domain currently assigned this classification falls back to its heuristic classification. To clear a single domain instead, use [`unassign_domain_classification`](#unassign-domain-classification).

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `name` | string | Yes | Name of the custom domain classification to delete |

**Returns:** `{ success: true }`.

***

## assign\_domain\_classification

Assign a built-in classification (`Corporate`, `Competitor`, `Editorial`, `Institutional`, `Other`, `Reference`, `UGC`, `You`, `Related`) or the name of a custom domain classification to a domain. Overrides any heuristic classification. The override applies at apex granularity.

If a display label collides with an existing custom classification name, the custom classification wins — pass the built-in enum value (e.g. `OTHER`) to force the built-in.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `domain` | string | Yes | Domain to classify (any host or apex — applied at apex granularity) |
| `classification` | string | Yes | Built-in classification display name or custom classification name |

**Returns:** `{ success: true }`.

***

## unassign\_domain\_classification

Clear the classification override on a domain, restoring its heuristic classification. Does **not** delete the custom classification entity itself.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `domain` | string | Yes | Domain whose classification override should be cleared |

**Returns:** `{ success: true }`.

***

## create\_url\_classification

Define a new custom URL classification entity on a project. This creates the classification but does **not** assign it to any URL — use [`assign_url_classification`](#assign-url-classification) for that.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `name` | string | Yes | Classification name (unique per project) |
| `color` | string | No | Display color from Peec's palette |

**Returns:** `{ id }`.

***

## delete\_url\_classification

Permanently delete a custom URL classification entity. **Destructive.** Cascades through the override table — any URL currently assigned this classification falls back to its heuristic classification. To clear a single URL instead, use [`unassign_url_classification`](#unassign-url-classification).

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `name` | string | Yes | Name of the custom URL classification to delete |

**Returns:** `{ success: true }`.

***

## assign\_url\_classification

Assign a built-in classification (`Homepage`, `Category Page`, `Product Page`, `Listicle`, `Comparison`, `Profile`, `Alternative`, `Discussion`, `How-To Guide`, `Article`, `Other`) or the name of a custom URL classification to a URL. Overrides any heuristic classification. The override applies to the normalized URL form.

If a display label collides with an existing custom classification name, the custom classification wins — pass the built-in enum value (e.g. `OTHER`) to force the built-in.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `url` | string | Yes | URL to classify |
| `classification` | string | Yes | Built-in classification display name or custom classification name |

**Returns:** `{ success: true }`.

***

## unassign\_url\_classification

Clear the classification override on a URL, restoring its heuristic classification. Does **not** delete the custom classification entity itself.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `url` | string | Yes | URL whose classification override should be cleared |

**Returns:** `{ success: true }`.

***

## create\_facts

Adds up to 50 manual facts in one call. Each fact is a statement about your brand that Peec checks claims from AI answers against.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `facts` | object\[] | Yes | Up to 50 entries, targeting 40 or fewer per call. Each: `text`, the statement to check claims against. |

**Returns:** `{ created, skipped, rejected }`. Created facts come back in full with their new IDs.

***

## update\_facts

Updates the wording or the active state of up to 50 facts.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `facts` | object\[] | Yes | Up to 50 entries. Each: `fact_id` (required), `text`, `is_active`. Provide `text`, `is_active`, or both. |

**Returns:** `{ updatedCount, skipped, rejected }`.

Changing `text` creates a new version and preserves the old wording for verdicts already reached. Setting `is_active: false` keeps the fact visible but leaves it out of future fact-checking, so it parks a fact without deleting it.

***

## delete\_facts

Deletes up to 50 facts. Deleted facts disappear from the fact list and are left out of future fact-checking, while verdicts already reached keep their original fact versions.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `fact_ids` | string\[] | Yes | Up to 50 fact IDs, copied verbatim from [`list_facts`](#list-facts) |

**Returns:** `{ deletedCount, skipped }`.

> [!NOTE]
>
> Deletion is a soft delete, but the Peec app has no undo for it. Your assistant reads the exact statements back to you before calling.\
> \
> Writing facts requires owner access to the project, while `list_facts` is available to any viewer.

***

## edit\_brand\_perception\_attribute\_clusters

Renames, deletes and reassigns Brand Perception attribute clusters, the same edits the Manage attributes screen makes. Use it when an attribute is mislabeled, duplicated or split across two clusters.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `renames` | object\[] | No | Up to 50 entries. Each: `cluster_id` and a new `name`, unique within the project case-insensitively. The cluster keeps its ID and its history, so scores blend across the rename. |
| `delete_cluster_ids` | string\[] | No | Up to 50 clusters to remove. Each must hold no attributes by the time it's deleted. |
| `reassignments` | object\[] | No | Up to 200 entries. Each: `attribute`, spelled exactly as the listing returns it, and the `cluster_id` it moves into. Works for attributes listed under `unassigned` too. |

Pass any combination, and at least one. Resolve every `cluster_id` and attribute with [`list_brand_perception_attribute_clusters`](#list-brand-perception-attribute-clusters) first, and copy both verbatim.

**Returns:** the counts applied. Errors come back as `invalid` (a repeated target), `not_found` (unknown cluster or attribute), or `conflict` (a new label collides with another cluster, or a deleted cluster still holds attributes).

The whole call is one transaction, so if any edit is rejected nothing is applied. Edits run in the order reassign, rename, delete however you list them, which makes merging two clusters a single call: reassign every attribute out of the losing cluster, then delete it. Name each attribute and each cluster at most once per call, since two edits naming the same one would conflict.

> [!NOTE]
>
> Scores re-aggregate on the next read, so the change is immediate and needs no new run. It rewrites a taxonomy the whole project shares and there's no undo, so your assistant shows you the exact edits and waits for your confirmation.

***

## update\_actions\_status

Moves up to 50 actions to a status, the same ones the Actions page writes: `ACCEPTED` to take one on, `REJECTED` to decline it, `COMPLETED` to record that the work is done, `PENDING` to put a resolved action back on the undecided pile, `DELETED` to take it off the list altogether.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `action_ids` | string\[] | Yes | Up to 50 action IDs, copied verbatim from [`list_actions`](#list-actions) |
| `status` | string | Yes | The status to move every listed action to |
| `completed_at` | string | No | When the work was done, as an ISO 8601 date-time with an offset. Only with `COMPLETED`. Up to five years back, never in the future. Omit it to use the current time. |

**Returns:** a count of updated actions plus `skipped` and `rejected` items.

Complete an action only once the change is actually live on the page. The status is what tells everyone where the work stands, and it doesn't itself affect visibility. When the work went live earlier, pass `completed_at` so the impact chart marks the real day. Sending it again on a completed action moves its date. An action that's already deleted reads as absent, so a second call naming one comes back skipped. A `CONTENT_OPTIMISATION` action can only be updated when **Content optimization** is enabled for the project. Otherwise it comes back skipped, as an action the project doesn't have.

***

## update\_action\_steps

Records which of an action's steps you've done, across up to 50 actions in one call.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `actions` | object\[] | Yes | Up to 50 entries, targeting 40 or fewer per call. Each names one action and either sets `completed` for every step it holds, or lists `steps`. |

Each step in turn either sets `completed` for all of its options or names `options` individually, each with its own `completed`, so one call can tick some and untick others. Setting `completed` and listing parts at the same level is rejected. Passing `false` puts a step or option back to not-done, so a step marked off by mistake can be corrected.

**Returns:** `updatedCount` plus `skipped` and `rejected` items, keyed on `action_id`.

| Outcome | Meaning |
| - | - |
| `not_found` | No such action in this project |
| `step_not_found` / `option_not_found` | Usually an ID from before Peec regenerated the action. Read it again. |
| `duplicate_id` / `duplicate_step_id` | The same action, or the same step within one action, appears more than once in this call |
| `not_completable` | The action is a content brief, whose steps are the material it was written from rather than work to do |

An action is all or nothing: anything that can't be applied leaves every step on it untouched, so you never have to read an action back to find out what landed. Other actions in the same call still go through. A `CONTENT_OPTIMISATION` action can only be updated when **Content optimization** is enabled for the project. Otherwise it comes back skipped.

> [!NOTE]
>
> Read the step and option IDs with [`get_action`](#get-action) and `fields: ["steps"]` first. They aren't in [`list_actions`](#list-actions), and an ID from an earlier read can be stale.
>
> This records work you've already finished. It does nothing to the pages the engines read, and completing every step doesn't move the action to `COMPLETED`. The action's own status changes in the Peec app or through [`update_actions_status`](#update-actions-status).

***

## create\_actions

Writes up to 50 actions of your own in one call, so work Peec didn't suggest is tracked beside the work it did, with the same list, statuses, and filters.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `actions` | object\[] | Yes | Up to 50 actions, targeting 40 or fewer per call |

Each action takes:

| Field | Required | Description |
| - | - | - |
| `title` | Yes | Up to 250 characters |
| `kind` | Yes | What the work is, which decides the action's type and group: `CONTENT_OPTIMIZATION` (Content optimization), `CONTENT_CREATION` (Create content), `MENTION` (Improve a mention), `TECHNICAL` (Fix a technical issue), `PRODUCT_PAGE` (Improve a product page), or `OTHER` (Something else) |
| `status` | No | Where the action starts: `PLANNED` (default), `ACCEPTED`, `COMPLETED`, or `REJECTED`. `PENDING` is accepted and lands as `PLANNED` |
| `completed_at` | No | When the work was done, for an action that starts as `COMPLETED`. An ISO 8601 date-time with an offset, up to five years back and never in the future. Omit it to use the current time. |
| `page_url` | No | The page the action lands on. On an owned-page kind, it's also the page the action is measured against. |
| `description` | No | `{ text, html? }`. What the action is for. |
| `notes` | No | `{ text, html? }`. Working notes kept beside the action. |
| `steps` | No | The work to do. Each step has a `title`, and optionally a `description`, `completed`, and a `section` heading to group it under. |
| `topic_id` | No | Topic the action is scoped to (from [`list_topics`](#list-topics)) |
| `prompt_ids` | No | Prompts the action is meant to move (from [`list_prompts`](#list-prompts)) |
| `priority` | No | `none`, `low`, `medium`, or `high`. It fills the same impact bars a generated action fills, so the two sort together. |
| `country_codes` | No | ISO 3166-1 alpha-2 markets. Omit for every market the project tracks. |
| `language_codes` | No | Languages the action is scoped to |
| `tag_ids` | No | Tags to file the action under |
| `category` | No | Free-form category |
| `assignee_user_id` | No | The project member who owns the work (from [`list_project_members`](#list-project-members)) |
| `due_on` | No | Calendar day in the project's timezone (`YYYY-MM-DD`) |
| `repeat` | No | `{ every, unit }`, where `every` is 1 to 12 and `unit` is `day`, `week`, `month`, or `year` |
| `time_range` | No | The window the action's measurements are read over: `7d`, `28d`, `90d`, or `all` |

**Returns:** `created` (each with its `index`, new `action_id`, and `title`) plus any `rejected` items. A topic or prompt the project doesn't have rejects that item alone.

Writing an action records an intention. It doesn't change what AI engines say, and it doesn't make Peec do the work.

***

## update\_actions

Rewrites the fields you own on up to 50 actions. It works on actions you wrote and on ones Peec generated. Your edit is kept beside Peec's wording rather than replacing it, so a later regeneration can't discard it.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `actions` | object\[] | Yes | Up to 50 entries, targeting 40 or fewer per call. Each has an `action_id` (from [`list_actions`](#list-actions)) plus any of the fields [`create_actions`](#create-actions) accepts, except `status`. |

A field you leave out keeps its value, and `null` clears the fields that can be cleared. An entry with no field besides its `action_id` is rejected. `steps` and `prompt_ids` replace the whole list rather than merging into it. To tick off a step without rewriting the list, use [`update_action_steps`](#update-action-steps). To change status, use [`update_actions_status`](#update-actions-status).

Only an action you wrote can change `kind`. A generated action keeps the type and group Peec found it under, and an entry that tries to change them is rejected.

**Returns:** a count of updated actions plus `skipped` (`not_found`) and `rejected` (`duplicate_id`, `no_change`, or `invalid`) items.

A `CONTENT_OPTIMISATION` action can only be updated when **Content optimization** is enabled for the project. Otherwise it comes back skipped.

***

## delete\_actions

Permanently removes up to 50 actions you wrote yourself. **Destructive.** There's no way to restore a deleted action.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `action_ids` | string\[] | Yes | Up to 50 action IDs, copied verbatim from [`list_actions`](#list-actions) |

**Returns:** a count of deleted actions plus `skipped` items.

An action Peec generated can't be deleted here, and comes back skipped just like a missing one. Decline it with [`update_actions_status`](#update-actions-status) instead, which keeps a record of what was suggested.

***

## resolve\_optimize\_content\_suggestions

Accepts, dismisses, or reverts suggestions on a `CONTENT_OPTIMISATION` action, up to 50 in one call. This is the same change you make with **Apply**, **Dismiss**, and **Revert** on the Optimize content screen. Only available when **Content optimization** is enabled for the project.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `action_id` | string | Yes | The ID of a `CONTENT_OPTIMISATION` action, copied verbatim from [`list_actions`](#list-actions) |
| `suggestion_ids` | string\[] | Yes | Up to 50 suggestion IDs from [`get_optimize_content`](#get-optimize-content), targeting 40 or fewer per call |
| `action` | string | Yes | Applied to every ID in the call: `accept`, `reject`, or `revert` |

| `action` | Effect |
| - | - |
| `accept` | Takes a `rewrite` suggestion's wording into the article. Accepting an `edit`, which carries no wording, marks it resolved without changing a word. |
| `reject` | Dismisses the suggestion and keeps the original wording |
| `revert` | Puts an accepted or dismissed suggestion back to pending. Only works on suggestions Peec generated. An edit you typed yourself is undone in the editor, so reverting one is an error. |

**Returns:** `score` (the optimization score out of 100 after the change), `unchanged`, and `suggestions` (each ID's resulting `state`).

Every change in the call lands in one revision of the article, under your name in its history. An ID already in the requested state is left alone and counted in `unchanged`. An ID that isn't on this action is an error, and nothing is written.

> [!TIP]
>
> This doesn't return the new wording. Read the article again with [`get_optimize_content`](#get-optimize-content) to see it.

***

## edit\_optimize\_content

Rewrites passages of the article behind a `CONTENT_OPTIMISATION` action, up to 50 in one call. Only available when **Content optimization** is enabled for the project.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `action_id` | string | Yes | The ID of a `CONTENT_OPTIMISATION` action, copied verbatim from [`list_actions`](#list-actions) |
| `edits` | object\[] | Yes | Up to 50 passages to rewrite, targeting 40 or fewer per call |

Each edit takes:

| Field | Required | Description |
| - | - | - |
| `original_text` | Yes | The passage as it currently reads, quoted word for word from the `article` that [`get_optimize_content`](#get-optimize-content) returns. Quote one whole paragraph or heading, not a fragment. |
| `new_text` | Yes | The replacement, as markdown. It can't be empty, so this tool rewrites passages but can't delete them. |
| `carries_out_suggestion_id` | No | The ID of the `edit` suggestion this rewrite carries out. It's marked accepted in the same revision. |

**Returns:** `score` (the optimization score out of 100 after the change), `edited` (how many passages were rewritten), `carried_out` (how many `edit` suggestions were marked accepted), and `suggestion_ids` (the tracked edits this call created).

Every edit lands in one revision, and nothing is written unless all of them apply. The whole call fails if a quote matches no passage or several, or if two edits target the same passage. If the article changed since you read it, the edit is rejected rather than applied over, so read it again before retrying.

Changes appear as tracked edits under your name. You can revert them on the Optimize content screen just like edits you typed.

***

## get\_cms\_page

Reads the live page associated with a content-optimization action. CMS publishing must be enabled, and the caller must be a project owner. This reads the website's current wording; [`get_optimize_content`](#get-optimize-content) reads the working article in Peec.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `action_id` | string | Yes | The content-optimization action ID |

**Returns:** `action_id`, `connected`, `page_found`, `title`, `text`, `page_url`, `edit_url`, `status`, `modified_at`, `site_url`, `external_id`, `content_type`, `not_rewritten` block kinds, and `message`, a sentence explaining the state, including why nothing could be read.

***

## get\_cms\_drift

Compares the working article with the connected CMS page. Requires project-owner access and CMS publishing enabled.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `action_id` | string | Yes | The content-optimization action ID |

**Returns:** `action_id`, `comparable`, `changed`, `missing`, `merged`, `content_hash`, `content_version`, `edit_url`, and `message`. Changed passages contain `block_index`, `expected`, `current`, and any `suggestion_id` and `suggestion_state`. Missing passages, each with `block_index` and `expected`, could not be located safely; they are not necessarily deleted.

`merged` contains groups of neighbouring article passages that the page joined into one block. Each group has `block_indexes`, `expected` (the original passages in order), `current` (the page's joined wording), and `suggestion_ids`.

Use the returned hash and version together for synchronization. After a repair, read this tool and [`get_optimize_content`](#get-optimize-content) again. Only report that no differences were detected when `comparable` is true and `changed`, `missing`, and `merged` are all empty. This does not guarantee every suggestion can be published.

***

## sync\_cms\_content

Reconciles CMS changes with Peec's working article. This does not publish to the website. Requires project-owner access and CMS publishing enabled.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `actions` | object\[] | Yes | 1–50 actions to reconcile; target 40 or fewer |

Each action supplies `action_id`, `content_version`, and `content_hash` from [`get_cms_drift`](#get-cms-drift), plus 1–50 `decisions`. Each decision includes the reviewed `block_index`, its exact `expected` wording, and `resolution`:

* `cms` takes the page's current wording and dismisses the outdated suggestion.
* `suggestion` keeps Peec's wording.
* `remove` removes a missing passage from the article only after the user confirms removal. Never infer deletion from a missing match.

For a missing passage with a clear counterpart, read the page again with `get_cms_page`. Send `resolution: "cms"`, the missing passage's exact `expected` wording, and `current` quoting one complete block from that fresh page read. The quote must match exactly one editable block in the reviewed page. Peec checks the page hash and article version before applying it. This also works when a generated suggestion sits on the passage: the outdated suggestion is dismissed, and a suggestion that added a new passage is removed. A passage that spans several CMS blocks can't be mapped to one block. Ambiguous, partial, or stale mappings write nothing. Omit `current` or set it to `null` for other decisions; a non-null `current` on any other decision returns `status: "rejected"`.

For a `merged` group, send one decision using its first `block_index` and first `expected` entry. A `cms` decision replaces the first passage with the page's joined wording and removes the remaining passages and their suggestions in one article revision. A `suggestion` decision keeps the article's separate passages. Joined passages always require an explicit decision, even if they have no suggestions.

Changed passages without suggestions sync automatically. Unreviewed conflicts and missing passages remain unresolved. A stale response requires another read and review.

An action can appear only once per call. A repeated entry returns `status: "rejected"`, and the other entries still run.

**Returns:** `results`, with each `action_id`, `status`, and either the updated `content_version`, `content_hash`, `synced_count`, `conflicts`, and `missing`, or a failure `message`. `status` is `synced`, `conflict`, `notFound`, `rejected`, or `failed`. A conflict can include `merged_block_indexes` for a joined group; `suggestion_id` is absent when it has no suggestion.

***

## publish\_cms\_content

Writes accepted suggestions to the connected CMS. `draft` writes a throwaway preview draft and leaves the page unchanged; each preview replaces the previous one. `live` updates the page itself and deletes the preview if it is still a draft. Requires project-owner access and CMS publishing enabled.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `action_id` | string | Yes | The content-optimization action ID |
| `mode` | string | Yes | `draft` or `live` |
| `content_hash` | string | For conflict confirmation | Copy from the response that reported the conflicts |
| `content_version` | string | For conflict confirmation | Copy from the same conflict response |
| `overwrite_conflicts` | object\[] | No | Approved conflicts, each with `suggestion_id` and the exact `current_text` shown to the user |

Live publishing doesn't need a preview first. Publish live only when the user asks for it, never on a request to preview or check the changes. Every write rebuilds the page from the copy it held before Peec first published to it, with the currently accepted suggestions, so a suggestion that is no longer accepted is taken back. Conflicting wording stops the write: show `expected` and `current`, and send `overwrite_conflicts` only after the user agrees, with `content_hash` and `content_version` from that response. A preview someone published in the CMS stays a separate page.

WordPress validates proposed HTML through a temporary draft before updating an existing entry. Filtering or failed cleanup prevents the update. Site filters that behave differently for the original page, and edits made during the final read/write interval, remain possible.

**Returns:** `status` (`published`, `conflicts`, `stale`, or `failed`), `mode`, `page_url`, `edit_url` (the preview's editor in draft mode), `applied_count`, `skipped_count`, `already_applied_count`, `overwritten_count`, `reverted_count`, `can_revert`, `was_filtered`, failed suggestions, and `unmodelled_ids`. A `conflicts` response also returns `content_hash`, `content_version`, and `conflicts`, each with `suggestion_id`, `expected`, and `current`. Explain skipped suggestions and filtering rather than reporting only success counts.

***

## set\_project\_profile

Replace the project's brand profile. Every field is required, so call [`get_project_profile`](#get-project-profile) first, merge your changes into the existing values, then send the complete profile here. Saving triggers a background refresh of the project's prompt suggestions. The project display name is not part of the profile and can't be changed via this tool.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `project_id` | string | Yes | The project ID |
| `occupation` | string | Yes | Short brand description used in every generated prompt. Be specific. |
| `industry` | string | Yes | Industry or vertical (e.g. `FinTech`, `E-commerce`) |
| `brandPresentation` | string\[] | Yes | Adjectives that define the brand's positioning (e.g. `premium`, `challenger`) |
| `productsAndServices` | string\[] | Yes | Main product lines, service categories, or flagship offerings |
| `targetMarkets` | object\[] | Yes | Geographic scope. Each entry: `{ marketSize, location, osmId? }` |
| `audienceDistribution` | object | Yes | `{ simpleRecommendationSeeker, informedShopper, evaluativeResearcher }` integers that must sum to 100 |

`marketSize` is one of: `Neighborhood`, `City`, `State/Province`, `National`, `Continental Bloc`, `Global`.

**Returns:** `{ success: true }`.

***

# Report filters and dimensions

## Filtering

The three report tools support filters to narrow results. Each filter looks like this:

```json theme={null}
{
  "field": "model_channel_id",
  "operator": "in",
  "values": ["openai-0", "perplexity-0"]
}
```

### Standard filter fields

These all use `in` / `not_in` operators with a `values` array.

| Field | Available in | Description |
| - | - | - |
| `model_id` | All reports | **Deprecated** — prefer `model_channel_id`. AI search engine (e.g. `chatgpt-scraper`, `perplexity-scraper`, `gemini-scraper`). Call `list_models` to get the IDs available for your project. |
| `model_channel_id` | All reports | Stable engine channel ID — survives model version upgrades. Call [`list_model_channels`](#list-model-channels) to resolve. |
| `topic_id` | All reports | Topic grouping ID |
| `tag_id` | All reports | Tag ID |
| `prompt_id` | All reports | Individual prompt ID |
| `country_code` | All reports | ISO 3166-1 alpha-2 code (e.g. `US`, `DE`, `GB`) |
| `brand_id` | Brand report | Brand ID |
| `domain` | Domain and URL reports | Domain name |
| `url` | Domain and URL reports | Full URL |
| `chat_id` | All reports | Individual chat/conversation ID |
| `mentioned_brand_id` | Domain and URL reports | Only sources where this brand was mentioned |
| `domain_classification` | Domain and URL reports | Built-in classification display name (`Corporate`, `Editorial`, ...) or the name of a custom domain classification. See [`list_domain_classifications`](#list-domain-classifications). |
| `url_classification` | URL report | Built-in classification display name (`Listicle`, `Comparison`, ...) or the name of a custom URL classification. See [`list_url_classifications`](#list-url-classifications). |

### Numeric filters

Domain and URL reports also accept two numeric filters. These use `gt` / `gte` / `lt` / `lte` operators with a single `value` (not `values`).

**`mentioned_brand_count`**: filter by number of unique brands mentioned alongside a source.

```json theme={null}
{
  "field": "mentioned_brand_count",
  "operator": "gte",
  "value": 2
}
```

**`gap`**: gap analysis. Excludes sources where your own brand is mentioned, then filters by how many competitor brands are present. This is Peec's most actionable competitive filter: it finds content where competitors appear but you don't.

```json theme={null}
{
  "field": "gap",
  "operator": "gte",
  "value": 2
}
```

The example above returns domains or URLs where the own brand is absent but at least 2 competitors are mentioned.

### Operators

| Operator | Use with | Description |
| - | - | - |
| `in` | Standard fields | Include only matching values |
| `not_in` | Standard fields | Exclude matching values |
| `gt`, `gte`, `lt`, `lte` | `mentioned_brand_count`, `gap` | Numeric comparisons |

You can combine multiple filters. They're joined with AND logic.

## Sorting

The three report tools accept an `order_by` array that sorts results before pagination. Each entry is `{ field, direction }`. `direction` is `asc` or `desc` and defaults to `desc`. Multiple entries create a multi-key sort, applied in order.

```json theme={null}
[
  { "field": "visibility", "direction": "desc" },
  { "field": "mention_count", "direction": "desc" }
]
```

Sortable fields by report:

| Report | Sortable fields |
| - | - |
| `get_brand_report` | `visibility`, `visibility_count`, `mention_count`, `sentiment`, `position`, `share_of_voice` |
| `get_domain_report` | `citation_rate`, `retrieval_count`, `citation_count` |
| `get_url_report` | `retrievals`, `retrieval_count`, `citation_count`, `citation_rate` |

When `order_by` is omitted, each report falls back to a sensible default ordering.

## Dimensions

Dimensions break down results into rows grouped by a specific field. Without dimensions, results are totals for the entire date range.

| Dimension | What it does | When to use it |
| - | - | - |
| `date` | Daily breakdown (YYYY-MM-DD) | Tracking trends over time |
| `model_id` | Per AI search engine (deprecated, prefer `model_channel_id`) | Comparing performance across ChatGPT, Perplexity, etc. |
| `model_channel_id` | Per stable engine channel | Same as `model_id` but survives model version changes |
| `topic_id` | Per topic grouping | Finding your strongest and weakest topic areas |
| `tag_id` | Per tag | Analyzing custom segments |
| `prompt_id` | Per individual prompt | Drilling into specific queries |
| `country_code` | Per country | Checking geographic differences |
| `chat_id` | Per individual AI conversation | Inspecting specific responses |

You can combine dimensions. For example, `["date", "model_channel_id"]` gives you daily trends per AI engine.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.