LocalizeMcp. Tools. Options
(Localize MCP v0.1.0)
View Source
Implementation of the localize_options tool.
Returns the accepted options for a formatter function with their
types, allowed values, defaults, and descriptions. Backed by
curated metadata files at priv/mcp/options/<module>.exs — each
file evaluates to a map from {function_name, arity} to a list
of option specs.
Each option spec has the shape:
%{
name: :locale,
type: "atom() | String.t() | Localize.LanguageTag.t()",
allowed_values: nil, # or a list of atoms / strings
default: ":en",
description: "The locale to format under."
}When no metadata file exists for a module the tool returns the
raw @spec lifted via Code.fetch_docs/1 so the caller still
gets a useful answer — just with allowed_values: nil
everywhere. Manually curated entries take precedence.