# `ConduitMcp.Client.Resource`
[🔗](https://github.com/nyo16/conduit_mcp/blob/v0.11.0/lib/conduit_mcp/client/resource.ex#L1)

A resource listed by a server (`resources/list`).

`raw` keeps the string-keyed wire map untouched (including `icons` and any
future keys); the other fields are conveniences lifted from it. `uri` is
the server's string, never parsed or normalized here.

# `t`

```elixir
@type t() :: %ConduitMcp.Client.Resource{
  annotations: map() | nil,
  description: String.t() | nil,
  meta: map(),
  mime_type: String.t() | nil,
  name: String.t(),
  raw: map(),
  server_id: String.t(),
  size: non_neg_integer() | nil,
  title: String.t() | nil,
  uri: String.t()
}
```

# `from_wire`

```elixir
@spec from_wire(String.t(), term()) ::
  {:ok, t()} | {:error, ConduitMcp.Client.Error.t()}
```

Builds a `Resource` from a wire `Resource` map listed by `server_id`.

`uri` and `name` must be strings; otherwise the result is a `:protocol`
error with reason `:invalid_resource`.

    iex> {:ok, res} =
    ...>   ConduitMcp.Client.Resource.from_wire("docs", %{"uri" => "file:///a.md", "name" => "a"})
    iex> res.uri
    "file:///a.md"

---

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