> For the complete documentation index, see [llms.txt](https://kerno.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kerno.gitbook.io/docs/references/scopes.md).

# Scopes

### The four scopes

| Scope                     | Meaning                                                               |
| ------------------------- | --------------------------------------------------------------------- |
| `all`                     | Every endpoint in the selected application                            |
| `changed`                 | Only endpoints affected by your current git changes (validation only) |
| `file:path/to/handler.ts` | Endpoints defined in that source file                                 |
| `endpoint:METHOD /path`   | A single endpoint, identified by HTTP method and path                 |

### When to use each

* **`all`** is useful for first-time baselining or when you want full coverage across an app.
* **`changed`** is the default for day-to-day validation. Kerno uses your git diff to figure out which endpoints to re-run, so you do not validate untouched code.
* **`file:`** scopes to a single source file when you have made focused changes to one handler.
* **`endpoint:`** validates one specific route when you want to verify a precise change.

### Where scopes apply

These MCP tools take a `scope` parameter.

* `kerno_list_endpoints` — required
* `kerno_plan_baseline` — async mode only
* `kerno_implement_baseline`
* `kerno_validate`

The `changed` scope only works with `kerno_validate`.

### How scopes work behind the scenes

Kerno's dependency graph maps every endpoint to the code that produces it. When you pick a scope, Kerno resolves it to a concrete list of endpoints, then plans, generates, or validates against that list. The mechanism is the same whether you drive Kerno through MCP or the IDE.

See How Kerno works for the validation flow, and Baselines and scenarios for what scenarios cover.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://kerno.gitbook.io/docs/references/scopes.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
