# MCP tool reference

The default and full MCP tool profiles, inputs, outputs and limits.

Canonical page: https://ontlgy.io/docs/reference/mcp-tools/

Connect to the installation's authenticated HTTP `/mcp` endpoint. The default `lean` profile exposes **11 tools**. Set `ONTLGY_TOOLS=full` to expose **19 tools**, then recreate the services and refresh the client.

Code tools return source locations and structure rather than complete source bodies. Read the cited files. External `doc_read` fetches live source text; skill-reading tools can return instruction bodies.

## Shared conventions

- `repo` accepts an indexed repository slug, name or alias. Use `repo_find` to resolve ambiguity.
- A symbol `ref` can be an ID, `path:line`, a qualified name or a bare name. Ambiguous names return candidates; choose an exact reference.
- `commit`, where supported, compares your checkout revision with the indexed commit. It does not change the index.
- Treat `found: false`, coverage limits and source errors as information, not proof of absence.
- The JSON below contains tool arguments, not commands to paste into a shell. `OWNER/REPO`, `SYMBOL` and the file paths are placeholders: use names from your own indexed repository.

## Default profile

### repo_find

**Input:** required `query` (nonempty string).

Resolves a repository name, alias or short description. Returns an exact/alias/search match, ambiguous candidates or no match.

```json
{"query":"ontlgy"}
```

### locate

**Input:** required `repo`, `task`; optional `limit` (default 8, range 1–15), `includeTests` (default false), `commit`.

Ranks candidate files and symbols, with related documents/guidance and freshness. Matching uses names, paths, signatures and docstrings. It can abstain when the index does not match well.

With session memory enabled, `relevantLearnings` can include up to three private, advisory packages for the authenticated user and matching indexed revision. Each includes the lesson, applicability, evidence references, source name, review status, and a link to its signed-in Memories page. Graph results remain available when memory recall is unavailable.

```json
{"repo":"OWNER/REPO","task":"retry timeout configuration","limit":5}
```

### search

**Input:** required `query`; optional `repo`, `limit` (default 50; capped at 100), `commit`.

Searches symbols by name, qualified name, docstring or signature. Returns results and freshness for the relevant repositories.

```json
{"repo":"OWNER/REPO","query":"SYMBOL","limit":5}
```

### symbol

**Input:** required `ref`; optional `repo`, `commit`.

Returns a symbol's location, signature and available documentation; caller/callee counts by certainty; related tests and documents; freshness. Can return ambiguous candidates.

```json
{"repo":"OWNER/REPO","ref":"SYMBOL"}
```

### impact

**Input:** required `ref`; optional `repo`, `depth` (default 2, range 1–4), `commit`.

Follows production callers/references toward entry points. Results include path certainty, test counts and completeness limits. Verify call sites before relying on the impact assessment.

```json
{"repo":"OWNER/REPO","ref":"SYMBOL","depth":2}
```

### skills_find

**Input:** optional `task`, `paths` (array), `repo`, `kind` (`skill`, `rule` or `instruction`), `limit` (default 5, range 1–5). Supply a task, paths, or both for a useful lookup.

Finds matching repository guidance without returning its full body. Explains matches or reports that no skill was found.

```json
{"repo":"OWNER/REPO","task":"change the retry timeout","paths":["src/client/retry.ts"]}
```

### skill_get

**Input:** `id`, or both `repo` and `name`.

Reads a skill's body, supporting-file list, related code/documents and parsing/reference issues. Copy the ID from `skills_find`.

### skill_file

**Input:** required `path`, plus `id` or both `repo` and `name`.

Reads one supporting file. Its path must remain inside the skill folder; it can be repository-relative or relative to that folder. Use a path returned by `skill_get`.

### docs_find

**Input:** required `query`; optional `space`, `source` (provider kind or exact source handle), `limit` (default 5, range 1–20).

Finds Confluence/Notion pages through bounded source facts and current generated discovery records. Returns handles, pointers and coverage; does not search stored full page bodies.

```json
{"query":"deployment rollback","source":"confluence","limit":5}
```

### doc_get

**Input:** required `handle`, copied from `docs_find`.

Returns indexed facts, outline, neighbors, source revision, available discovery records and provenance. It does not return a complete page body.

### doc_read

**Input:** required `handle`; optional `limit` (default 6000, range 500–10000), `cursor`, `locator`, `version`.

Reads bounded live source text over authenticated HTTP MCP after access/scope checks. Returns text blocks, source version, coverage and `nextCursor`. Pass `nextCursor` as `cursor` to continue. A targeted body `locator` must refer to the matching source `version`.

Failures include `unavailable`, `not_found`, `restricted`, `invalid_cursor` and `source_changed`. Refresh source coordinates after an edit. Stdio has no installation source credentials and returns an unavailable response directing you to HTTP or your own connector.

## Additional tools in the full profile

### callers

**Input:** required `symbolId`; optional `repo`, `limit` (default 50; capped at 200), `includeTests` (default false), `include` (array of `imports`, `extends`, `implements`), `commit`.

Returns one-hop callers with call sites and certainty. Tests are counted unless requested; imports are excluded unless requested.

### callees

**Input:** required `symbolId`; optional `repo`, `limit` (default 50; capped at 200), `include` (same values as `callers`), `commit`.

Returns one-hop called symbols, call sites and certainty.

### trace

**Input:** required `fromId`; optional `repo`, `toId`, `maxDepth` (default 5), `maxPaths` (default 10), `kinds` (default `["CALLS"]`), `commit`.

Finds graph call paths between symbols or reachable symbols from a starting ID. Use IDs returned by search/resolution, not invented names.

### knowledge

**Input:** required `repo`, `query`; optional `limit` (default 20), `commit`.

Searches repository documents, ADRs and sections. For Confluence/Notion, use `docs_find`.

### context

**Input:** optional `repo`, `path`, `id`, `symbolId`, `commit`. Supply the file, document or symbol you want context for.

Finds related repository documents and ADRs.

### skills_list

**Input:** required `repo`; optional `kind`, `stale`.

Lists the repository's guidance catalog. `stale: true` narrows it to entries with stale references.

### skills_stats

**Input:** optional `repo`, `since` (ISO datetime).

Reports searches, misses, opens and recent misses. Usage statistics do not establish skill effectiveness.

### repos_list

**Input:** no arguments (`{}`).

Lists indexed repository summaries, languages, aliases, skills and freshness.

## Examples and recovery

Follow [your first query](https://ontlgy.io/docs/start/first-query/), [change impact](https://ontlgy.io/docs/guides/change-impact/) or [live document reading](https://ontlgy.io/docs/guides/team-documents/). Use [troubleshooting](https://ontlgy.io/docs/reference/troubleshooting/) when the endpoint or a source cannot answer.
