normalizeToolValues
normalizeToolValues(
spec,raw):Record<string,ToolValue>
Turns whatever values arrived from the host into exactly what ToolValues
promises: every declared field present and of its type, nothing else. A missing or
mistyped value falls back to the field’s default, then to empty ("", 0 or
min, false, the first option, []). Numbers are clamped to min/max.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
spec |
Pick<ToolSpec, "fields"> |
raw |
unknown |
Returns
Section titled “Returns”Record<string, ToolValue>