Helper Functions
Create a DataMap for a straightforward single-endpoint API call with minimal configuration.
Parameters
name
Function name.
url
API endpoint URL. Reads the arguments as ${args.name}.
responseTemplate
Template string for formatting the response; it becomes the webhook’s output.
Reads the response’s fields from the root, such as ${current.temp_f}, and the
arguments as ${input.args.name}.
parameters
Parameter definitions. Keys are parameter names, values are objects with
"type", "description", and optional "required" keys.
method
HTTP method.
headers
HTTP headers, sent as written.
body
JSON request body, set as the webhook’s params, so a tool with a body is sent
as a POST. An empty object is left out.
errorKeys
Keys indicating an error response.
Returns
DataMap — A fully configured DataMap ready for further chaining or conversion.
Create a DataMap for pattern-matching responses without API calls.
Parameters
name
Function name.
patterns
Object mapping test values to [pattern, FunctionResult] tuples.
parameters
Parameter definitions (same format as createSimpleApiTool).
Returns
DataMap — A fully configured DataMap.