> ## 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.

# Query your Kotlin project

> Copy two questions that work in any Kotlin Gradle repository.

Start your agent from a Kotlin Gradle repository. Kast uses its saved, indexed
IDEA project; the agent does not need to know a class name in advance.

## 1. Find a compiler-backed symbol

> Use Kast `query_symbols` to enumerate declarations in this workspace.
> Show one returned exact symbol's kind, signature, source location, and
> unchanged `ref`. Include query coverage and any limitation. If there is no
> symbol, state whether Kast proved the scope empty.

The direct tool input is:

```json theme={null}
{
  "request": {
    "type": "RUN",
    "source": {"type": "ALL_DECLARATIONS"},
    "steps": null,
    "output": {"type": "SYMBOLS", "fields": ["NAME", "LOCATION", "SIGNATURE"]},
    "executionBudget": {"maxResults": 5}
  }
}
```

This is a bounded sample. Reaching the result limit can make the answer
partial. With no explicit scope, Kast searches the workspace's `main` and
`test` source sets recursively. The returned `ref` names a compiler-backed
declaration; keep it unchanged for the next call.

## 2. Show an exact relationship

> For that Kast `ref`, use `query_symbols` to find references. Show the
> individual occurrence facts and their locations. Report omissions or
> incomplete coverage, even if no occurrences were returned.

```json theme={null}
{
  "request": {
    "type": "RUN",
    "source": {"type": "SYMBOL_REFS", "symbolRefs": ["<returned ref>"]},
    "steps": [{"type": "EXPAND_RELATION", "relation": "REFERENCES"}],
    "output": {"type": "OCCURRENCES"}
  }
}
```

Replace the placeholder with an exact `ref` from step 1. Occurrence output preserves individual relation facts and repeated use sites. An empty result supports an absence claim only when coverage is complete for the requested scope.

## Read the answer

| Direct MCP status           | Meaning                                                           |
| --------------------------- | ----------------------------------------------------------------- |
| `complete`                  | The requested scope was covered.                                  |
| `partial`                   | Keep the returned facts and the stop reason; absence is unproven. |
| `rejected` or `unavailable` | Follow the typed error before making a semantic claim.            |

Tool RPC uses `type: "qualified"` for a partial document. The [MCP](/reference/mcp-catalog) and [RPC](/reference/rpc-catalog) pages show their exact wrappers. To filter, expand, walk, combine, or retain results, [compose a query](/query-pipelines). See the generated **Query symbols** entry in the API / RPC tab for the exact installed schema.
