English
callTool
About 337 wordsAbout 1 min
2026-09-04
This method is used to call the Operation Center. Pass the tool path through commandPath, business parameters through data, and optional settings through options. The method returns a Promise.
Syntax: FxUI.biz.callTool(commandPath, data, options)
Parameters
| Parameter | Description | Type | Allowed Values | Default |
|---|---|---|---|---|
| commandPath | Action path (required) | Array | — | — |
| data | Business data passed to the tool (required) | Object | — | — |
| options | Additional options | Object | — | { raw: true } |
options
| Parameter | Description | Type | Allowed Values | Default |
|---|---|---|---|---|
| raw | Whether to use raw return mode | boolean | true, false | true |
Example
import FxUI from 'fxui-mobile';
const commandPath = ['approval', 'runtime', 'my-approval-tasks'];
const data = {};
FxUI.biz.callTool(commandPath, data, { raw: true }).then((res) => {
if (res.success) {
console.log(res.data);
} else {
console.log(res.error);
}
});You can omit the third parameter. In that case, the default options are used:
import FxUI from 'fxui-mobile';
const commandPath = ['approval', 'runtime', 'my-approval-tasks'];
const data = {};
FxUI.biz.callTool(commandPath, data).then((res) => {
console.log(res);
});Return Value
Returns a Promise with the following structure on success:
{
success: true,
data: {}
}On failure:
{
success: false,
error: {}
}Operation Library
All available operations (commandPath and the corresponding data field structure) are maintained in the Operation Center and can be looked up at:
https://www.fxiaoke.com/XV/UI/manage#aigcactionmanagement
Mapping from Operation Library to callTool
Each entry in the Operation Center includes a full CLI call path in the format:
<binary> <sub1> <sub2> ... [--data '{…}']Rules for converting it to callTool parameters:
- Drop the binary name (e.g.
sharecrm) - Split the remaining parts by whitespace to form the
commandPatharray - The content of
--data '{…}'becomes thedataparameter
Example: the CLI path in the operation library is
sharecrm data record query-by-fields --data '{"objectApiName":"Account__C"}'The equivalent callTool call:
import FxUI from 'fxui-mobile';
FxUI.biz.callTool(
['data', 'record', 'query-by-fields'],
{ objectApiName: 'Account__C' }
);Notes
- The specific value of
commandPathand the structure ofdatashould follow the corresponding entry in the Operation Library. rawdefaults totrueand does not normally need to be changed.
