If the official plug-ins in Alibaba Cloud Model Studio do not meet your business needs, you can create a custom plug-in to extend the capabilities of your large language model (LLM). This document guides you through creating, debugging, and using plug-ins to integrate your required APIs.
Workflow
Create a plugin: Define the basic information for the plugin.
Add a tool: Configure the API path, request parameters, and response data for the plugin.
Debug and publish: Test the API connectivity online and publish the tool after you confirm that it works correctly.
Use in an application: Associate the plug-in with an agent and call it through conversational testing or API integration.
Create a custom plug-in
Create a custom-developed plug-in
Step 1: Create a plug-in
Go to the Plug-ins page and click Create Plug-in.

Enter the plug-in information.

Plug-in Name: Enter a descriptive name. You can use Chinese and English characters.
Example: Dormitory Agreement Query Tool Test
Plug-in Description: Enter a brief description of the plug-in's features and scenarios. This description helps the LLM determine whether to call the plug-in for the current task. Use natural language for the description.
Example: Queries the content of a specific dormitory agreement entry based on the input numeric index.
Plug-in URL: The endpoint of the plug-in.
Example:https://domitorgreement-plugin-example-icohrkdjxy.cn-beijing.fcapp.run
For the same domain name, different paths are treated as different APIs. These paths correspond to the Tool Path that you configure when you create a tool.
Different tools under the same plug-in use the same domain name. The tool path of each tool corresponds to a separate API.
For example, a plug-in contains two APIs:
Query: https://xxx.com/query
Delete: https://xxx.com/delete
In this example,
https://xxx.comis the Plug-in URL./queryand/deletecorrespond to the Tool Path. This indicates that the plug-in contains two tools.
If authentication is required, turn on the Enable Authentication switch and enter the authentication settings.
After you enter the information, click or click Continue to Add Tool.
Step 2: Create a tool
Enter the tool information, configure input and output parameters, and set advanced configurations.

After you complete the configuration, click Save Draft.
Debug the tool API online to check if it can be called.

Click Test Tool. If authentication is enabled, enter the authentication information and the values of the input parameters, and then click Start Running.
If the run fails, adjust the configuration based on the error message in the Run Result section and test again until the run succeeds.
You can enter the values for the input parameters manually or using code. For complex input parameters, use the Code Editing mode. In the code editor, you can submit the complete input parameters and their corresponding values in JSON format.
After the test succeeds, click Publish. Only tools that are Published can be called in applications.
Use a plug-in
Console
Method 1: In the Tools list, add a published tool to an application.
A tool can be associated only with an Agent Application that is in the same workspace.
In the row that contains the tool, click Add to Application and select the target application.
In the application, you can see that the tool has been successfully added.
You can also add other tools. You can add up to 10 tools. The application decides which tool to call.
Test whether the plug-in works as expected.
No authentication: You can chat with the LLM in the input box to test the plug-in.
User-level or service-level authentication: Before you start a conversation, click
to configure the authentication token to be passed. If you do not leave the current page, you only need to configure it once.If the Passing Method for an input parameter of the tool is set to Business Pass-through, you must click
to configure the variable value to be passed before you start a conversation. If you do not leave the current page, you only need to enter the value once.
After the test is complete, Publish the application.
Method 2: In the Plug-ins list, add the tools under a plug-in to an agent.
Find the target plug-in and click Add to Agent.
A tool can be associated only with an Agent Application that is in the same workspace.
By default, only published tools are added. You can select up to 10 published tools to add to an agent application.
Follow the steps in Method 1 to test the plug-in on the application details page and Publish the application.
Method 3: In Model Studio Applications, add the plug-in tool, test the plug-in, and publish the application.
API
Obtain the tool ID
The tool ID identifies a specific tool. When you call a tool using an API, you must pass the correct tool ID to ensure that the request is correctly identified.
In the Plug-ins list, find the plug-in to which the tool belongs and click View.
Hover the mouse pointer over the
icon next to the tool name.Click the
icon to copy the tool ID.
When you call an application using an API, if a plug-in associated with the application has business pass-through parameters or has user-level authentication enabled, you must pass the authentication information or pass-through parameter information using the
biz_paramsparameter. For more information, see the DashScope API Reference.
Manage custom plug-ins and tools
Error codes
The following table describes common error messages that may occur when you publish a tool.
Error code | Error message | Description |
130040 | The parameter description for xx is missing. | Cause: The description for the xx parameter is missing. Solution: Add the parameter description and publish the tool again. |
130022 | Failed to save the tool information/Check whether the sample parameters are correct. | Possible cause 1: A sub-property of an Object type parameter in the input or output parameters is empty. Solution: Click the Possible cause 2: The request method is GET, but an input parameter is of the Object type. Solution: The GET request method does not support the Object type for input parameters. Select another type. |
icon at the end of the object row to add a sub-property.