***

title: parameter
slug: /reference/python/agents/data-map/parameter
description: Add a function parameter to the tool definition.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

[ref-datamap]: /docs/server-sdks/reference/python/agents/data-map

Add a function parameter to the tool definition.

## **Parameters**

<ParamField path="name" type="str" required={true} toc={true}>
  Parameter name.
</ParamField>

<ParamField path="param_type" type="str" required={true} toc={true}>
  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
</ParamField>

<ParamField path="description" type="str" required={true} toc={true}>
  Description of the parameter shown to the AI.
</ParamField>

<ParamField path="required" type="bool" default="false" toc={true}>
  Whether this parameter is required.
</ParamField>

<ParamField path="enum" type="list[str]" toc={true}>
  Optional list of allowed values for this parameter.
</ParamField>

## **Returns**

[`DataMap`][ref-datamap] -- Self for method chaining.

## **Example**

```python {6-7}
from signalwire import DataMap

weather = (
    DataMap("get_weather")
    .purpose("Get current weather for a city")
    .parameter("city", "string", "City name", required=True)
    .parameter("units", "string", "Temperature units", enum=["fahrenheit", "celsius"])
)

print(weather.to_swaig_function())
# {'function': 'get_weather', 'parameters': {'type': 'object', 'properties': {'city': ..., 'units': ...}, 'required': ['city']}, ...}
```