From daa427551f796e2def5e8b59080b87025206eab1 Mon Sep 17 00:00:00 2001 From: waleed Date: Wed, 21 Jan 2026 17:00:20 -0800 Subject: [PATCH 1/2] fix(custom-tools): remove unsafe title fallback in getCustomTool --- apps/sim/hooks/queries/custom-tools.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/sim/hooks/queries/custom-tools.ts b/apps/sim/hooks/queries/custom-tools.ts index c86333e143..3fdf8572e7 100644 --- a/apps/sim/hooks/queries/custom-tools.ts +++ b/apps/sim/hooks/queries/custom-tools.ts @@ -118,7 +118,7 @@ export function getCustomTool( workspaceId?: string ): CustomToolDefinition | undefined { const tools = getCustomTools(workspaceId) - return tools.find((tool) => tool.id === toolId) || tools.find((tool) => tool.title === toolId) + return tools.find((tool) => tool.id === toolId) } /** From d99872013a3f0e7ed2290a562195debeef882ca9 Mon Sep 17 00:00:00 2001 From: waleed Date: Wed, 21 Jan 2026 17:25:35 -0800 Subject: [PATCH 2/2] fix(custom-tools): restore title fallback in getCustomTool lookup Custom tools are referenced by title (custom_${title}), not database ID. The title fallback is required for client-side tool resolution to work. --- apps/sim/hooks/queries/custom-tools.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/sim/hooks/queries/custom-tools.ts b/apps/sim/hooks/queries/custom-tools.ts index 3fdf8572e7..4b2c284fa2 100644 --- a/apps/sim/hooks/queries/custom-tools.ts +++ b/apps/sim/hooks/queries/custom-tools.ts @@ -110,15 +110,16 @@ export function getCustomTools(workspaceId?: string): CustomToolDefinition[] { } /** - * Get a specific custom tool from the query cache by ID (for non-React code) + * Get a specific custom tool from the query cache by ID or title (for non-React code) + * Custom tools are referenced by title in the system (custom_${title}), so title lookup is required. * If workspaceId is not provided, extracts it from the current URL */ export function getCustomTool( - toolId: string, + identifier: string, workspaceId?: string ): CustomToolDefinition | undefined { const tools = getCustomTools(workspaceId) - return tools.find((tool) => tool.id === toolId) + return tools.find((tool) => tool.id === identifier || tool.title === identifier) } /**