> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # parameter > Add a function parameter to the tool definition. [ref-datamap]: /docs/server-sdks/reference/typescript/agents/data-map Add a function parameter to the tool definition. ## **Parameters** **`name`** `string` — required Parameter name. --- **`paramType`** `string` — required JSON schema type for the parameter. * `"string"` -- text value * `"integer"` -- whole number value * `"number"` -- numeric value including decimals * `"boolean"` -- true or false value * `"array"` -- list of values * `"object"` -- nested key-value structure --- **`description`** `string` — required Description of the parameter shown to the AI. --- **`opts`** `object` Optional configuration. --- **`opts.required`** `boolean` Whether this parameter is required. --- **`opts.enum`** `string[]` Optional list of allowed values for this parameter. --- ## **Returns** [`DataMap`][ref-datamap] -- Self for method chaining. ## **Example** ```typescript {6-7} import { DataMap } from '@signalwire/sdk'; const weather = new DataMap('get_weather'); weather .purpose('Get current weather for a city') .parameter('city', 'string', 'City name', { required: true }) .parameter('units', 'string', 'Temperature units', { enum: ['fahrenheit', 'celsius'] }); console.log(weather.toSwaigFunction()); ``` > Add a function parameter to the tool definition.