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

Attachments 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(:attachments)` for descriptions and context requirements.

# `discard`

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

Discard a pending upload (not a sent attachment).

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

# `prepare_upload`

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

Get an upload URL. POST the file's exact bytes to `relativeUrl` on this MCP server's HTTP origin, then send via `t3_thread_send_attachments` with the returned `attachmentId`.

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

# `send`

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

Send uploaded attachments as a new message to a thread. No retry key. Target modes cannot exceed yours. Success does not mean the provider read them or finished.

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*
