# `ExUtcp.Types`
[🔗](https://github.com/universal-tool-calling-protocol/elixir-utcp/blob/main/lib/ex_utcp/types.ex#L1)

Core types and data structures for the UTCP protocol.

# `api_key_auth`

```elixir
@type api_key_auth() :: %{
  type: String.t(),
  api_key: String.t(),
  location: String.t(),
  var_name: String.t()
}
```

# `auth`

```elixir
@type auth() :: %{type: String.t(), __struct__: module()}
```

# `basic_auth`

```elixir
@type basic_auth() :: %{type: String.t(), username: String.t(), password: String.t()}
```

# `call_result`

```elixir
@type call_result() :: {:ok, any()} | {:error, any()}
```

# `cli_provider`

```elixir
@type cli_provider() :: %{
  name: String.t(),
  type: :cli,
  command_name: String.t(),
  working_dir: String.t() | nil,
  env_vars: %{required(String.t()) =&gt; String.t()}
}
```

# `client_config`

```elixir
@type client_config() :: %{
  variables: %{required(String.t()) =&gt; String.t()},
  providers_file_path: String.t() | nil,
  load_variables_from: [module()]
}
```

# `deregister_result`

```elixir
@type deregister_result() :: :ok | {:error, any()}
```

# `graphql_provider`

```elixir
@type graphql_provider() :: %{
  name: String.t(),
  type: :graphql,
  url: String.t(),
  auth: auth() | nil,
  headers: %{required(String.t()) =&gt; String.t()}
}
```

# `grpc_provider`

```elixir
@type grpc_provider() :: %{
  name: String.t(),
  type: :grpc,
  host: String.t(),
  port: integer(),
  service_name: String.t(),
  method_name: String.t(),
  target: String.t() | nil,
  use_ssl: boolean(),
  auth: auth() | nil
}
```

# `http_provider`

```elixir
@type http_provider() :: %{
  name: String.t(),
  type: :http,
  http_method: String.t(),
  url: String.t(),
  content_type: String.t(),
  auth: auth() | nil,
  headers: %{required(String.t()) =&gt; String.t()},
  body_field: String.t() | nil,
  header_fields: [String.t()]
}
```

# `manual`

```elixir
@type manual() :: %{name: String.t(), description: String.t(), tools: [tool()]}
```

# `mcp_provider`

```elixir
@type mcp_provider() :: %{
  name: String.t(),
  type: :mcp,
  url: String.t(),
  auth: auth() | nil
}
```

# `oauth2_auth`

```elixir
@type oauth2_auth() :: %{
  type: String.t(),
  client_id: String.t(),
  client_secret: String.t(),
  token_url: String.t(),
  scope: String.t()
}
```

# `provider`

```elixir
@type provider() :: %{name: String.t(), type: provider_type(), __struct__: module()}
```

# `provider_config`

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

# `provider_type`

```elixir
@type provider_type() ::
  :http
  | :sse
  | :http_stream
  | :cli
  | :websocket
  | :grpc
  | :graphql
  | :tcp
  | :udp
  | :webrtc
  | :mcp
  | :text
```

# `register_result`

```elixir
@type register_result() :: {:ok, [tool()]} | {:error, any()}
```

# `search_result`

```elixir
@type search_result() :: {:ok, [tool()]} | {:error, any()}
```

# `sse_provider`

```elixir
@type sse_provider() :: %{
  name: String.t(),
  type: :sse,
  url: String.t(),
  auth: auth() | nil,
  headers: %{required(String.t()) =&gt; String.t()}
}
```

# `stream_call_result`

```elixir
@type stream_call_result() :: {:ok, stream_result()} | {:error, any()}
```

# `stream_chunk`

```elixir
@type stream_chunk() :: %{
  data: any(),
  metadata: %{required(String.t()) =&gt; any()} | nil,
  timestamp: integer() | nil,
  sequence: integer() | nil
}
```

# `stream_end`

```elixir
@type stream_end() :: %{type: :end, metadata: %{required(String.t()) =&gt; any()} | nil}
```

# `stream_error`

```elixir
@type stream_error() :: %{
  type: :error,
  error: String.t(),
  code: integer() | nil,
  metadata: %{required(String.t()) =&gt; any()} | nil
}
```

# `stream_event`

```elixir
@type stream_event() :: stream_chunk() | stream_error() | stream_end()
```

# `stream_result`

```elixir
@type stream_result() :: %{
  type: :stream,
  data: [stream_chunk()] | Enumerable.t(),
  metadata: %{required(String.t()) =&gt; any()} | nil
}
```

# `streamable_http_provider`

```elixir
@type streamable_http_provider() :: %{
  name: String.t(),
  type: :http_stream,
  url: String.t(),
  auth: auth() | nil,
  headers: %{required(String.t()) =&gt; String.t()}
}
```

# `tcp_provider`

```elixir
@type tcp_provider() :: %{
  name: String.t(),
  type: :tcp,
  protocol: :tcp,
  host: String.t(),
  port: integer(),
  timeout: integer(),
  auth: auth() | nil
}
```

# `text_provider`

```elixir
@type text_provider() :: %{name: String.t(), type: :text, file_path: String.t()}
```

# `tool`

```elixir
@type tool() :: %{
  name: String.t(),
  description: String.t(),
  inputs: tool_input_output_schema(),
  outputs: tool_input_output_schema(),
  tags: [String.t()],
  average_response_size: integer() | nil,
  provider: provider()
}
```

# `tool_input_output_schema`

```elixir
@type tool_input_output_schema() :: %{
  type: String.t(),
  properties: %{required(String.t()) =&gt; any()},
  required: [String.t()],
  description: String.t(),
  title: String.t(),
  items: %{required(String.t()) =&gt; any()},
  enum: [any()],
  minimum: float() | nil,
  maximum: float() | nil,
  format: String.t()
}
```

# `tool_repository`

```elixir
@type tool_repository() :: %{
  tools: %{required(String.t()) =&gt; [tool()]},
  providers: %{required(String.t()) =&gt; provider()}
}
```

# `transport`

```elixir
@type transport() :: module()
```

# `udp_provider`

```elixir
@type udp_provider() :: %{
  name: String.t(),
  type: :udp,
  protocol: :udp,
  host: String.t(),
  port: integer(),
  timeout: integer(),
  auth: auth() | nil
}
```

# `variable_not_found`

```elixir
@type variable_not_found() :: %{__exception__: true, variable_name: String.t()}
```

# `webrtc_provider`

```elixir
@type webrtc_provider() :: %{
  name: String.t(),
  type: :webrtc,
  peer_id: String.t() | nil,
  signaling_server: String.t(),
  ice_servers: [map()],
  timeout: integer(),
  tools: [map()]
}
```

# `websocket_provider`

```elixir
@type websocket_provider() :: %{
  name: String.t(),
  type: :websocket,
  url: String.t(),
  protocol: String.t() | nil,
  keep_alive: boolean(),
  auth: auth() | nil,
  headers: %{required(String.t()) =&gt; String.t()},
  header_fields: [String.t()]
}
```

---

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