Skip to content

Commit 628f5cd

Browse files
committed
fix(outlook): use consistent set/replace semantics for message categories
Categories are replaced with the provided non-empty list and left unchanged when empty, consistent across the block and agent paths. Drops the ambiguous empty-array clear (clearing all categories isn't expressible unambiguously from the comma-separated field) and updates the description to match.
1 parent 19d0208 commit 628f5cd

2 files changed

Lines changed: 5 additions & 10 deletions

File tree

apps/docs/content/docs/en/integrations/outlook.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ Set the categories, follow-up flag, and importance on an Outlook message
337337
| Parameter | Type | Required | Description |
338338
| --------- | ---- | -------- | ----------- |
339339
| `messageId` | string | Yes | The ID of the message to update |
340-
| `categories` | json | No | Array of category names to assign to the message \(replaces existing categories; pass an empty array to clear all\) |
340+
| `categories` | json | No | Array of category names to assign to the message \(replaces existing categories; leave empty to keep them unchanged\) |
341341
| `flagStatus` | string | No | Follow-up flag status: notFlagged, flagged, or complete |
342342
| `importance` | string | No | Message importance: low, normal, or high |
343343

apps/sim/tools/outlook/update_message.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export const outlookUpdateMessageTool: ToolConfig<
6666
required: false,
6767
visibility: 'user-or-llm',
6868
description:
69-
'Array of category names to assign to the message (replaces existing categories; pass an empty array to clear all)',
69+
'Array of category names to assign to the message (replaces existing categories; leave empty to keep them unchanged)',
7070
},
7171
flagStatus: {
7272
type: 'string',
@@ -97,14 +97,9 @@ export const outlookUpdateMessageTool: ToolConfig<
9797
body: (params) => {
9898
const body: Record<string, unknown> = {}
9999

100-
const rawCategories: unknown = params.categories
101-
if (Array.isArray(rawCategories)) {
102-
body.categories = normalizeCategories(rawCategories)
103-
} else if (typeof rawCategories === 'string') {
104-
const normalizedCategories = normalizeCategories(rawCategories)
105-
if (normalizedCategories.length > 0) {
106-
body.categories = normalizedCategories
107-
}
100+
const normalizedCategories = normalizeCategories(params.categories)
101+
if (normalizedCategories.length > 0) {
102+
body.categories = normalizedCategories
108103
}
109104

110105
if (params.flagStatus) {

0 commit comments

Comments
 (0)