# `T3.PullRequests`
[🔗](https://github.com/dl-alexandre/t3-elixir/blob/main/lib/t3/pull_requests.ex#L1)

PullRequests MCP operations. Pass T3's original string-keyed argument maps.

Tool availability depends on the authenticated server, permission mode and
invocation context. In-app agent tools may not be available to outside clients.
See `T3.Catalog.tools(:pull_requests)` for descriptions and context requirements.

# `link`

```elixir
@spec link(T3.Client.t(), map()) :: {:ok, map()} | {:error, T3.Error.t()}
```

Link a PR to this thread. T3 shows its status and settles the thread on merge.

Availability is server-, permission-, and context-dependent; outside clients must supply explicit project/thread targets when required.

# `link_many`

```elixir
@spec link_many(T3.Client.t(), map()) :: {:ok, map()} | {:error, T3.Error.t()}
```

Link several pull requests to a thread in one call. Invalid pull request URLs are returned separately.

Availability is server-, permission-, and context-dependent; outside clients must supply explicit project/thread targets when required.

# `list`

```elixir
@spec list(T3.Client.t(), map()) :: {:ok, map()} | {:error, T3.Error.t()}
```

List PRs linked to a thread, with last known state and stack order (bottom to top). Call only when you need that list. Never as an end-of-work check.

Availability is server-, permission-, and context-dependent; outside clients must supply explicit project/thread targets when required.

# `read_guide`

```elixir
@spec read_guide(T3.Client.t(), map()) :: {:ok, map()} | {:error, T3.Error.t()}
```

Read a PR's stored review guide and run state. `guide` is null when none exists. Never starts a run.

Availability is server-, permission-, and context-dependent; outside clients must supply explicit project/thread targets when required.

# `unlink`

```elixir
@spec unlink(T3.Client.t(), map()) :: {:ok, map()} | {:error, T3.Error.t()}
```

Remove a PR link from this thread. Succeeds with `wasLinked=false` when it was not linked.

Availability is server-, permission-, and context-dependent; outside clients must supply explicit project/thread targets when required.

# `unlink_many`

```elixir
@spec unlink_many(T3.Client.t(), map()) :: {:ok, map()} | {:error, T3.Error.t()}
```

Unlink every pull request on a thread whose last known state is in the supplied states.

Availability is server-, permission-, and context-dependent; outside clients must supply explicit project/thread targets when required.

# `unwatch`

```elixir
@spec unwatch(T3.Client.t(), map()) :: {:ok, map()} | {:error, T3.Error.t()}
```

Stop watching a PR for this thread. It stays linked.

Availability is server-, permission-, and context-dependent; outside clients must supply explicit project/thread targets when required.

# `watch`

```elixir
@spec watch(T3.Client.t(), map()) :: {:ok, map()} | {:error, T3.Error.t()}
```

Watch an open PR for this thread, linking it first if needed. T3 wakes you on failed checks, passed required checks, new comments or reviews, or conflicts. Handle old comments first. Only later ones wake you. After this call, end your turn. The watch stays on after each wake, so do not call this again on a wake. A wake is not a merge decision. Check readiness yourself.

Availability is server-, permission-, and context-dependent; outside clients must supply explicit project/thread targets when required.

# `write_guides`

```elixir
@spec write_guides(T3.Client.t(), map()) :: {:ok, map()} | {:error, T3.Error.t()}
```

Write review guides for up to 20 PRs (the tour in the PR Guide tab). Returns once runs start. Each run takes minutes in a temporary checkout. A run for the same head is joined. Read with `read_pull_request_guide`. Fails while guides are off.

Availability is server-, permission-, and context-dependent; outside clients must supply explicit project/thread targets when required.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
