---
name: get-ad-account-context
description: Read the approved account state, first-party signal health, and verified performance through Plainrouter.
---

# Get Ad Account Context

Use this skill before performing account-specific work through Plainrouter. A Workspace key uses its account binding when present; otherwise, account resolution accepts a requested active account in its workspace or the sole active account.

## Installation

Install the published skill artifact into an agent-compatible local skills directory:

```shell
mkdir -p .agents/skills/get-ad-account-context
curl --fail --location \
  https://plainrouter.com/.well-known/agent-skills/get-ad-account-context/SKILL.md \
  --output .agents/skills/get-ad-account-context/SKILL.md
```

Clients that support Agent Skills discovery can instead read the discovery index at `https://plainrouter.com/.well-known/agent-skills/index.json` and install the advertised artifact URL. Verify the index `digest` against the downloaded bytes before loading the skill.

## Configuration

| Option                 | Value                                  | Required behavior                                                                         |
| ---------------------- | -------------------------------------- | ----------------------------------------------------------------------------------------- |
| MCP endpoint           | `https://plainrouter.com/mcp`          | Use Streamable HTTP and the protocol version advertised by the server.                    |
| Authentication         | Owner-issued Workspace key | Use the **Read** tier for context; account resolution uses a key binding when present and otherwise an active account in that workspace. |
| Account scope          | Key binding when present; otherwise an active account in the workspace | Supply `account_id` when the workspace has more than one active account. |
| `get_performance.days` | Integer from `1` to `90`; default `7`  | Use the shortest window that answers the request.                                         |
| Proposal permission    | `actions.propose`                      | Treat it as permission to submit governed proposals, never direct mutation authority.     |

Connect with these steps:

1. Have the workspace owner issue a Workspace key for the workspace. **Read** is sufficient for this skill's context operations; choose the account at call time when required.
2. Configure the MCP client for `https://plainrouter.com/mcp` with the Workspace key in its bearer-authorization configuration. Keep the Workspace key out of prompts, URLs, source control, and logs.
3. Call `get_account_state` and verify the returned workspace, Meta ad account, and `authorization.permissions` before using account data.

OAuth management credentials cannot authenticate MCP tool calls. They are limited to management account discovery. A Server secret authenticates the separate Signals REST API, not MCP. Follow [Workspace keys](https://plainrouter.com/docs/actions/workspace-tokens) and [Authentication](https://plainrouter.com/docs/api/authentication) for setup.

## Usage

Start every account-specific workflow by calling `get_account_state`:

```json
{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
        "name": "get_account_state",
        "arguments": {}
    }
}
```

Call `get_account_state` before relying on account-specific assumptions. The result includes:

- The connection identity and granted permissions.
- The approved advertising account ID and name.
- The advertising platform, currency, and timezone.
- The owning Plainrouter workspace.
- Whether a first-party Signal and Meta dataset are connected.
- The account capabilities available to this connection, including Marketing API reads and governed management writes. These flags describe the account, not the caller’s permission tier; the tool itself only inspects state.

Call `get_signal_health` when asked whether tracking is healthy, where match quality is changing, or whether deliveries need attention. Its answer is derived from Plainrouter's event and delivery ledgers, stored EMQ snapshots, and stored reconciliation reports. It does not make a live Marketing API request.

Call `get_performance` to compare Meta-reported conversions with gateway-verified accepted conversions. Pass `days` from 1 to 90; the default is 7.

```json
{
    "jsonrpc": "2.0",
    "id": 2,
    "method": "tools/call",
    "params": {
        "name": "get_performance",
        "arguments": {
            "days": 7
        }
    }
}
```

Treat the returned context as read-only. Do not infer access to another advertising account or claim direct campaign mutation. When `actions.propose` is present, use the supported proposal tools; the convenience creative tools also require `creative.write`. Ask waits for approval; in Custom, the workspace's Custom switches decide; Full runs policy-allowed agent changes automatically. Rule violations are blocked and shown in the Inbox. Canonical `pause`, `resume`, `increase_budget`, and `decrease_budget` actions use dispatch checks for a live grant, an account in the workspace, and no duplicate write. The execution kill switch stops further writes and never undoes a landed change. Proposals of `set_status`, `adjust_budget`, `replace_creative`, `shift_spend` and `rollback` are refused; stored actions of these types never run. See [the creative workflow](https://plainrouter.com/docs/actions/creative-workflow) for supported image upload and paused-ad duplication.
## Sitemap

See the full [sitemap](/sitemap.md) for all pages.
