Skip to content

Commit 6e682f5

Browse files
committed
fix(doc-generator): added in missing microsoft docs, fixed doc generator
1 parent 84b9d76 commit 6e682f5

File tree

9 files changed

+129
-53
lines changed

9 files changed

+129
-53
lines changed

apps/docs/content/docs/tools/microsoft_teams.mdx

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,88 @@ Integrate Microsoft Teams functionality to manage messages. Read content from ex
103103

104104
### `microsoft_teams_read_chat`
105105

106+
Read content from a Microsoft Teams chat
107+
108+
#### Input
109+
110+
| Parameter | Type | Required | Description |
111+
| --------- | ---- | -------- | ----------- |
112+
| `accessToken` | string | Yes | The access token for the Microsoft Teams API |
113+
| `chatId` | string | Yes | The ID of the chat to read from |
114+
115+
#### Output
116+
117+
| Parameter | Type |
118+
| --------- | ---- |
119+
| `content` | string |
120+
| `metadata` | string |
121+
| `messageCount` | string |
122+
| `messages` | string |
123+
| `totalAttachments` | string |
124+
| `attachmentTypes` | string |
106125

107126
### `microsoft_teams_write_chat`
108127

128+
Write or update content in a Microsoft Teams chat
129+
130+
#### Input
131+
132+
| Parameter | Type | Required | Description |
133+
| --------- | ---- | -------- | ----------- |
134+
| `accessToken` | string | Yes | The access token for the Microsoft Teams API |
135+
| `chatId` | string | Yes | The ID of the chat to write to |
136+
| `content` | string | Yes | The content to write to the message |
137+
138+
#### Output
139+
140+
| Parameter | Type |
141+
| --------- | ---- |
142+
| `updatedContent` | string |
143+
| `metadata` | string |
109144

110145
### `microsoft_teams_read_channel`
111146

147+
Read content from a Microsoft Teams channel
148+
149+
#### Input
150+
151+
| Parameter | Type | Required | Description |
152+
| --------- | ---- | -------- | ----------- |
153+
| `accessToken` | string | Yes | The access token for the Microsoft Teams API |
154+
| `teamId` | string | Yes | The ID of the team to read from |
155+
| `channelId` | string | Yes | The ID of the channel to read from |
156+
157+
#### Output
158+
159+
| Parameter | Type |
160+
| --------- | ---- |
161+
| `content` | string |
162+
| `metadata` | string |
163+
| `channelId` | string |
164+
| `messageCount` | string |
165+
| `messages` | string |
166+
| `totalAttachments` | string |
167+
| `attachmentTypes` | string |
112168

113169
### `microsoft_teams_write_channel`
114170

171+
Write or send a message to a Microsoft Teams channel
172+
173+
#### Input
174+
175+
| Parameter | Type | Required | Description |
176+
| --------- | ---- | -------- | ----------- |
177+
| `accessToken` | string | Yes | The access token for the Microsoft Teams API |
178+
| `teamId` | string | Yes | The ID of the team to write to |
179+
| `channelId` | string | Yes | The ID of the channel to write to |
180+
| `content` | string | Yes | The content to write to the channel |
181+
182+
#### Output
183+
184+
| Parameter | Type |
185+
| --------- | ---- |
186+
| `updatedContent` | string |
187+
| `metadata` | string |
115188

116189

117190

apps/sim/tools/airtable/create_records.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,12 @@ export const airtableCreateRecordsTool: ToolConfig<AirtableCreateParams, Airtabl
4545
Authorization: `Bearer ${params.accessToken}`,
4646
'Content-Type': 'application/json',
4747
}),
48-
// Body should contain { records: [...] } and optionally { typecast: true }
4948
body: (params) => ({ records: params.records }),
5049
},
5150

5251
transformResponse: async (response) => {
5352
const data = await response.json()
5453
if (!response.ok) {
55-
// logger.error('Airtable API error:', data)
5654
throw new Error(data.error?.message || 'Failed to create Airtable records')
5755
}
5856
return {
@@ -67,7 +65,6 @@ export const airtableCreateRecordsTool: ToolConfig<AirtableCreateParams, Airtabl
6765
},
6866

6967
transformError: (error: any) => {
70-
// logger.error('Airtable tool error:', error)
7168
return `Failed to create Airtable records: ${error.message || 'Unknown error'}`
7269
},
7370
}

apps/sim/tools/google_docs/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ import { createTool } from './create'
22
import { readTool } from './read'
33
import { writeTool } from './write'
44

5-
export const docsReadTool = readTool
6-
export const docsWriteTool = writeTool
7-
export const docsCreateTool = createTool
5+
export const googleDocsReadTool = readTool
6+
export const googleDocsWriteTool = writeTool
7+
export const googleDocsCreateTool = createTool

apps/sim/tools/google_drive/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { getContentTool } from './get_content'
33
import { listTool } from './list'
44
import { uploadTool } from './upload'
55

6-
export const driveCreateFolderTool = createFolderTool
7-
export const driveGetContentTool = getContentTool
8-
export const driveListTool = listTool
9-
export const driveUploadTool = uploadTool
6+
export const googleDriveCreateFolderTool = createFolderTool
7+
export const googleDriveGetContentTool = getContentTool
8+
export const googleDriveListTool = listTool
9+
export const googleDriveUploadTool = uploadTool

apps/sim/tools/google_sheets/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { readTool } from './read'
33
import { updateTool } from './update'
44
import { writeTool } from './write'
55

6-
export const sheetsReadTool = readTool
7-
export const sheetsWriteTool = writeTool
8-
export const sheetsUpdateTool = updateTool
9-
export const sheetsAppendTool = appendTool
6+
export const googleSheetsReadTool = readTool
7+
export const googleSheetsWriteTool = writeTool
8+
export const googleSheetsUpdateTool = updateTool
9+
export const googleSheetsAppendTool = appendTool

apps/sim/tools/registry.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@ import {
2727
} from './github'
2828
import { gmailReadTool, gmailSearchTool, gmailSendTool } from './gmail'
2929
import { searchTool as googleSearchTool } from './google'
30-
import { docsCreateTool, docsReadTool, docsWriteTool } from './google_docs'
30+
import { googleDocsCreateTool, googleDocsReadTool, googleDocsWriteTool } from './google_docs'
3131
import {
32-
driveCreateFolderTool,
33-
driveGetContentTool,
34-
driveListTool,
35-
driveUploadTool,
32+
googleDriveCreateFolderTool,
33+
googleDriveGetContentTool,
34+
googleDriveListTool,
35+
googleDriveUploadTool,
3636
} from './google_drive'
3737
import {
38-
sheetsAppendTool,
39-
sheetsReadTool,
40-
sheetsUpdateTool,
41-
sheetsWriteTool,
38+
googleSheetsAppendTool,
39+
googleSheetsReadTool,
40+
googleSheetsUpdateTool,
41+
googleSheetsWriteTool,
4242
} from './google_sheets'
4343
import { guestyGuestTool, guestyReservationTool } from './guesty'
4444
import { requestTool as httpRequest } from './http'
@@ -139,17 +139,17 @@ export const tools: Record<string, ToolConfig> = {
139139
reddit_hot_posts: redditHotPostsTool,
140140
reddit_get_posts: redditGetPostsTool,
141141
reddit_get_comments: redditGetCommentsTool,
142-
google_drive_get_content: driveGetContentTool,
143-
google_drive_list: driveListTool,
144-
google_drive_upload: driveUploadTool,
145-
google_drive_create_folder: driveCreateFolderTool,
146-
google_docs_read: docsReadTool,
147-
google_docs_write: docsWriteTool,
148-
google_docs_create: docsCreateTool,
149-
google_sheets_read: sheetsReadTool,
150-
google_sheets_write: sheetsWriteTool,
151-
google_sheets_update: sheetsUpdateTool,
152-
google_sheets_append: sheetsAppendTool,
142+
google_drive_get_content: googleDriveGetContentTool,
143+
google_drive_list: googleDriveListTool,
144+
google_drive_upload: googleDriveUploadTool,
145+
google_drive_create_folder: googleDriveCreateFolderTool,
146+
google_docs_read: googleDocsReadTool,
147+
google_docs_write: googleDocsWriteTool,
148+
google_docs_create: googleDocsCreateTool,
149+
google_sheets_read: googleSheetsReadTool,
150+
google_sheets_write: googleSheetsWriteTool,
151+
google_sheets_update: googleSheetsUpdateTool,
152+
google_sheets_append: googleSheetsAppendTool,
153153
guesty_reservation: guestyReservationTool,
154154
guesty_guest: guestyGuestTool,
155155
perplexity_chat: perplexityChatTool,

apps/sim/tools/stagehand/agent.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ export const agentTool: ToolConfig<StagehandAgentParams, StagehandAgentResponse>
1010
description: 'Run an autonomous web agent to complete tasks and extract structured data',
1111
version: '1.0.0',
1212

13-
// Define the input parameters
1413
params: {
1514
task: {
1615
type: 'string',
@@ -40,7 +39,6 @@ export const agentTool: ToolConfig<StagehandAgentParams, StagehandAgentResponse>
4039
},
4140
},
4241

43-
// Use HTTP request for server-side execution
4442
request: {
4543
url: '/api/tools/stagehand/agent',
4644
method: 'POST',
@@ -64,7 +62,6 @@ export const agentTool: ToolConfig<StagehandAgentParams, StagehandAgentResponse>
6462
},
6563
},
6664

67-
// Transform the response
6865
transformResponse: async (response) => {
6966
try {
7067
const data = await response.json()

apps/sim/tools/stagehand/extract.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ export const extractTool: ToolConfig<StagehandExtractParams, StagehandExtractRes
1010
description: 'Extract structured data from a webpage using Stagehand',
1111
version: '1.0.0',
1212

13-
// Define the input parameters
1413
params: {
1514
instruction: {
1615
type: 'string',
@@ -34,7 +33,6 @@ export const extractTool: ToolConfig<StagehandExtractParams, StagehandExtractRes
3433
},
3534
},
3635

37-
// Use HTTP request for server-side execution
3836
request: {
3937
url: '/api/tools/stagehand/extract',
4038
method: 'POST',
@@ -49,7 +47,6 @@ export const extractTool: ToolConfig<StagehandExtractParams, StagehandExtractRes
4947
}),
5048
},
5149

52-
// Transform the response
5350
transformResponse: async (response) => {
5451
try {
5552
const data = await response.json()

scripts/generate-block-docs.ts

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -759,20 +759,32 @@ async function getToolInfo(toolName: string): Promise<{
759759
outputs: Record<string, any>
760760
} | null> {
761761
try {
762-
// Get tool prefix and suffix
763-
let toolPrefix = toolName.split('_')[0]
764-
let toolSuffix = toolName.split('_').slice(1).join('_')
762+
// Split the tool name into parts
763+
const parts = toolName.split('_')
765764

766-
// Handle special cases for tools that have multiple parts
767-
if (
768-
(toolPrefix === 'google' &&
769-
(toolName.startsWith('google_docs_') ||
770-
toolName.startsWith('google_sheets_') ||
771-
toolName.startsWith('google_drive_'))) ||
772-
toolName.startsWith('browser_use')
773-
) {
774-
toolPrefix = toolName.split('_').slice(0, 2).join('_')
775-
toolSuffix = toolName.split('_').slice(2).join('_')
765+
// Try to find the correct split point by checking if directories exist
766+
let toolPrefix = ''
767+
let toolSuffix = ''
768+
769+
// Start from the longest possible prefix and work backwards
770+
for (let i = parts.length - 1; i >= 1; i--) {
771+
const possiblePrefix = parts.slice(0, i).join('_')
772+
const possibleSuffix = parts.slice(i).join('_')
773+
774+
// Check if a directory exists for this prefix
775+
const toolDirPath = path.join(rootDir, `apps/sim/tools/${possiblePrefix}`)
776+
777+
if (fs.existsSync(toolDirPath) && fs.statSync(toolDirPath).isDirectory()) {
778+
toolPrefix = possiblePrefix
779+
toolSuffix = possibleSuffix
780+
break
781+
}
782+
}
783+
784+
// If no directory was found, fall back to single-part prefix
785+
if (!toolPrefix) {
786+
toolPrefix = parts[0]
787+
toolSuffix = parts.slice(1).join('_')
776788
}
777789

778790
// Simplify the file search strategy

0 commit comments

Comments
 (0)