return

Returns from the current function with a value.

Value

FieldTypeDefaultDescription
rootrequiredJSON value

Example

"return": "{ {'name': row['name'], 'total': row['amount'] * 1.2} }"

Rules

  • The value may be any JSON value. A string in braces is evaluated first.
  • Returning from main ends the agent successfully. The returned value is what an invoke command in another agent receives as its result. The user sees only what the agent wrote with output.
  • A function used as an LLM tool should return a dict. The dict is sent to the model as JSON; any other value is sent as text.
  • return leaves every loop the command is inside.