From 143e37bc1b17677c141d9ba92ea73ad46608f5eb Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Sat, 28 Feb 2026 12:31:43 -0800 Subject: [PATCH 1/3] improvement(loops): validate loops integration and update skill files --- apps/sim/blocks/blocks/loops.ts | 37 ++++++++++++++----- apps/sim/tools/loops/create_contact.ts | 12 +++--- apps/sim/tools/loops/delete_contact.ts | 4 +- apps/sim/tools/loops/find_contact.ts | 4 +- apps/sim/tools/loops/send_event.ts | 4 +- .../tools/loops/send_transactional_email.ts | 4 +- apps/sim/tools/loops/update_contact.ts | 12 +++--- 7 files changed, 47 insertions(+), 30 deletions(-) diff --git a/apps/sim/blocks/blocks/loops.ts b/apps/sim/blocks/blocks/loops.ts index ff2dccf1ee..02a49ea764 100644 --- a/apps/sim/blocks/blocks/loops.ts +++ b/apps/sim/blocks/blocks/loops.ts @@ -154,7 +154,9 @@ Example: { "clxf1nxlb000t0ml79ajwcsj0": true, "clxf2q43u00010mlh12q9ggx1": false -}`, +} + +Return ONLY the JSON object - no explanations, no extra text.`, placeholder: 'Describe the mailing list subscriptions...', }, }, @@ -183,7 +185,9 @@ Example: "signupDate": "2024-01-15T00:00:00Z", "isActive": true, "seats": 5 -}`, +} + +Return ONLY the JSON object - no explanations, no extra text.`, placeholder: 'Describe the custom properties...', }, }, @@ -221,7 +225,9 @@ Example: "name": "John Smith", "confirmationUrl": "https://example.com/confirm?token=abc123", "expiresIn": 24 -}`, +} + +Return ONLY the JSON object - no explanations, no extra text.`, placeholder: 'Describe the template variables...', }, }, @@ -261,7 +267,9 @@ Example: "contentType": "application/pdf", "data": "JVBERi0xLjQK..." } -]`, +] + +Return ONLY the JSON array - no explanations, no extra text.`, placeholder: 'Describe the attachments...', }, }, @@ -300,7 +308,9 @@ Example: "amount": 49.99, "currency": "USD", "isUpgrade": true -}`, +} + +Return ONLY the JSON object - no explanations, no extra text.`, placeholder: 'Describe the event properties...', }, }, @@ -349,6 +359,7 @@ Example: { label: 'Boolean', id: 'boolean' }, { label: 'Date', id: 'date' }, ], + value: () => 'string', condition: { field: 'operation', value: 'create_contact_property', @@ -363,6 +374,7 @@ Example: { label: 'All Properties', id: 'all' }, { label: 'Custom Only', id: 'custom' }, ], + value: () => 'all', condition: { field: 'operation', value: 'list_contact_properties', @@ -497,23 +509,28 @@ Example: outputs: { success: { type: 'boolean', description: 'Whether the operation succeeded' }, id: { type: 'string', description: 'Contact ID (create/update operations)' }, - contacts: { type: 'json', description: 'Array of matching contacts (find operation)' }, + contacts: { + type: 'json', + description: + 'Array of matching contacts (id, email, firstName, lastName, source, subscribed, userGroup, userId, mailingLists, optInStatus)', + }, message: { type: 'string', description: 'Status message (delete operation)' }, mailingLists: { type: 'json', - description: 'Array of mailing lists (list mailing lists operation)', + description: 'Array of mailing lists (id, name, description, isPublic)', }, transactionalEmails: { type: 'json', - description: 'Array of transactional email templates (list transactional emails operation)', + description: 'Array of transactional email templates (id, name, lastUpdated, dataVariables)', }, pagination: { type: 'json', - description: 'Pagination info (list transactional emails operation)', + description: + 'Pagination info (totalResults, returnedResults, perPage, totalPages, nextCursor, nextPage)', }, properties: { type: 'json', - description: 'Array of contact properties (list contact properties operation)', + description: 'Array of contact properties (key, label, type)', }, }, } diff --git a/apps/sim/tools/loops/create_contact.ts b/apps/sim/tools/loops/create_contact.ts index ecb6d13e84..06bb311fcf 100644 --- a/apps/sim/tools/loops/create_contact.ts +++ b/apps/sim/tools/loops/create_contact.ts @@ -95,13 +95,13 @@ export const loopsCreateContactTool: ToolConfig< Object.assign(body, props) } - body.email = params.email - if (params.firstName) body.firstName = params.firstName - if (params.lastName) body.lastName = params.lastName - if (params.source) body.source = params.source + body.email = params.email.trim() + if (params.firstName) body.firstName = params.firstName.trim() + if (params.lastName) body.lastName = params.lastName.trim() + if (params.source) body.source = params.source.trim() if (params.subscribed != null) body.subscribed = params.subscribed - if (params.userGroup) body.userGroup = params.userGroup - if (params.userId) body.userId = params.userId + if (params.userGroup) body.userGroup = params.userGroup.trim() + if (params.userId) body.userId = params.userId.trim() if (params.mailingLists) { body.mailingLists = diff --git a/apps/sim/tools/loops/delete_contact.ts b/apps/sim/tools/loops/delete_contact.ts index b1e8b7ed77..457dec606c 100644 --- a/apps/sim/tools/loops/delete_contact.ts +++ b/apps/sim/tools/loops/delete_contact.ts @@ -46,8 +46,8 @@ export const loopsDeleteContactTool: ToolConfig< throw new Error('At least one of email or userId is required to delete a contact') } const body: Record = {} - if (params.email) body.email = params.email - if (params.userId) body.userId = params.userId + if (params.email) body.email = params.email.trim() + if (params.userId) body.userId = params.userId.trim() return body }, }, diff --git a/apps/sim/tools/loops/find_contact.ts b/apps/sim/tools/loops/find_contact.ts index f619c8ff74..6c969b77ee 100644 --- a/apps/sim/tools/loops/find_contact.ts +++ b/apps/sim/tools/loops/find_contact.ts @@ -37,8 +37,8 @@ export const loopsFindContactTool: ToolConfig ({ diff --git a/apps/sim/tools/loops/send_event.ts b/apps/sim/tools/loops/send_event.ts index 7083e0d9f1..984fe82c9d 100644 --- a/apps/sim/tools/loops/send_event.ts +++ b/apps/sim/tools/loops/send_event.ts @@ -64,8 +64,8 @@ export const loopsSendEventTool: ToolConfig { const body: Record = { - email: params.email, - transactionalId: params.transactionalId, + email: params.email.trim(), + transactionalId: params.transactionalId.trim(), } if (params.dataVariables) { diff --git a/apps/sim/tools/loops/update_contact.ts b/apps/sim/tools/loops/update_contact.ts index 51d144bc4a..9fd4893be0 100644 --- a/apps/sim/tools/loops/update_contact.ts +++ b/apps/sim/tools/loops/update_contact.ts @@ -99,13 +99,13 @@ export const loopsUpdateContactTool: ToolConfig< Object.assign(body, props) } - if (params.email) body.email = params.email - if (params.userId) body.userId = params.userId - if (params.firstName) body.firstName = params.firstName - if (params.lastName) body.lastName = params.lastName - if (params.source) body.source = params.source + if (params.email) body.email = params.email.trim() + if (params.userId) body.userId = params.userId.trim() + if (params.firstName) body.firstName = params.firstName.trim() + if (params.lastName) body.lastName = params.lastName.trim() + if (params.source) body.source = params.source.trim() if (params.subscribed != null) body.subscribed = params.subscribed - if (params.userGroup) body.userGroup = params.userGroup + if (params.userGroup) body.userGroup = params.userGroup.trim() if (params.mailingLists) { body.mailingLists = From 68e1d9a2dad034fe66112b402e433355bd68a9b7 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Sat, 28 Feb 2026 12:33:19 -0800 Subject: [PATCH 2/3] loops icon color --- apps/docs/components/icons.tsx | 2 +- apps/sim/components/icons.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/docs/components/icons.tsx b/apps/docs/components/icons.tsx index 900ee4e13b..aff954c584 100644 --- a/apps/docs/components/icons.tsx +++ b/apps/docs/components/icons.tsx @@ -3998,7 +3998,7 @@ export function LoopsIcon(props: SVGProps) { return ( diff --git a/apps/sim/components/icons.tsx b/apps/sim/components/icons.tsx index 900ee4e13b..aff954c584 100644 --- a/apps/sim/components/icons.tsx +++ b/apps/sim/components/icons.tsx @@ -3998,7 +3998,7 @@ export function LoopsIcon(props: SVGProps) { return ( From f94b14319c28b5b3c9d13e286514f2683b905203 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Sat, 28 Feb 2026 12:36:40 -0800 Subject: [PATCH 3/3] update databricks icon --- apps/docs/components/icons.tsx | 2 +- apps/docs/content/docs/en/tools/databricks.mdx | 2 +- apps/sim/blocks/blocks/databricks.ts | 2 +- apps/sim/components/icons.tsx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/docs/components/icons.tsx b/apps/docs/components/icons.tsx index aff954c584..51cd709bb7 100644 --- a/apps/docs/components/icons.tsx +++ b/apps/docs/components/icons.tsx @@ -4542,7 +4542,7 @@ export function DatabricksIcon(props: SVGProps) { ) diff --git a/apps/docs/content/docs/en/tools/databricks.mdx b/apps/docs/content/docs/en/tools/databricks.mdx index 7286685fdc..a1ded4fab9 100644 --- a/apps/docs/content/docs/en/tools/databricks.mdx +++ b/apps/docs/content/docs/en/tools/databricks.mdx @@ -7,7 +7,7 @@ import { BlockInfoCard } from "@/components/ui/block-info-card" {/* MANUAL-CONTENT-START:intro */} diff --git a/apps/sim/blocks/blocks/databricks.ts b/apps/sim/blocks/blocks/databricks.ts index 8432164de6..d4473fd41e 100644 --- a/apps/sim/blocks/blocks/databricks.ts +++ b/apps/sim/blocks/blocks/databricks.ts @@ -12,7 +12,7 @@ export const DatabricksBlock: BlockConfig = { 'Connect to Databricks to execute SQL queries against SQL warehouses, trigger and monitor job runs, manage clusters, and retrieve run outputs. Requires a Personal Access Token and workspace host URL.', docsLink: 'https://docs.sim.ai/tools/databricks', category: 'tools', - bgColor: '#FF3621', + bgColor: '#F9F7F4', icon: DatabricksIcon, subBlocks: [ { diff --git a/apps/sim/components/icons.tsx b/apps/sim/components/icons.tsx index aff954c584..51cd709bb7 100644 --- a/apps/sim/components/icons.tsx +++ b/apps/sim/components/icons.tsx @@ -4542,7 +4542,7 @@ export function DatabricksIcon(props: SVGProps) { )