# `Urchin.Content`
[🔗](https://github.com/urth-inc/urchin/blob/v0.4.0/lib/urchin/content.ex#L1)

Builders for MCP content blocks and resource contents.

Content blocks (`text`, `image`, `audio`, `resource_link`, `embedded`) appear in
tool-call results and prompt messages. Resource contents (`text_resource`,
`blob_resource`) appear in `resources/read` results.

Every builder returns a plain map with atom keys, ready to be JSON-encoded. Optional
members (`annotations`, `_meta`) are only included when provided.

# `block`

```elixir
@type block() :: map()
```

# `contents`

```elixir
@type contents() :: map()
```

# `opts`

```elixir
@type opts() :: keyword()
```

# `audio`

```elixir
@spec audio(String.t(), String.t(), opts()) :: block()
```

An audio content block carrying base64-encoded data and its MIME type.

# `blob_resource`

```elixir
@spec blob_resource(String.t(), String.t(), opts()) :: contents()
```

Binary resource contents (base64-encoded) for a `resources/read` result.

## Options
  * `:mime_type` - MIME type of the resource
  * `:meta` - value for the `_meta` field

# `embedded`

```elixir
@spec embedded(contents(), opts()) :: block()
```

An embedded resource content block. `resource_contents` must be a map built by
`text_resource/3` or `blob_resource/3` (or an equivalent shape).

# `image`

```elixir
@spec image(String.t(), String.t(), opts()) :: block()
```

An image content block carrying base64-encoded data and its MIME type.

# `resource_link`

```elixir
@spec resource_link(Urchin.Resource.t() | map(), opts()) :: block()
```

A resource link content block. Accepts an `Urchin.Resource` struct or a map carrying
at least `:uri`/`:name`.

# `text`

```elixir
@spec text(String.t(), opts()) :: block()
```

A text content block.

## Options
  * `:annotations` - client annotations map
  * `:meta` - value for the `_meta` field

# `text_resource`

```elixir
@spec text_resource(String.t(), String.t(), opts()) :: contents()
```

Text resource contents for a `resources/read` result.

## Options
  * `:mime_type` - MIME type of the resource
  * `:meta` - value for the `_meta` field

---

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