AgentsDataMap

parameter

View as MarkdownOpen in Claude

Add a function parameter to the tool definition.

Parameters

name
strRequired

Parameter name.

param_type
strRequired

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
strRequired

Description of the parameter shown to the AI.

required
boolDefaults to false

Whether this parameter is required.

enum
list[str]

Optional list of allowed values for this parameter.

Returns

DataMap — Self for method chaining.

Example

1from signalwire import DataMap
2
3weather = (
4 DataMap("get_weather")
5 .purpose("Get current weather for a city")
6 .parameter("city", "string", "City name", required=True)
7 .parameter("units", "string", "Temperature units", enum=["fahrenheit", "celsius"])
8)
9
10print(weather.to_swaig_function())
11# {'function': 'get_weather', 'parameters': {'type': 'object', 'properties': {'city': ..., 'units': ...}, 'required': ['city']}, ...}