---
title: "Using overlane docs and the MCP docs tool"
description: "How an agent looks up library docs with the overlane docs command or the MCP docs tool, and what each answer contains."
---

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

# Using overlane docs and the MCP docs tool

The MCP `docs` tool and the `overlane docs` commands share one contract: for the same input they return the same JSON. An agent uses whichever its client offers.

## Ask a question

```sh
overlane docs query acme-widgets "how do I create a widget" --project prj_1 --json
```

The MCP call has the same fields:

```json
{ "name": "docs", "arguments": { "tenantId": "TEAM", "operation": "query", "library": "acme-widgets", "q": "how do I create a widget", "projectId": "prj_1" } }
```

The version is chosen in this order: `--version`, then the project's pin from its lockfile, then the latest version the library's source documents. The answer's `versionSource` says which one applied.

Each snippet has `version`, `sourceUrl`, `fetchedAt`, `ageDays`, a `stale` flag and a `label` that marks the text as third-party data. `status` is one of `ok`, `indexed_on_demand` (the library was fetched for this call), `pin_unavailable`, `blocked` and `no_match`.

Snippets are ranked by keyword match (BM25) over the chunks of the one version being asked about. The ranking is deterministic: the same index and question give the same order, and nothing is sent to a model to answer a question. An embedding re-rank can be switched on by the operator; it only reorders the keyword matches and is skipped if it fails.

## Index and refresh

```sh
overlane docs index react --version 18.3.1
overlane docs index acme-widgets --project prj_1 --refresh
```

`--refresh` fetches again and re-indexes only when the text changed. A scheduled freshness job does the same for indexes older than 7 days, so an agent rarely needs to; an index older than 30 days is labelled stale with its age. `--dry-run` prints the plan without fetching anything.

## See what is indexed

```sh
overlane docs libraries
overlane docs deps --project prj_1
```

The other operations of the tool are `index`, `private`, `pins`, `dependencies`, `libraries` and `usage`. Each is also an HTTP endpoint: query, index, pins, dependencies and usage are in the [API reference](/api/).

Command reference: [overlane docs query](/cli/docs-query/), [index](/cli/docs-index/), [pins](/cli/docs-pins/), [deps](/cli/docs-deps/), [add](/cli/docs-add/), [usage](/cli/docs-usage/) and [libraries](/cli/docs-libraries/).

Source: https://docs.overlane.app/library-docs/using-docs/index.mdx
