Skip to content

Commit e1f6c5f

Browse files
committed
fix(agentphone): drop empty-string updates in update_contact
1 parent bbf1c7b commit e1f6c5f

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

apps/sim/blocks/blocks/agentphone.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -546,10 +546,10 @@ export const AgentPhoneBlock: BlockConfig = {
546546
}
547547

548548
if (['create_contact', 'update_contact'].includes(operation as string)) {
549-
if (contactPhoneNumber !== undefined) rest.phoneNumber = contactPhoneNumber
550-
if (contactName !== undefined) rest.name = contactName
551-
if (contactEmail !== undefined) rest.email = contactEmail
552-
if (contactNotes !== undefined) rest.notes = contactNotes
549+
if (contactPhoneNumber) rest.phoneNumber = contactPhoneNumber
550+
if (contactName) rest.name = contactName
551+
if (contactEmail) rest.email = contactEmail
552+
if (contactNotes) rest.notes = contactNotes
553553
}
554554

555555
if (operation === 'list_contacts' && contactsSearch !== undefined) {

apps/sim/tools/agentphone/update_contact.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ export const agentphoneUpdateContactTool: ToolConfig<
6161
}),
6262
body: (params) => {
6363
const body: Record<string, unknown> = {}
64-
if (params.phoneNumber !== undefined) body.phoneNumber = params.phoneNumber
65-
if (params.name !== undefined) body.name = params.name
66-
if (params.email !== undefined) body.email = params.email
67-
if (params.notes !== undefined) body.notes = params.notes
64+
if (params.phoneNumber) body.phoneNumber = params.phoneNumber
65+
if (params.name) body.name = params.name
66+
if (params.email) body.email = params.email
67+
if (params.notes) body.notes = params.notes
6868
return body
6969
},
7070
},

0 commit comments

Comments
 (0)