Free trial

Free trial

Information

Solutions

Sep 24, 2025
20
min read
Author
陶滨江

CEO

Tool Invocation — Configure Custom MCP Tools for 3Chat Agent

Tool Invocation — Configure Custom MCP Tools for 3Chat Agent

Tool Invocation — Configure Custom MCP Tools for 3Chat Agent

Solutions

3chat-agent-mcp

Sep 24, 2025

Sep 24, 2025

Sep 24, 2025

Sep 24, 2025

The defined MCP tool can connect your company's external systems' real-time data or operational capabilities (such as order systems, CRM, ERP, member platforms, etc.) to the 3Chat Agent. These capabilities can drive 3Chat to execute "Intelligent Marketing SOP" in the pre-sales stage—actively guiding leads and conversions; in the post-sales stage, it transforms into a "Business Expert"—precisely executing actions such as refunds, rescheduling, and points distribution, significantly enhancing customer retention and repurchase rates.

💡Getting Started Suggestions

In traditional customer service scenarios, customer service representatives or sales teams are often asked some inquiries to assist customers in handling complex issues, such as:

  • "Where is my order now?"

  • "Can you help me change the shipping address?"

  • "I have 500 points; what can I exchange for?"

  • "Help me cancel my appointment for tomorrow"

These questions often require calling external system data or triggering business operations. A simple Q&A bot cannot only rely on a knowledge base to answer questions that have high effectiveness requirements. After transferring to human help, personnel also need to consult many platforms to resolve a single customer's inquiry, which is time-consuming and labor-intensive.

To address the above challenges, by connecting the custom MCP tool, 3Chat Agent can fully understand customer needs and automatically accomplish these operations without human intervention.

🧭Navigation Guidance

After logging into the 3Chat backend, you can configure the MCP tool through the following path: 3Chat Agent > MCP > Tool Invocation

⚙️Quick Operation Guidance

Pre-Preparation Work

  1. Think about which business operations and which external data you need 3Chat Agent to assist customers with - Open Interface (OpenApi).

  2. Ensure the execution performance of the external open interface provided for 3Chat Agent. The default timeout is 60 seconds. If this time is exceeded, 3Chat Agent will consider the request as timed out.

To ensure that the 3Chat Agent can safely and reliably invoke the external open interface, you need to log in to the corresponding external system and obtain valid access authentication authorization. For specific operations, refer to: Create external system authentication authorization (Token).

Configure Custom MCP Tool

For example, to obtain order logistics information from Shopify

First, follow the navigation guidance, enter the tool invocation page via [3Chat Agent] - [MCP] - [Tool Invocation]. Click to add an operation at the top right of the tool list to enter the tool configuration page.

Step 1: Fill in the basic information of the tool

You need to define the name of the tool. Provide a description of the tool, indicating its purpose and when the 3Chat Agent should use this tool.

getOrderDetail
使用此工具调取客户订单的详细信息。该工具提供客户的所有订单的详情,包括订单状态,发货状态,购买的商品,收货地址等信息。
👍Tool Description Suggestions - Be Clear Enough

Clearly state when to use this tool and the detailed information it should provide

  • Recommended Example: Use this tool to obtain detailed information about customer orders; the information obtained can help troubleshoot order-related issues. The tool will provide all order details for the customer, such as order status, purchased products, shipping address, logistics tracking information, or other relevant order information.

  • Not Recommended Example: Use this data connector to obtain order information.

👍Tool Description Suggestions - Avoid Using Pronouns

Avoid using pronouns like "we," "they," etc. Instead, replace them with clear proper nouns, such as the company name or the name of the external platform.

  • Recommended Example: Use this tool to obtain all order information for customers in the Shopify store 3Chat.

  • Not Recommended Example: Use this tool to get order information for customers in our store.

👍Tool Description Suggestions - Be Specific About Scenarios

Describe the situation for using the tool

  • Recommended Example: Use this tool to query unresolved issues, such as a customer wanting to know the processing status of their problem, whether it has been resolved, and if the system's performance can be restored after processing.

  • Not Recommended Example: Use this tool to query unresolved issues.

👍Tool Description Suggestions - Appropriately Provide Common Phrases Used by Customers

Refer to the ways customers have expressed problems in past conversations and include their commonly used keywords and phrases in the description.

Step 2: Configure Request Information

  • Fill in your external system interface address; to ensure data security, we will enforce you to use an HTTPS address. Select the correct tool execution method. Currently, GET, POST, PUT, and DELETE are supported.

Based on the requirements of the HTTPS interface address you filled in, select an already filled authentication authorization. The selected authentication token will have the parameter name Authentication added by default when processing Headers.

  • Define the data information that 3Chat Agent needs to collect before using the tool; all parameters defined here need to be used in the HTTPS request address or the request body. The specific syntax is "{{data_name}}". Where:

    • Parameters that do not have complete naming, data type, and parameter description will display "Undefined" in the status column, reminding you to complete filling.

    • If 3 parameters are completely filled but not used in the request address or request body, it will show "Unused" in the status column, reminding you to use this parameter.

    • Only when all data statuses are "Used" and the request body is in legal JSON format, will it allow execution of the next operation.

    • If the tool doesn’t require any information to be collected for 3Chat Agent to use, parameters do not need to be defined.

email,字符串,客户邮箱
  • Add necessary request header parameters; if the authentication token required by the HTTPS interface needs to specify parameters other than "Authentication," you can fill them in the request header parameters.

The following token is for testing purposes only and may expire at any time; it is recommended to generate your own token.

Content-Type:application/json
X-Shopify-Access-Token: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
  • Fill in a JSON-formatted request body; in the request body, you can assign values to define each parameter in the HTTPS interface request body. Support for specifying already defined collection parameters, default values, or the main data standard fields and custom fields of 3Chat, such as "Contact Person," etc.

{
  "query": "query OrdersByEmail($q: String!) { orders(first: 50, query: $q, sortKey: CREATED_AT, reverse: true) { edges { node { id name createdAt email displayFulfillmentStatus fulfillments(first: 10) { id status displayStatus createdAt inTransitAt deliveredAt trackingInfo { company number url } } } } pageInfo { hasNextPage endCursor } } }",
  "variables": {
    "q": "email:'{{email}}'"

  • When both of the following conditions are met, you can perform the next operation: Response testing

  • Collection parameters that are not specified or defined have been used

  • The request body is in legal JSON format

Step 3: Response Testing

Response testing is used to help users verify whether the request configuration is correct, providing both real-time response and example response methods:
The first method: Real-time response. Suitable for existing mature HTTPS interfaces, obtaining the actual response structure through actual interface requests
The second method: Example response. Suitable for HTTPS interfaces under development, where you can complete tool configuration and synchronize test validation with the interface.

3.1 Real-time Response Method

If there are specified collection parameters or main data variables in the request body or HTTPS request address, you need to specify parameter values before performing interface testing operations. After completing the parameter assignment, click on the interface testing operation to obtain the interface return structure. It is important to note: interface testing will execute the real interface; before testing, please ensure the data accessed by the interface is test data to avoid impacting your real business data.

Example parameters:

email:zhang.zhiyu@xinheyun.com

Return value:

{
  "data": {
    "orders": {
      "edges": [
        {
          "node": {
            "id": "gid://shopify/Order/10194884526372",
            "name": "#1001",
            "createdAt": "2025-09-24T03:45:45Z",
            "email": "zhang.zhiyu@xinheyun.com",
            "displayFulfillmentStatus": "PARTIALLY_FULFILLED",
            "fulfillments": [
              {
                "id": "gid://shopify/Fulfillment/5867516100900",
                "status": "SUCCESS",
                "displayStatus": "FULFILLED",
                "createdAt": "2025-09-24T05:54:15Z",
                "inTransitAt": null,
                "deliveredAt": null,
                "trackingInfo": [
                  {
                    "company": "SF Express",
                    "number": "SF3237923216655",
                    "url": "https://www.sf-express.com/we/ow/chn/en/waybill/waybill-detail/SF3237923216655"
                  }
                ]
              },
              {
                "id": "gid://shopify/Fulfillment/5867458003236",
                "status": "CANCELLED",
                "displayStatus": "CANCELED",
                "createdAt": "2025-09-24T04:23:45Z",
                "inTransitAt": null,
                "deliveredAt": null,
                "trackingInfo": [
                  {
                    "company": "SF Express",
                    "number": "SF0288599313823",
                    "url": "https://www.sf-express.com/we/ow/chn/en/waybill/waybill-detail/SF0288599313823"
                  }
                ]
              },
              {
                "id": "gid://shopify/Fulfillment/5867455840548",
                "status": "CANCELLED",
                "displayStatus": "CANCELED",
                "createdAt": "2025-09-24T04:19:06Z",
                "inTransitAt": null,
                "deliveredAt": null,
                "trackingInfo": [
                  {
                    "company": "Amazon Logistics",
                    "number": "188888111",
                    "url": "https://track.amazon.com/tracking/188888111"
                  }
                ]
              }
            ]
          }
        }
      ],
      "pageInfo": {
        "hasNextPage": false,
        "endCursor": "eyJsYXN0X2lkIjoxMDE5NDg4NDUyNjM3MiwibGFzdF92YWx1ZSI6MTc1ODY4NTU0NTAwMH0="
      }
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 23,
      "actualQueryCost": 5,
      "throttleStatus": {
        "maximumAvailable": 2000,
        "currentlyAvailable": 1995,
        "restoreRate": 100
      }
    }
  }
}

3.2 Example Response Method

You can directly fill in the JSON structure of the response body; please ensure that the syntax you fill in is correct.

When the JSON format syntax in the response example is correct, you can proceed to the next step: Response Data Mapping

Step 4: Response Data Mapping

This step is used to configure the parameter mapping in the response structure and the accessibility of the 3Chat Agent.

  1. When the interface testing is completed, or the response structure is manually filled, all response parameters' structures from the response body JSON structure are automatically extracted to create a response parameter list. The parameter names retain the original nesting levels from the response body.

  2. Configure transformation rules for the response parameters as needed: at the end of the data row, click the Edit button to enter the configuration window.

Mapping Example 1: trackingInfo.company

Mapping Example 2: trackingInfo.number

Response parameter name: The parameter name (Key) of the response parameter retains the hierarchy from the original JSON structure.

  • Example response value: The response parameter value obtained from the response body structure.

  • Mapping parameter name: The parameter name visible to the 3Chat Agent, with the default value being the original response parameter name.

  • Data type: The data type visible to the 3Chat Agent, with the default value being the original response parameter type. Parameter type conversion can be specified depending on the actual situation.

  • Accessible: Indicates whether this response parameter is visible to the 3Chat Agent.

The results after mapping modifications are shown in the table below

Before Mapping

After Mapping

👍Recommendations for Configuring Parameter Conversion

Suggestions

When the naming of response parameters cannot accurately express the meaning of the field, it can be changed to business-friendly parameter names. For example: "abc" : "O-250823-001", expressing order number, it is recommended to specify the mapping parameter name as "orderCode".

Response Parameter Value Conversion String When response parameter values express certain statuses through numbers or business-unfriendly strings, the 3Chat Agent cannot deduce specific status descriptions from numbers. For example: order status: "orderStatus" : 5, needs to specify 5 = "Shipped". "orderStatus" : "SHIP", needs to specify SHIP = "Shipped".

When response parameters express specific times through timestamp format, the 3Chat Agent cannot obtain the actual time by reading the timestamp. It is necessary to specify the conversion type as Datetime, transforming the timestamp into a standard UTC time.

Save and Run the Tool

Once the above configuration is complete, click to save data and run this tool; the 3Chat Agent can use this tool to handle customer inquiries in a production environment. When the tool is not needed to be accessed by the 3Chat Agent, simply suspend or stop this tool.

Let 3Chat Agent Execute Tool Invocations in AI Tasks

By connecting the MCP (Model Context Protocol) standard protocol, the 3Chat Agent can flexibly call created and running tools. You only need to use the AI Task [3Chat AI Task Function Introduction] feature to clearly tell the 3Chat Agent when to "reach out" and do what.

In the execution steps of the AI Task, you need to describe the business process rules and provide the 3Chat Agent with two pieces of information:

  • Conditions (when to do what);

当用户询问订单发货状态时
  • Actions (which specific MCP tool to use)

如果用户输入或上下文中有邮箱  调用 {{tool.update.visitor.email}} 记录邮箱
如果没有,则礼貌性的询问“您的email是多少?方便我查询订单状态”
如果{{var.visitor.email}}不为空,则调用工具getOrderDetail。从返回值中,找到‘物流公司’和‘物流单号’,返回给用户。

We named this task "Return Order Logistics Information".

Acceptance of Results

  1. When users inquire about where the order is, trigger the AI task, i.e., "Return Order Logistics Information";

  2. Since the AI task did not recognize the email, it actively asks the user;

  3. After the user replies with the email, the Agent calls the MCP tool, successfully returning the logistics information.


Contact us!

Contact us!

Contact us!

Address

Building A6, 10th Floor, No. 1528, Gumei Road, Xuhui District
Headquarters · Shanghai

Branches · Singapore · Guangzhou · Chengdu · Hangzhou · Hefei · Nanjing · Shijiazhuang

© 2025, 3Chat.ai. All rights reserved. NEW CORE TECH CO., PTE. LTD. ICP License No. 沪ICP备18014720号-10 (3chatai.cn) | 沪ICP备18014720号-11 (3chatai.com)

© 2025, 3Chat.ai. All rights reserved. NEW CORE TECH CO., PTE. LTD. ICP License No. 沪ICP备18014720号-10 (3chatai.cn) | 沪ICP备18014720号-11 (3chatai.com)

© 2025, 3Chat.ai. All rights reserved. NEW CORE TECH CO., PTE. LTD. ICP License No. 沪ICP备18014720号-10 (3chatai.cn) | 沪ICP备18014720号-11 (3chatai.com)

© 2025, 3Chat (a product of NEW CORE TECH CO., PTE. LTD.). All rights reserved. NEW CORE TECH CO., PTE. LTD. | 143 Cecil Street, GB Building, #03-01, Singapore 069542, Singapore

上海纽酷信息科技有限公司 沪ICP备18014720号-10 (3chat.ai) | 沪ICP备18014720号-11 (3chat.ai)

© 2025, 3Chat (a product of NEW CORE TECH CO., PTE. LTD.). All rights reserved. NEW CORE TECH CO., PTE. LTD. | 143 Cecil Street, GB Building, #03-01, Singapore 069542, Singapore

上海纽酷信息科技有限公司 沪ICP备18014720号-10 (3chat.ai) | 沪ICP备18014720号-11 (3chat.ai)

© 2025, 3Chat (a product of NEW CORE TECH CO., PTE. LTD.). All rights reserved. NEW CORE TECH CO., PTE. LTD. | 143 Cecil Street, GB Building, #03-01, Singapore 069542, Singapore

上海纽酷信息科技有限公司 沪ICP备18014720号-10 (3chat.ai) | 沪ICP备18014720号-11 (3chat.ai)