Functions

Functions let the agent perform API-driven, promptless tasks. They are defined by developers in code, but managed in the Agent Studio UI for versioning, publishing, testing, and observability.


Creating a Function

  1. Go to Agent Studio → Actions → Create → Function.
  2. Enter the details for the new Function:
  • Enabled Toggle to enable or disable this Function. Only enabled Functions can be called.

  • API name A unique identifier used by developers when calling this Function in code. Example: meeting.summary or generate.report.

  • Description Short explanation of what the Function does (visible to your team). Example: Summarizes a meeting transcript and extracts action items.

  • Instructions Guidance for the AI agent about how this Function should behave. Example: Summarize the transcript in 3–5 bullet points and extract clear action items.


Defining Output

Switch to the Output tab to specify what the Function should return.

Use the schema editor

  • Example output schema:
    {
      "type": "object",
      "title": "MockActionResponse",
      "required": [
        "status",
        "statusCode",
        "message",
        "responseBody"
      ],
      "properties": {
        "status": {
          "enum": [
            "success",
            "error"
          ],
          "type": "string",
          "description": "Indicates the high-level outcome of the mocked action call. 'success' for a successful operation, 'error' for a failure."
        },
        "message": {
          "type": "string",
          "description": "A human-readable message summarizing the result of the action, e.g., 'Ticket created successfully.'"
        },
        "statusCode": {
          "type": "number",
          "description": "A standard HTTP-like status code to provide a machine-readable outcome. e.g., 201 for successful creation, 200 for success, 400 for a bad request."
        },
        "responseBody": {
          "type": "string",
          "description": "A String of a JSON object containing the detailed body of the mock response. The structure of this object is dynamic and will be inferred by the LLM to realistically match what the original action (e.g., 'create_jira_ticket') would return."
        }
      },
      "description": "The standardized output for a generated mock API response. It contains a status, message, and a dynamic response body.",
      "additionalProperties": false
    }

Next Steps

Implementing Functions