Skip to content

Commit ef3da3c

Browse files
Adam GoughAdam Gough
authored andcommitted
minor changes
1 parent 7f30326 commit ef3da3c

4 files changed

Lines changed: 20 additions & 16 deletions

File tree

apps/docs/content/docs/en/tools/meta.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"google_calendar",
1818
"google_docs",
1919
"google_drive",
20+
"google_forms",
2021
"google_search",
2122
"google_sheets",
2223
"huggingface",

apps/docs/content/docs/en/tools/sharepoint.mdx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,25 @@ Update the properties (fields) on a SharePoint list item
183183
| --------- | ---- | ----------- |
184184
| `item` | object | Updated SharePoint list item |
185185

186+
### `sharepoint_add_list_items`
187+
188+
Add a new item to a SharePoint list
189+
190+
#### Input
191+
192+
| Parameter | Type | Required | Description |
193+
| --------- | ---- | -------- | ----------- |
194+
| `siteSelector` | string | No | Select the SharePoint site |
195+
| `siteId` | string | No | The ID of the SharePoint site \(internal use\) |
196+
| `listId` | string | Yes | The ID of the list to add the item to |
197+
| `listItemFields` | object | Yes | Field values for the new list item |
198+
199+
#### Output
200+
201+
| Parameter | Type | Description |
202+
| --------- | ---- | ----------- |
203+
| `item` | object | Created SharePoint list item |
204+
186205

187206

188207
## Notes

apps/sim/blocks/blocks/sharepoint.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export const SharepointBlock: BlockConfig<SharepointResponse> = {
1616
bgColor: '#E0E0E0',
1717
icon: MicrosoftSharepointIcon,
1818
subBlocks: [
19-
// Operation selector
2019
{
2120
id: 'operation',
2221
title: 'Operation',
@@ -32,7 +31,6 @@ export const SharepointBlock: BlockConfig<SharepointResponse> = {
3231
{ label: 'Add List Items', id: 'add_list_items' },
3332
],
3433
},
35-
// Sharepoint Credentials
3634
{
3735
id: 'credential',
3836
title: 'Microsoft Account',
@@ -217,7 +215,6 @@ export const SharepointBlock: BlockConfig<SharepointResponse> = {
217215
params: (params) => {
218216
const { credential, siteSelector, manualSiteId, mimeType, ...rest } = params
219217

220-
// Use siteSelector if provided, otherwise use manualSiteId
221218
const effectiveSiteId = (siteSelector || manualSiteId || '').trim()
222219

223220
const {
@@ -239,12 +236,10 @@ export const SharepointBlock: BlockConfig<SharepointResponse> = {
239236
})
240237
}
241238
}
242-
// Ensure listItemFields is an object for the tool schema
243239
if (typeof parsedItemFields !== 'object' || parsedItemFields === null) {
244240
parsedItemFields = undefined
245241
}
246242

247-
// Sanitize item ID (required by tool)
248243
const rawItemId = providedItemId ?? listItemId
249244
const sanitizedItemId =
250245
rawItemId === undefined || rawItemId === null
@@ -257,7 +252,6 @@ export const SharepointBlock: BlockConfig<SharepointResponse> = {
257252
return undefined
258253
}
259254

260-
// Debug logging for update_list/add_list_items param mapping
261255
if (others.operation === 'update_list' || others.operation === 'add_list_items') {
262256
try {
263257
logger.info('SharepointBlock list item param check', {
@@ -280,7 +274,6 @@ export const SharepointBlock: BlockConfig<SharepointResponse> = {
280274
pageSize: others.pageSize ? Number.parseInt(others.pageSize as string, 10) : undefined,
281275
mimeType: mimeType,
282276
...others,
283-
// Map to tool param names
284277
itemId: sanitizedItemId,
285278
listItemFields: parsedItemFields,
286279
includeColumns: coerceBoolean(includeColumns),
@@ -292,26 +285,20 @@ export const SharepointBlock: BlockConfig<SharepointResponse> = {
292285
inputs: {
293286
operation: { type: 'string', description: 'Operation to perform' },
294287
credential: { type: 'string', description: 'Microsoft account credential' },
295-
// Create Page operation inputs
296288
pageName: { type: 'string', description: 'Page name' },
297289
pageContent: { type: 'string', description: 'Page content' },
298290
pageTitle: { type: 'string', description: 'Page title' },
299-
// Read Page operation inputs
300291
pageId: { type: 'string', description: 'Page ID' },
301-
// List operation inputs
302292
siteSelector: { type: 'string', description: 'Site selector' },
303293
manualSiteId: { type: 'string', description: 'Manual site ID' },
304294
pageSize: { type: 'number', description: 'Results per page' },
305-
// Create List operation inputs
306295
listDisplayName: { type: 'string', description: 'List display name' },
307296
listDescription: { type: 'string', description: 'List description' },
308297
listTemplate: { type: 'string', description: 'List template' },
309-
// Read List operation inputs
310298
listId: { type: 'string', description: 'List ID' },
311299
listTitle: { type: 'string', description: 'List title' },
312300
includeColumns: { type: 'boolean', description: 'Include columns in response' },
313301
includeItems: { type: 'boolean', description: 'Include items in response' },
314-
// Update List Item operation inputs
315302
listItemId: { type: 'string', description: 'List item ID' },
316303
listItemFields: { type: 'string', description: 'List item fields' },
317304
},

apps/sim/tools/sharepoint/add_list_items.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ export const addListItemTool: ToolConfig<SharepointToolParams, SharepointAddList
6969
throw new Error('listItemFields must not be empty')
7070
}
7171

72-
// Support both { fields: {...} } and raw { fieldName: value } inputs
7372
const providedFields =
7473
typeof params.listItemFields === 'object' &&
7574
params.listItemFields !== null &&
@@ -82,7 +81,6 @@ export const addListItemTool: ToolConfig<SharepointToolParams, SharepointAddList
8281
throw new Error('No fields provided to create the SharePoint list item')
8382
}
8483

85-
// Filter out system/read-only fields that cannot be set via Graph
8684
const readOnlyFields = new Set<string>([
8785
'Id',
8886
'id',
@@ -139,7 +137,6 @@ export const addListItemTool: ToolConfig<SharepointToolParams, SharepointAddList
139137
try {
140138
data = await response.json()
141139
} catch {
142-
// Some Graph endpoints may not return a body consistently
143140
data = undefined
144141
}
145142

0 commit comments

Comments
 (0)