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

# context profile build

> Build the bounded public site-profile facts: robots.txt, at most 3 sitemap documents and at most 10 selected pages per run, fetched on the verifier's public fetch boundary with the CLI's courtesy pacing, with every limit the run hit reported as a count.

`context_profile_build`

Build the bounded public site-profile facts: robots.txt, at most 3 sitemap documents and at most 10 selected pages per run, fetched on the verifier's public fetch boundary with the CLI's courtesy pacing, with every limit the run hit reported as a count. Facts keep derived fields (titles, h1s, description, canonical, link counts, sitemap membership, byte hashes, fetched\_at) ,  never raw HTML. A page that could not be read is unknown/unreadable, never "no assets", and missing pages stay explicit.

<Note>Repository-local stdio MCP only. This tool is absent from hosted MCP and HTTP. It can write local context files or fetch bounded public context.</Note>

## Setup and request

Start the [local context host](/guides/local-context) with an explicit repository root. Paths are restricted to that root, including symlink resolution.

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "context_profile_build",
    "arguments": {}
  }
}
```

## Input fields

| Field   | Type   | Presence | Meaning and constraints                                                                               |
| ------- | ------ | -------- | ----------------------------------------------------------------------------------------------------- |
| `site`  | string | Optional | The site value; allowed values and bounds are specified in this schema. minLength: 1; maxLength: 2048 |
| `pages` | array  | Optional | The pages value; allowed values and bounds are specified in this schema. maxItems: 50                 |

## Returned result

Captured from a local fixture repository without external credentials.

```json theme={null}
{
  "state": "ok",
  "origin": "https://example.com",
  "built_at": "2026-09-13T12:00:00Z",
  "robots": {
    "outcome": "fetched",
    "reason": null,
    "directives": 0
  },
  "sitemaps": {
    "documents": 0,
    "urls_found": 0,
    "truncated": false,
    "capped": false,
    "directives_seen": 0,
    "failures": {},
    "skipped": {}
  },
  "pages": [
    {
      "url": "https://example.com/guide",
      "outcome": "fetched",
      "reason": null,
      "title": "Example guide",
      "in_sitemap": false,
      "selection_reasons": [
        "manual"
      ],
      "asset_candidate_reasons": []
    },
    {
      "url": "https://example.com/",
      "outcome": "fetched",
      "reason": null,
      "title": "Example guide",
      "in_sitemap": false,
      "selection_reasons": [
        "homepage"
      ],
      "asset_candidate_reasons": []
    }
  ],
  "limits": {
    "sitemap_documents": 3,
    "selected_pages": 10,
    "pages_capped": false,
    "pages_selected": 2
  },
  "rows_written": 3,
  "notes": []
}
```

| Field                             | Type          | Presence | Meaning and constraints                                                          |
| --------------------------------- | ------------- | -------- | -------------------------------------------------------------------------------- |
| `state`                           | string        | Required | Profile build completed; individual pages may remain unreadable. must equal "ok" |
| `origin`                          | string        | Required | Resolved public site origin.                                                     |
| `built_at`                        | string        | Required | Run start timestamp.                                                             |
| `robots`                          | object        | Required | Robots document outcome. additional fields rejected                              |
| `robots.outcome`                  | string        | Required | fetched or unreadable.                                                           |
| `robots.reason`                   | string / null | Required | Reason for robots outcome.                                                       |
| `robots.directives`               | integer       | Required | Sitemap directives found. minimum: 0                                             |
| `sitemaps`                        | object        | Required | Bounded sitemap discovery. additional fields rejected                            |
| `sitemaps.documents`              | integer       | Required | Sitemap documents attempted. minimum: 0                                          |
| `sitemaps.urls_found`             | integer       | Required | Unique discovered URLs. minimum: 0                                               |
| `sitemaps.truncated`              | boolean       | Required | A parsed sitemap was truncated.                                                  |
| `sitemaps.capped`                 | boolean       | Required | The sitemap document cap was reached.                                            |
| `sitemaps.directives_seen`        | integer       | Required | Robots sitemap directives found. minimum: 0                                      |
| `sitemaps.failures`               | object        | Required | Fetch or parsing failures by reason.                                             |
| `sitemaps.skipped`                | object        | Required | Skipped sitemap entries by reason.                                               |
| `pages`                           | array         | Required | Bounded selected-page outcomes.                                                  |
| `pages[].url`                     | string        | Required | Selected page URL.                                                               |
| `pages[].outcome`                 | string        | Required | Page fetch outcome, including fetched or unknown/unreadable outcomes.            |
| `pages[].reason`                  | string / null | Required | Fetch reason.                                                                    |
| `pages[].title`                   | string / null | Required | Derived page title.                                                              |
| `pages[].in_sitemap`              | boolean       | Required | Page appeared in collected sitemap URLs.                                         |
| `pages[].selection_reasons`       | array         | Required | Why this page was selected.                                                      |
| `pages[].asset_candidate_reasons` | array / null  | Required | Observed or manual reasons to review this page as an asset.                      |
| `limits`                          | object        | Required | Applied limits and actual selection. additional fields rejected                  |
| `limits.sitemap_documents`        | integer       | Required | Configured sitemap document cap. minimum: 0                                      |
| `limits.selected_pages`           | integer       | Required | Configured selected-page cap. minimum: 0                                         |
| `limits.pages_capped`             | boolean       | Required | Selected-page cap was reached.                                                   |
| `limits.pages_selected`           | integer       | Required | Pages attempted. minimum: 0                                                      |
| `rows_written`                    | integer       | Required | Fact rows appended; includes robots, sitemaps and pages. minimum: 0              |
| `notes`                           | array         | Required | Explicit cap and unreadable-page notes.                                          |

The summary can report state ok while pages are unreadable. Stored fact rows contain the fuller derived evidence; this result omits raw HTML.

[Download result schema](/schemas/context_profile_build.output.json).

## Result and recovery

The host returns JSON in both `structuredContent` and text content. The [local context reference](/reference/context/results) describes each result, file ownership and recovery. Start/end dates must be supplied together. Thrown input or file failures return `isError: true`. Missing manual/profile files and unresolved citations also flag an error. Inspect returned connection states separately: revoked or unavailable access can be result data. Manual-only configuration is valid.

See [local context](/guides/local-context), [CLI context commands](/reference/local/index) and [schema conventions](/reference/schemas).
