# `McpHouse.Client.Operation`
[🔗](https://github.com/HashNuke/mcp_house/blob/main/lib/mcp_house/client/operation.ex#L1)

A handle for an asynchronous tool call or subscription.

`McpHouse.Client.start_tool_call/4` returns this handle directly.
`McpHouse.Client.subscribe/4` returns it in an `{:ok, operation}` tuple.
The process that starts the operation owns its lifetime. Use `await/2`
to collect its result and `cancel/1` to request cancellation. These
functions are also available through `McpHouse.Client`.

# `t`

```elixir
@opaque t()
```

A handle returned when a client operation starts.

# `await`

Collects the operation's terminal result.

The timeout is in milliseconds and defaults to 5,000. Pass `:infinity`
to wait without a limit. A wait timeout returns `{:error, :await_timeout}`
and leaves the operation running. Collect a terminal result once.

# `cancel`

Requests cancellation and sends a protocol cancellation signal when applicable.

Returns `:ok` for a successful cancellation or an already closed
operation. Cancellation can return an error if sending the notification
or cleaning up the stream fails. Use `await/2` to collect the terminal
result.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

---

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