---
schema_version: "1"
id: d22bf32c2e6673f503c7eacac6b55ef514b93c578d1060e0b7a5f888e2af9358
title: Configuring Agent Operations
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/mulesoft-ai-chain-connector/1.0/configuring-agent-operations.md
canonical_url: https://docs.mulesoft.com/mulesoft-ai-chain-connector/1.0/configuring-agent-operations
source_site: docs.mulesoft.com
content_type: documentation
content_hash: f1ebad226aa631eab61ecf7b05522851b53a326c0e42d270d5c7f691e290479a
description: MuleSoft Documentation Site
release: "1.0"
latest: false
---
---
product: MuleSoft AI Chain Connector
version: 1.0
---

# Configuring Agent Operations

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Support for MuleSoft AI Chain Connector 1.0 ends on October 30, 2026. Use one of the other available
[MuleSoft AI connectors](https://docs.mulesoft.com/general/learning-map-mulesoft-ai) based on your requirements.

## Configure the Agent Define Prompt Template Operation

Use the **Agent define prompt template** operation to use specific prompt templates with your LLMs.
This allows you to create natural language prompts that generate responses, extract information,
invoke other prompts, or perform any text-based task.

To configure the **Agent define prompt template** operation:

1.  Select the operation on the Anypoint Code Builder or Studio canvas.

2.  In the **General** properties tab for the operation, enter these values:

    - **Dataset**

      Specify the dataset for the LLM to evaluate using the provided template and instructions.

    - **Template**

      Enter the prompt template for the operation.

    - **Instructions**

      Provide the instructions for the LLM, outlining the goals of the task. This is the XML for
      this operation:

<ms-chainai:agent-define-prompt-template doc:name="Agent define prompt template"
doc:id="f1c29c39-eac9-468c-9c46-4109a66303ec" config-ref="MuleChain\_AI\_Llm\_configuration"
template="#\[payload.template\]" instructions="#\[payload.instructions\]"
dataset="#\[payload.dataset\]" />

This image shows an example of the configuration for the Agent define prompt template action in
Anypoint Code Builder:
![Anypoint Code Builder canvas with Agent define prompt template highlighted, configuration attributes filled in, and the XML code for the configured action](/mulesoft/current/en-us/mulesoft-ai-chain-connector/1.0/_images/agent-define-prompt-config-acb.png)

### Output Configuration

This operation responds with a JSON payload containing the main LLM response. Additionally,
attributes such as token usage are included as part of the metadata (attributes) but not within the
main payload.

This is an example response:

```json
{
  "response": "{\n  \"type\": \"positive\",\n  \"response\": \"Thank you for your positive feedback on the training last week. We are glad to hear that you had a great experience. Have a nice day!\"\n}"
}
```

The operation also returns attributes that aren’t within the main JSON payload, which include
information about token usage, for example:

```json
{
  "tokenUsage": {
    "outputCount": 9,
    "totalCount": 18,
    "inputCount": 9
  },
  "additionalAttributes": {}
}
```

- `tokenUsage`

  Token usage metadata returned as attributes

- `outputCount`

  Number of tokens used to generate the output

- `totalCount`

  Total number of tokens used for input and output

- `inputCount`

  Number of tokens used to process the input

## See Also

- [Using Anypoint Code Builder to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-acb)

- [Using Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio)

- [MuleSoft AI Chain Connector Reference](https://docs.mulesoft.com/mulesoft-ai-chain-connector/1.0/mulesoft-ai-chain-connector-reference)

- [MuleSoft AI Chain - Additional Configuration Information](https://docs.mulesoft.com/mulesoft-ai-chain-connector/1.0/mulesoft-ai-chain-additional-config)

- [Salesforce Help](https://help.salesforce.com)
