ToolCall.Doc (ToolCall v0.1.0)

Copy Markdown

Extracts tool descriptions from @doc strings.

@doc is free-form markdown. The first paragraph becomes the tool description; a leading # title is stripped, while a leading level-2+ section heading is omitted and its body is used. Bullets under a ## Parameters heading become per-parameter descriptions, with an optional type annotation such as * city (String.t()) - city name.

@doc """
Get the forecast.

## Parameters
  * `city` - city name
  * `days` - forecast days
"""

Summary

Types

parsed()

@type parsed() :: %{
  description: String.t() | nil,
  params: %{required(String.t()) => String.t()},
  param_order: [String.t()]
}

Functions

parse(text)

@spec parse(nil | false | String.t()) :: parsed()