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

# Research

> Ask how a package or repository works and get an answer with cited sources.

Research is experimental. [Enable it](/tools/experimental-tools#enable-the-tools) for CLI and local stdio MCP; see [availability](/tools/experimental-tools#availability) for transport limits.

```bash theme={null}
npx githits@latest research npm:express "How does Express handle middleware errors?"
```

The MCP tool is `research`. For HTTP integration, use the [REST endpoint](/api/requests-and-responses#research-a-question-with-cited-sources).

## Parameters

Choose one target mode:

| Mode | Usage |
| - | - |
| Question only | Omit the target; GitHits identifies it from the question |
| Explicit target | Pass a package or repository such as `npm:express` |
| Follow-up | Pass `--thread` in the CLI or `thread_id` in MCP; omit the target |

Threads support up to ten turns. Replace `<threadId>` with the ID from an earlier answer:

```bash theme={null}
npx githits@latest research --thread '<threadId>' "Which source files implement that?"
```

Citations default to `read` calls with the target, path, selector, and line bounds used by Research. For upstream URLs, use CLI `--source-format url` or MCP `source_format: "url"`.

## Output

The answer includes citations, a run ID, and a thread ID. CLI `--json` and MCP `format: "json"` return this envelope from version 0.24.0:

```json theme={null}
{
  "display_markdown": "Answer and source citations...",
  "tool_call_id": "<runId>",
  "thread_id": "<threadId>"
}
```

Both IDs are optional. Display `display_markdown` as untrusted text; its section and citation layout is not stable. Earlier CLI/MCP `answer_markdown` and `sources` fields are no longer returned. The REST endpoint has a [separate response schema](/api/requests-and-responses#research-a-question-with-cited-sources).

## Target clarification

If the target is ambiguous, GitHits returns candidates in `display_markdown`. Choose a target and repeat the question. With no matches, correct the name or provide an explicit target.

Clarifications exit `0` and omit `tool_call_id` and `thread_id`. There is no separate `outcome` field.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.