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

# Add a declaration

> Use Kast's one-call, exact-target source change.

`add_declaration` adds one declaration to an existing Kotlin file. It uses an exact reference returned by Kast to identify the target, then plans, applies, verifies, and reports the outcome.

## Provide an exact target

First use a [query](/search) to obtain the target symbol reference. The change intent is:

```json theme={null}
{
  "exactTarget": "<exact-ref-returned-by-Kast>",
  "declaration": "fun retryLimit(): Int = 3"
}
```

The generated [Add declaration schema](/api-reference/add_declaration) defines the request. Pass the returned reference unchanged.

## Read the receipt

A successful change returns verification and a receipt. If the operation is uncertain, preserve its plan identity and recovery evidence. A rejected request or lost response does not prove that no write occurred.

## Know the boundary

This is not a general text editor. It does not add new files, replace arbitrary source ranges, rename symbols across files, or perform multi-file refactors. Use it only for the admitted exact-target declaration addition.
