Creating Custom Tools for the NetSuite AI Connector Service
By building custom tools, you can automate tasks and extend NetSuite's capabilities. Custom tool scripts let you define the operations a tool can perform and configure it to work with external AI clients that support the Model Context Protocol (MCP). With custom tools, you can build solutions for data retrieval, process automation, and integration with AI clients. This topic outlines the workflow for developing and deploying custom tools using SuiteScript and the SuiteCloud Development Framework (SDF).
You can also find sample implementations of custom tools in the MCP-Sample-Tools directory of the SuiteCloud Project Repository on Oracle Samples GitHub.
Prerequisites for Custom Tools
Before you can start developing custom tools, ensure that you've set up the following prerequisites in your NetSuite account.
|
Required Tools and Features |
Related Help Topic |
|---|---|
|
Enable the necessary features in your NetSuite account:
|
|
|
Set up your preferred SuiteCloud SDK Tools. Choose a supported IDE and set up the appropriate SuiteCloud plug-in or extension. If you prefer a different IDE, you can use the CLI tools from your terminal. |
|
|
Set up a role to be used with the NetSuite AI Connector Service. |
Creating Custom Tools
The following table shows the workflow for creating custom tools in NetSuite:
|
Procedure |
Related Help Topic |
|---|---|
|
Step 1: Create a SuiteCloud project using either a SuiteApp project or an account customization project (ACP). |
|
|
Step 2: Write your custom tool script. Custom tool scripts don't have predefined entry points, so you must define all tool entry points in a single script. |
SuiteScript 2.1 Custom Tool Script Type |
|
Step 3: Define your tools in a JSON schema file.
Important:
The method name and description for each tool help the AI client decide the tool's purpose and when it should be used. |
|
|
Step 4: Create the SDF Object XML for your custom tool script. In the SDF object XML, set the file paths for the script and schema, configure tool exposure for AI clients, and define the permissions required to view the tool in AI clients. |
|
|
Step 5: When your tool is ready, deploy the SuiteCloud project to your NetSuite account. |
- |
|
Step 6: From your AI Client, connect to the NetSuite AI Connector. After integration, your external AI client should list the deployed tools from your NetSuite account. |
|
|
Step 7: Invoke the tools using natural language prompts. |
- |
Viewing and Deleting Custom Tools
You can view the tools available in your NetSuite account by going to Customization > Scripting > Custom Tools. This page displays tools from SuiteApps and ACPs, organized by toolset. You can delete toolsets that are part of ACPs directly from this page by clicking the delete icon for the toolset. For more information, see Managing Custom Tools in NetSuite.
To remove toolsets that are part of SuiteApps, you need to uninstall the SuiteApp. For more information, see Viewing and Uninstalling SDF SuiteApps in a NetSuite Account.