# `ExMCP.Server.Tools.ResponseNormalizer`
[🔗](https://github.com/azmaveth/ex_mcp/blob/v1.0.0/lib/ex_mcp/server/tools/response_normalizer.ex#L1)

Normalizes tool responses to comply with MCP specification.

> #### Deprecated {: .warning}
>
> Part of the deprecated `ExMCP.Server.Tools` API. **Planned for removal in 2.0.0.**
> Prefer `ExMCP.Server.DSL.Result` normalization used by `ExMCP.Server.DSL`.

This module extracts the response normalization logic from the original
Server.Tools module into a focused, testable unit.

# `normalize`

```elixir
@spec normalize(any()) :: map()
```

Normalizes various response formats into MCP-compliant structure.

## Examples

    # String response
    normalize("Hello") 
    # => %{content: [%{type: "text", text: "Hello"}]}
    
    # Map with text key
    normalize(%{text: "Hello"})
    # => %{content: [%{type: "text", text: "Hello"}]}
    
    # Already normalized
    normalize(%{content: [%{type: "text", text: "Hello"}]})
    # => %{content: [%{type: "text", text: "Hello"}]}

# `normalize_error`

```elixir
@spec normalize_error(any()) :: map()
```

Normalizes error responses.

---

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