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

Advanced search functionality for UTCP tools and providers.

Provides multiple search algorithms including:
- Exact matching
- Fuzzy search with similarity scoring
- Semantic search based on descriptions
- Tag-based filtering
- Provider-based filtering
- Transport-based filtering

# `search_options`

```elixir
@type search_options() :: %{
  algorithm: :exact | :fuzzy | :semantic | :combined,
  filters: %{providers: [String.t()], transports: [atom()], tags: [String.t()]},
  limit: integer(),
  threshold: float(),
  include_descriptions: boolean(),
  use_haystack: boolean(),
  security_scan: boolean(),
  filter_sensitive: boolean()
}
```

# `search_result`

```elixir
@type search_result() :: %{
  tool: ExUtcp.Types.tool(),
  score: float(),
  match_type: :exact | :fuzzy | :semantic,
  matched_fields: [String.t()],
  security_warnings: [map()]
}
```

# `get_suggestions`

```elixir
@spec get_suggestions(ExUtcp.Search.Engine.t(), String.t(), keyword()) :: [String.t()]
```

Gets search suggestions based on partial query.

# `new`

```elixir
@spec new(keyword()) :: ExUtcp.Search.Engine.t()
```

Creates a new search engine with default configuration.

# `search_providers`

```elixir
@spec search_providers(ExUtcp.Search.Engine.t(), String.t()) :: [map()]
```

Searches for providers using the specified query and options.

# `search_providers`

```elixir
@spec search_providers(ExUtcp.Search.Engine.t(), String.t(), map()) :: [map()]
```

# `search_tools`

```elixir
@spec search_tools(ExUtcp.Search.Engine.t(), String.t()) :: [search_result()]
```

Searches for tools using the specified query and options.

# `search_tools`

```elixir
@spec search_tools(ExUtcp.Search.Engine.t(), String.t(), map()) :: [search_result()]
```

# `suggest_similar_tools`

```elixir
@spec suggest_similar_tools(ExUtcp.Search.Engine.t(), ExUtcp.Types.tool(), keyword()) ::
  [
    search_result()
  ]
```

Suggests similar tools based on a given tool.

---

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