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 tool. 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. |
— |
To undeploy a custom tool:
-
If it's part of a SuiteApp, uninstall the SuiteApp.
-
If it's part of an ACP, set the
exposeto3rdpartyagents
attribute to F in the custom tool SDF Object XML, then redeploy the project.