Skip to content

Commit 6370e77

Browse files
feat: add condition to check if toolName is passed in createAction()
1 parent 06d9e46 commit 6370e77

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

js/src/sdk/actionRegistry.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,16 @@ export class ActionRegistry {
8181
if (!options.actionName) {
8282
throw new Error("You must provide actionName for this action");
8383
}
84+
if (!options.toolName) {
85+
throw CEG.getCustomError(
86+
COMPOSIO_SDK_ERROR_CODES.COMMON.INVALID_PARAMS_PASSED,
87+
{
88+
message: "Tool name is required",
89+
description:
90+
"Please provide a toolName when creating a custom action",
91+
}
92+
);
93+
}
8494
if (!options.inputParams) {
8595
options.inputParams = z.object({}) as P;
8696
}

0 commit comments

Comments
 (0)