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

# Source diagnostics Page

> Open the seller's source diagnostics Page from V3 to inspect an inventory source's health, calls and failures, and to repair a missing Agent link.

Source diagnostics is a Seller Page for call-level investigation of one
inventory source. It shows how the source is configured, what recent buyer
traffic did, which operations are failing and who has to act. The Page also
repairs one thing: an active external-Agent source that has no registered Agent
relationship.

## Open the Page

```json theme={null}
{ "page": "source_diagnostics", "sourceId": "SOURCE_ID" }
```

`sourceId` comes from `search({ "kind": "inventory_source" })`. Leave it out to
open the Page with no source selected and choose one there. Only a Seller Account can
open the Page. A Buyer Account is refused with a wrong-account error.

<Note>
  Source activity does not prove demand. A Seller Account that is not ready can
  correctly show no source calls, because work stops before a buyer request
  reaches a source. Call `get_status` first. Its blockers name the pre-dispatch
  problem and the next tool or Page.
</Note>

## What the Page shows

Choose **Source health** on a source to read its health object one section at a
time:

* **Source.** The seller account, the source and its connection type, the Agent
  that powers it, and whether buyer requests reach it, with reason codes when
  they do not. When setup is incomplete, the steps still to finish are listed,
  and each opens Seller Setup.
* **Health by operation.** One row for each AdCP operation Apostra performs
  against the source, with its status, call counts, the last success and the
  last failure, and who acts on it.
* **Diagnosis.** Each finding with its severity, the operation it is about, who
  acts, the next step, and **Show calls** to expand the calls behind it.
* **Open operations.** Work still waiting at this source, what it waits for and
  who it waits on.

**Technical details** holds the source tests, protocol calls, transport
evidence, tool declarations and request signing. It is for investigating a
fault, not for routine setup.

Health uses one vocabulary: **Healthy**, **Degraded**, **Erroring** and
**Unknown**. A source that has never been observed reads Unknown. A `timeout`
condition means a call did not finish inside the observer's time budget. It is
degraded evidence, not an error response from the source.

Setup, request eligibility and health are separate. A degraded or erroring
source still receives buyer requests unless it is paused, not set up, or mapped
to an ineligible Agent.

## Repair a missing Agent link

When an active external-Agent source has no registered Agent relationship, the
source's owner can create or attach the Agent from this Page. This is the only
write the Page owns, and `open_page` carries no input for it. The person who
owns the source does it in the Page. Credentials and authority changes stay
human steps in the Page and never pass through a model.

## Read the same evidence without the Page

V3 has typed reads and one action beside the Page:

| Need | Use |
| - | - |
| A source's connection and diagnostic evidence | `get({ "kind": "inventory_source", "id": "SOURCE_ID", "include": ["diagnostics"] })`. Diagnostics follow the source's actual connection. A source with no supported diagnostic marker reports the include as unsupported. |
| Pre-dispatch blockers for the whole Seller Account | `get_status`. |
| A fresh, no-spend check of an external sales-agent source | `refresh_inventory_source_health` with the `sourceId`. It runs a `get_products` check, writes no source configuration and creates no media buy. It returns an `outcome` of `passed`, `empty`, `failed` or `not_reached`, the evidence ids, and the seller's readiness. |
| Sync history and the connection test for an ad-server source | The `ad_server_diagnostics` Page, which a person uses to run **Test connection**. See [Testing an ad-server connection](/v2/setup/v3/seller-workflows#testing-an-ad-server-connection). |

`refresh_inventory_source_health` works only on an external sales-agent source.
Managed and modular sources have their own diagnostics.

## What V3 covers and what it does not

V3 opens this Page with an optional `sourceId`. It does not provide a tool for
the Page's run histories: the intelligence runs and the agent test runs. Those
are Page reads that a person uses. An agent that needs that detail opens the
Page and points the person at it rather than describing runs it cannot read.

## Related

* [Seller workflows: Add and diagnose inventory](/v2/setup/v3/seller-workflows#add-and-diagnose-inventory)
* [Diagnose third-party sales agents](/v2/storefront/inventory-sources/diagnostics),
  which documents the health object and transport evidence in detail. It
  describes the v2 storefront API, which is deprecated.
* [Buyer Account Mapping Page](/v3/seller-buyer-account-mapping-page)


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