# `ExUtcp.Transports.Mcp.ConnectionBehaviour`
[🔗](https://github.com/universal-tool-calling-protocol/elixir-utcp/blob/main/lib/ex_utcp/transports/mcp/connection_behaviour.ex#L1)

Behaviour for MCP connections to enable mocking in tests.

# `call_tool`

```elixir
@callback call_tool(pid(), tool_name :: String.t(), args :: map(), opts :: keyword()) ::
  {:ok, map()} | {:error, term()}
```

# `call_tool_stream`

```elixir
@callback call_tool_stream(
  pid(),
  tool_name :: String.t(),
  args :: map(),
  opts :: keyword()
) ::
  {:ok, Enumerable.t()} | {:error, term()}
```

# `close`

```elixir
@callback close(pid()) :: :ok | {:error, term()}
```

# `get_last_used`

```elixir
@callback get_last_used(pid()) :: integer()
```

# `send_notification`

```elixir
@callback send_notification(
  pid(),
  method :: String.t(),
  params :: map(),
  opts :: keyword()
) ::
  :ok | {:error, term()}
```

# `send_request`

```elixir
@callback send_request(pid(), method :: String.t(), params :: map(), opts :: keyword()) ::
  {:ok, map()} | {:error, term()}
```

# `start_link`

```elixir
@callback start_link(provider :: map(), opts :: keyword()) ::
  {:ok, pid()} | {:error, term()}
```

# `update_last_used`

```elixir
@callback update_last_used(pid()) :: :ok
```

---

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