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

# MCP tools reference

> Every public OAuth tool the OpenLens MCP server exposes, grouped by surface.

Every tool is scoped to the authenticated user's projects. All require a valid OAuth session and operate with the same permissions as the web UI.

Every tool declares three hints, so MCP clients can decide which calls to confirm:

* `readOnlyHint` is true for the tools that only read.
* `destructiveHint` is true for the tools that change or delete data, such as `update_project_settings`, `delete_prompts`, `cancel_run` and `update_schedules`, and for `run_readiness_check` and `run_ai_index_coverage`. Tools that only add data, such as `add_topics` and `run_prompts`, are neither read-only nor destructive.
* `openWorldHint` is true for the four tools that reach the public web: `run_readiness_check` and `run_content_audit` fetch your site, and `run_prompts` and `run_ai_index_coverage` query AI platforms.

> [!NOTE]
>
> The in-app Agent uses a private MCP surface at `/api/agent/mcp` and adds agent-only tools such as `create_document` and `get_agent_readiness`, which reads Agent Readiness checks. Those private tools are not available through the public OAuth `/mcp` server.

## Async status

Async run and audit tools return one lifecycle `status` on the existing payload object. The agent-facing status values are `queued`, `running`, `completed`, `failed`, `canceling`, `canceled`, `stale`, `unknown`, and `none` for empty prompt-run responses.

MCP does not expose `partial` as a status; incomplete output remains visible through existing fields such as platform response counts, content-audit progress, `results_truncated`, and page/result counts. `stale` is derived at read/list time from running or interrupted records and feature-specific stale thresholds; it is not a stored database status.

## Connection

| Tool | Description |
| - | - |
| `whoami` | Report the connected user and organization (workspace) this MCP connection is bound to: org name, org id, plan tier, and your role. Call it first, before any tool that creates, updates, or deletes data, to confirm you are operating in the intended workspace. A binding of `personal_workspace_fallback` means the OAuth token carried no organization claim, so you are in a personal workspace; reconnect and select the org if that was not intended. |

## Project & client setup

| Tool | Description |
| - | - |
| `setup_client` | Create a new OpenLens project with own brand, competitors, topics, custom prompt attributes, and generated prompts. |
| `list_projects` | List the user's OpenLens projects. |
| `update_project_settings` | Update name, URL, location, languages, active platforms, or generated prompts. `refresh_prompts` tops-up or recreates prompts. Active platforms are the defaults for manual runs and new schedules; an existing schedule keeps its own. |
| `delete_project` | Archive one project. History is preserved. |

## Brands

| Tool | Description |
| - | - |
| `list_brands` | List the own brand and competitors tracked for a project. |
| `add_competitors` | Add one or more competitor brands in one batch. Names matching an existing or the own brand are skipped. |
| `delete_competitors` | Soft-delete one or more competitor brands by ID in one batch. Past mentions are preserved; the own brand cannot be deleted this way. |

## Platforms

| Tool | Description |
| - | - |
| `list_platforms` | List the AI platforms the user is entitled to. |

## Topics

| Tool | Description |
| - | - |
| `list_topics` | List tracked topics for a project. |
| `add_topics` | Add one or more topics in one batch, each starting background prompt generation. |
| `delete_topics` | Soft-delete one or more topics by ID in one batch. They stop running; past responses are preserved. |

## Prompts

| Tool | Description |
| - | - |
| `list_prompts` | List active and inactive prompts, optionally scoped to one topic. |
| `add_prompts` | Add one or more manual prompts to existing topics in one batch. Attributes are required and must come from `list_prompt_attributes`. |
| `set_prompts_active` | Activate or deactivate one or more prompts by ID in one batch, all the same direction. Historical results are kept. |
| `update_prompt_templates` | Edit one or more prompts' text and/or attributes by ID in one batch. Editing a prompt with run history clones it and returns `requires_confirmation`. |
| `delete_prompts` | Soft-delete one or more prompts by ID in one batch. Historical responses are retained; use `set_prompts_active` for reversible deactivation. |

## Prompt attributes

| Tool | Description |
| - | - |
| `list_prompt_attributes` | Built-in + custom attributes for a project. |
| `add_prompt_attributes` | Add one or more custom attributes in one batch. Existing, archived, or reserved values are skipped. |
| `archive_prompt_attributes` | Archive one or more custom attributes in one batch. Historical labels are preserved; built-in and language attributes cannot be archived. |
| `unarchive_prompt_attributes` | Restore one or more archived custom attributes in one batch. |

## Prompt runs

| Tool | Description |
| - | - |
| `run_prompts` | Start a run. Returns immediately with `status`. Poll `get_run_status` every \~30s while status is `queued`, `running`, or `canceling`. |
| `cancel_run` | Cancel a running prompt run. Safe for already-terminal runs. |
| `get_run_status` | Get status. Pass `run_id` for a specific run; omit it for the latest run. Unknown explicit run IDs return `RUN_NOT_FOUND`; projects with no runs return `status: none`. |
| `list_runs` | List recent runs with their IDs and canonical lifecycle `status`. |

To read historical analytics, call `list_runs` first and pass a completed run's `run_id` to `get_visibility`, `get_topic_visibility`, `get_attribute_breakdown`, `get_engine_patterns`, `get_prompt_performance`, `get_citations`, or `get_mentions`. Omit `run_id` to use the latest usable run. Those tools reject runs from another project and runs that have not completed. `get_prompt_results` also accepts `run_id` and can expose an in-progress run's partial output.

Comparing citations and visibility across runs can show correlation, but it does not prove that a source caused a visibility change.

## Site Readiness

These tools work with Site Readiness checks, one of the three checks on [Site Health](https://docs.openlens.com/manual/site-health.md). Agent Readiness checks aren't available over MCP.

| Tool | Description |
| - | - |
| `run_readiness_check` | Start a Site Readiness check for a project: crawlability, indexing directives, content without JavaScript and AI crawler access. Needs an explicit page budget. Returns the new run's id, status, and effective scope configuration. Consumes monthly page allowance. |
| `get_readiness_run` | Get status, summary, and one entry per check with pass, warn and fail counts over every page. Pass `check_key` to list that check's per-page results, worst first and a page at a time: follow `next_cursor` until it's null, and filter with `status`. Every plan sees each finding with its measured facts and affected pages, except older runs marked `detail_locked`. Fix recommendations come on Starter and Agency, as in the app. On Free each `recommendation` is `null` and `recommendations_locked` is true. |
| `list_readiness_runs` | List recent Site Readiness runs for a project, newest first (latest 50). |

## AI Index Coverage

These tools start and read AI Indexing checks. The verdicts `indexed`, `not_indexed` and `unknown` are what Site Health shows as Indexed, Not indexed and Unknown. See [AI Indexing](https://docs.openlens.com/manual/ai-indexing.md).

| Tool | Description |
| - | - |
| `run_ai_index_coverage` | Start an AI Index Coverage run for a project URL. Returns the run id, status, effective scope, allowance summary, and polling metadata. |
| `get_ai_index_coverage_run` | Get one AI Index Coverage run's status, score, per-platform coverage summary (`indexed`, `not_indexed`, `unknown`), gated classified page-level gaps, and polling metadata. |
| `list_ai_index_coverage_runs` | List recent AI Index Coverage runs for one project, including ids, status, scores, page counts, timestamps, and error summaries. |

## Visibility & analytics

| Tool | Description |
| - | - |
| `get_visibility` | Brand visibility for the latest usable run or a specific completed run. Supports `overview`, `by_topic`, `by_platform`. `by_topic` counts only topics that existed during the run, so topics deleted before it or added after it aren't listed. |
| `get_topic_visibility` | Detailed visibility for one topic in the latest usable run or a specific completed run. |
| `get_trends` | Multi-brand visibility trends over the last N days. |
| `get_prompt_results` | Raw AI response text for the latest usable run or a specific run, with optional filters. |
| `get_prompt_performance` | Rank prompts by appearance, coverage, position, citations, and sentiment in the latest usable run or a specific completed run. |
| `get_attribute_breakdown` | Per-attribute brand sentiment and evidence for one topic in the latest usable run or a specific completed run. These are response attributes (what AI says about each brand), distinct from prompt-tag attributes. |
| `get_engine_patterns` | Compare how each platform sources and structures answers in the latest usable run or a specific completed run. |
| `get_citations` | Top cited domains for the latest usable run or a specific completed run, with optional filters. |
| `get_mentions` | Own-brand mention summaries grouped by topic for the latest usable run or a specific completed run. |

## Google integrations

Both tools read through the organization's Google connection and the project's assigned property, set up in the web UI ([Settings](https://docs.openlens.com/manual/settings.md#google-integrations)). They are available to the in-app agent, and not on this public MCP server. When setup is incomplete they return `NOT_CONNECTED` or `NOT_CONFIGURED` with the exact next step instead of failing. Read-only, both of them.

| Tool | Description |
| - | - |
| `get_gsc_search_analytics` | Google Search Console search analytics for a project: clicks, impressions, CTR, position, plus top rows by `query` or `page` over 7, 28, or 90 days. Live from Google, cached about an hour. Headline totals use by-property aggregation and match the GSC UI. GSC reporting lags 2 to 3 days behind real time. |
| `get_ga4_ai_traffic` | GA4 sessions and key events from AI referrers (ChatGPT, Perplexity, Gemini, Claude, Copilot, Grok, DeepSeek) against site totals, over 7, 28, or 90 days. Referrer-based, so it is a lower bound. Native apps and pasted links send no referrer. |

## Scheduling

| Tool | Description |
| - | - |
| `get_schedule` | Get one project's schedule: `enabled`, `frequency`, `starts_at` and `timezone`, `next_scheduled_run_at`, `pause_reason`, and `scope` (`prompts`, which is `"all"` or a list of prompt IDs, plus `platforms` and `country_codes`). `configured` is false until the project's schedule is first saved; the scope shown then is what a new schedule would start with. |
| `update_schedules` | Update the schedules of one or more projects in one batch. Each item names a project and sets any of `enabled`, `frequency` (`daily`, `weekly` or `monthly`), `start_at` with `timezone`, `prompt_ids`, `platforms` and `country_codes`. Fields you leave out keep their value. Each project is handled on its own: one that's invalid, off-plan or over your credit pool is skipped with a reason while the rest apply. |

Each project has one schedule. Its time is a start date and time plus an IANA time zone:

* `start_at` is the first run, in ISO 8601 with its UTC offset, such as `2026-11-02T09:00:00-05:00`, within the next year. Later runs repeat at the same local time in `timezone`, such as `America/New_York`, so daylight saving doesn't move them. Send `timezone` with `start_at`.
* `prompt_ids` pins the schedule to those prompts. `null` runs every active prompt, including prompts added later.
* `platforms` and `country_codes` are the schedule's own. A project's first schedule takes them from the project, and changing the project's settings later doesn't change them. More than one country needs Agency.
* `hour_utc` is the older way to set the time: a UTC hour, repeated in UTC. It's ignored when `start_at` is set.

Disabling a schedule is always allowed. See [Scheduled runs](https://docs.openlens.com/manual/settings.md#scheduled-runs).

## Content audit

| Tool | Description |
| - | - |
| `run_content_audit` | Start a content audit for a project (whole site or single page). Returns immediately — poll `get_content_audit_status`. Consumes monthly page allowance (same as the web app). |
| `get_content_audit_status` | Poll audit status and progress (scored vs planned pages) without full scores or fix detail. |
| `get_content_audit_results` | Fetch plan-gated audit results: scores, dimension summaries, and prioritized fixes when entitled. Each page lists at most 5 problems and 3 insights, and the response at most 10 top fixes and 10 cross-references. A `*_truncated` flag beside each list says when it was cut. `problem_count` and `insight_count` give the totals your plan can see. |
| `list_content_audits` | List recent content audits for a project (id, target, status, score, page count, started time). |

## Documentation

These search the OpenLens documentation itself, so an agent can answer product questions and recommend next steps without guessing. Both are read-only and return ranked doc sections, each with a deep-link URL and a snippet.

| Tool | Description |
| - | - |
| `docs_search` | Search the full documentation (definitions, pricing, web UI manual, MCP/API reference) with BM25 ranking. Returns the most relevant sections for a query. |
| `happy_paths` | Search only the "how you're meant to use OpenLens" docs (onboarding, quickstart, recommended workflows). Best for open-ended "what should I do now?" guidance rather than syntax or reference lookups. |


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