ToolCall Object Members in SuiteScript 2.1 Reference
The ToolCall object in SuiteScript 2.1 manages tool requests, including parameters and error handling for server scripts.
TL;DR
The ToolCall object in SuiteScript 2.1 enables server scripts to manage tool requests, including specifying tools and their parameters. Understanding its members is crucial for developers implementing tool functionality.
What Is the ToolCall Object?
The ToolCall object relates to the handling of tool requests within SuiteScript 2.1, specifically designed for server scripts. It includes essential properties that identify the tool being requested and the parameters required for its execution.
ToolCall Object Members Overview
Below are the key members of the ToolCall object that developers should be aware of:
| Member Name | Type | Return Type / Value Type | Supported Script Types |
|---|---|---|---|
| ToolCall.name | Property | string | Server scripts |
| ToolCall.parameters | Property | llm.ToolParameter[] | Server scripts |
Property Details
ToolCall.name
- Type:
string - Description: This property holds the name of the requested tool in the LLM tool call.
- Supported Script Types: This property is relevant in server scripts.
ToolCall.parameters
- Type:
llm.ToolParameter[] - Description: It contains the required parameters for the tool in the LLM tool call.
- Supported Script Types: It is utilized in server scripts.
Error Handling
Developers may encounter the following error when working with the ToolCall object:
- Error Code:
READ_ONLY- Thrown If: There is an attempt to set a property on this object.
Example Syntax
Here is a syntax example that illustrates the use of the ToolCall object's properties, though it's not a fully functional script. For a more complete script, refer to the N/llm Module Script Samples.
1// Example of generating text with tool calls2const result = llm.generateText({3 prompt: "Write a 200 word pitch for a TV show about bears.",4 modelFamily: llm.ModelFamily.COHERE_COMMAND,5 tools: myTools6});7 8const firstToolCallName = result.toolCalls[0].name;9const firstToolCallParameters = result.toolCalls[0].parameters;Who This Affects
- Developers: Those creating server scripts that utilize the ToolCall object for tool management.
- Administrators: Individuals responsible for maintaining and configuring SuiteScript environments.
Key Takeaways
- The ToolCall object is essential for managing tool requests in SuiteScript 2.1.
- It includes properties for tool names and parameters relevant to server scripts.
- Error handling is simplified with a clear understanding of the read-only nature of certain properties.
Frequently Asked Questions (4)
What script types support the use of the ToolCall object in SuiteScript 2.1?
Is it possible to modify properties of the ToolCall object in SuiteScript 2.1?
What is the purpose of the ToolCall.name property in the ToolCall object?
How are tool parameters specified in the ToolCall object?
Was this article helpful?
More in AI
- Prompt Studio: Generative AI Management in NetSuite 2026.1
Prompt Studio in NetSuite 2026.1 enhances generative AI management, enabling customization of prompts and Text Enhance actions.
- SuiteCloud Agent Skills for AI Development in NetSuite 2026.1
SuiteCloud Agent Skills enhance development workflows with AI-driven guidance in NetSuite 2026.1, improving automation and process standardization.
- N/llm Module: Usage Limits and Additional Requests in NetSuite
In NetSuite 2026.1, the N/llm module sets usage limits and options for additional requests via Oracle Cloud.
- Required Features and Permissions for NetSuite AI Connector
Ensure Server SuiteScript and OAuth 2.0 are enabled for secure usage of the NetSuite AI Connector Service.
Advertising
Reach AI Professionals
Put your product in front of NetSuite experts who work with AI every day.
Sponsor This Category