# `PtcRunner.SubAgent.Namespace.Tool`
[🔗](https://github.com/andreasronge/ptc_runner/blob/main/lib/ptc_runner/sub_agent/namespace/tool.ex#L1)

Renders available tools for the USER message namespace section.

# `render`

```elixir
@spec render(map()) :: String.t()
```

Render tools section for USER message.

Returns a formatted string showing available tools or a message indicating
no tools are available. When tools exist, shows header and entries with
tool calling syntax, parameters, and return type.

Tools are called using `tool/` prefix: `(tool/tool-name {:param value})`

Accepts raw tool formats (fn, {fn, sig}, {fn, opts}) and normalizes them.

## Examples

    iex> PtcRunner.SubAgent.Namespace.Tool.render(%{})
    ";; No tools available"

    iex> tool = %PtcRunner.Tool{name: "get-inventory", signature: "-> :map"}
    iex> PtcRunner.SubAgent.Namespace.Tool.render(%{"get-inventory" => tool})
    ";; === tools ===\ntool/get-inventory() -> map\n;; Call with named args: (tool/name {:key value})"

    iex> tool = %PtcRunner.Tool{name: "search", signature: "(query :string, limit :int) -> [:string]"}
    iex> PtcRunner.SubAgent.Namespace.Tool.render(%{"search" => tool})
    ";; === tools ===\ntool/search(query string, limit int) -> [string]\n;; Example: (tool/search {:query ... :limit ...})"

    iex> tool = %PtcRunner.Tool{name: "analyze", signature: "-> :map", description: "Analyze data"}
    iex> PtcRunner.SubAgent.Namespace.Tool.render(%{"analyze" => tool})
    ";; === tools ===\ntool/analyze() -> map  ; Analyze data\n;; Call with named args: (tool/name {:key value})"

---

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