@composio/core 0.11.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/dist/BaseProvider-BBnsv9kS.d.mts +29425 -0
  2. package/dist/{BaseProvider-CVbQxTNa.d.cts → BaseProvider-Brb3o86-.d.mts} +91 -44
  3. package/dist/CustomTool-D9qwyMrv.mjs +468 -0
  4. package/dist/{CustomTool-C-IUByoU.d.cts → CustomTool-Dmi6ti3I.d.mts} +2 -4
  5. package/dist/{CustomTool-CChQSp44.d.mts → CustomTool-DrJpOhY2.d.mts} +2 -4
  6. package/dist/{FileModifierErrors-C7z16Dfi.mjs → FileModifierErrors-3fSwIWoa.mjs} +35 -36
  7. package/dist/{Telemetry-DQax33Gh.mjs → Telemetry-DhGI_J4G.mjs} +15 -15
  8. package/dist/{composio-pcA13w87.d.cts → composio-DHIKRdeG.d.mts} +641 -380
  9. package/dist/{composio-BlASKqjQ.d.mts → composio-vMwhASRc.d.mts} +1390 -1129
  10. package/dist/{customTool.types-QtkAZQma.d.cts → customTool.types-CKH2R2ia.d.mts} +487 -189
  11. package/dist/{customTool.types-DLIORcYN.d.mts → customTool.types-DXin7Cfc.d.mts} +924 -626
  12. package/dist/docs/error-consistency.md +97 -0
  13. package/dist/docs/reference/sdk-reference/typescript/auth-configs.mdx +306 -0
  14. package/dist/docs/reference/sdk-reference/typescript/composio.mdx +205 -0
  15. package/dist/docs/reference/sdk-reference/typescript/connected-accounts.mdx +488 -0
  16. package/dist/docs/reference/sdk-reference/typescript/experimental.mdx +94 -0
  17. package/dist/docs/reference/sdk-reference/typescript/index.mdx +67 -0
  18. package/dist/docs/reference/sdk-reference/typescript/mcp.mdx +304 -0
  19. package/dist/docs/reference/sdk-reference/typescript/meta.json +17 -0
  20. package/dist/docs/reference/sdk-reference/typescript/remote-file.mdx +107 -0
  21. package/dist/docs/reference/sdk-reference/typescript/session-files.mdx +163 -0
  22. package/dist/docs/reference/sdk-reference/typescript/session.mdx +229 -0
  23. package/dist/docs/reference/sdk-reference/typescript/sessions.mdx +131 -0
  24. package/dist/docs/reference/sdk-reference/typescript/toolkits.mdx +169 -0
  25. package/dist/docs/reference/sdk-reference/typescript/tools.mdx +453 -0
  26. package/dist/docs/reference/sdk-reference/typescript/triggers.mdx +434 -0
  27. package/dist/{CustomTool-D5s-aADw.mjs → errors-DSIlYfl5.mjs} +72 -459
  28. package/dist/experimental/index.d.mts +2 -3
  29. package/dist/experimental/index.mjs +1 -3
  30. package/dist/{fileUtils.node-Dq7ebZPC.mjs → fileUtils.node-BiO1JQsJ.mjs} +26 -25
  31. package/dist/index.d.mts +1708 -2400
  32. package/dist/index.mjs +2632 -2006
  33. package/dist/jsonSchema-CFKdONpP.mjs +251 -0
  34. package/dist/models/Files.node.d.mts +1 -2
  35. package/dist/models/Files.node.mjs +3 -4
  36. package/dist/models/Files.workerd.d.mts +0 -1
  37. package/dist/platform/node.d.mts +1 -2
  38. package/dist/platform/workerd.d.mts +1 -2
  39. package/dist/{chunk-CWQeghP5.mjs → rolldown-runtime-w6R9maHv.mjs} +3 -5
  40. package/dist/{types-J2KCXP8R.d.mts → types-D4Id3wXA.d.mts} +2 -3
  41. package/dist/{types-DRG5qLxI.d.cts → types-qTbYYBJw.d.mts} +2 -3
  42. package/dist/utils/config-defaults/ConfigDefaults.node.d.mts +1 -4
  43. package/dist/utils/config-defaults/ConfigDefaults.workerd.d.mts +1 -4
  44. package/dist/utils/config-defaults/ConfigDefaults.workerd.mjs +3 -0
  45. package/dist/utils/json-schema.d.mts +2 -0
  46. package/dist/utils/json-schema.mjs +3 -0
  47. package/dist/utils/modifiers/FileToolModifier.node.d.mts +3 -1
  48. package/dist/utils/modifiers/FileToolModifier.node.mjs +44 -24
  49. package/dist/utils/modifiers/FileToolModifier.workerd.d.mts +3 -1
  50. package/dist/utils/modifiers/FileToolModifier.workerd.mjs +1 -1
  51. package/docs/error-consistency.md +97 -0
  52. package/package.json +40 -88
  53. package/src/composio.ts +509 -0
  54. package/src/errors/AuthConfigErrors.ts +23 -0
  55. package/src/errors/ComposioError.ts +408 -0
  56. package/src/errors/ConnectedAccountsErrors.ts +158 -0
  57. package/src/errors/ConnectionRequestErrors.ts +32 -0
  58. package/src/errors/FileModifierErrors.ts +100 -0
  59. package/src/errors/PusherErrors.ts +28 -0
  60. package/src/errors/RemoteFileErrors.ts +62 -0
  61. package/src/errors/SDKErrors.ts +92 -0
  62. package/src/errors/ToolErrors.ts +244 -0
  63. package/src/errors/ToolkitErrors.ts +39 -0
  64. package/src/errors/TriggerErrors.ts +120 -0
  65. package/src/errors/ValidationErrors.ts +99 -0
  66. package/src/errors/index.ts +41 -0
  67. package/src/experimental/index.ts +28 -0
  68. package/src/index.ts +64 -0
  69. package/src/lib/toolRouterConstants.ts +1 -0
  70. package/src/lib/toolRouterParams.ts +306 -0
  71. package/src/models/AuthConfigs.ts +398 -0
  72. package/src/models/AuthScheme.ts +206 -0
  73. package/src/models/ConnectedAccounts.ts +735 -0
  74. package/src/models/ConnectionRequest.ts +150 -0
  75. package/src/models/CustomTool.ts +676 -0
  76. package/src/models/Experimental.ts +202 -0
  77. package/src/models/Files.node.ts +93 -0
  78. package/src/models/Files.workerd.ts +49 -0
  79. package/src/models/MCP.ts +478 -0
  80. package/src/models/RemoteFile.ts +172 -0
  81. package/src/models/SessionContext.ts +147 -0
  82. package/src/models/Sessions.ts +21 -0
  83. package/src/models/ToolRouter.ts +391 -0
  84. package/src/models/ToolRouterSession.ts +827 -0
  85. package/src/models/ToolRouterSessionFileMount.ts +389 -0
  86. package/src/models/Toolkits.ts +412 -0
  87. package/src/models/Tools.ts +1260 -0
  88. package/src/models/Triggers.ts +1381 -0
  89. package/src/models/customToolExecution.ts +118 -0
  90. package/src/models/inlineCustomToolsPayload.ts +17 -0
  91. package/src/models/proxyParamsTransform.ts +26 -0
  92. package/src/provider/BaseProvider.ts +138 -0
  93. package/src/provider/ComposioProvider.ts +29 -0
  94. package/src/provider/OpenAIProvider.ts +547 -0
  95. package/src/services/internal/InternalService.ts +50 -0
  96. package/src/services/internal/InternalService.types.ts +14 -0
  97. package/src/services/pusher/Pusher.ts +230 -0
  98. package/src/services/telemetry/TelemetryService.ts +48 -0
  99. package/src/services/telemetry/TelemetryService.types.ts +67 -0
  100. package/src/telemetry/BatchProcessor.ts +77 -0
  101. package/src/telemetry/README.md +123 -0
  102. package/src/telemetry/Telemetry.ts +356 -0
  103. package/src/types/ToolRouterSessionFilesMount.types.ts +96 -0
  104. package/src/types/authConfigs.types.ts +174 -0
  105. package/src/types/composio.types.ts +1 -0
  106. package/src/types/connectedAccountAuthStates.types.ts +852 -0
  107. package/src/types/connectedAccounts.types.ts +395 -0
  108. package/src/types/connectionRequest.types.ts +16 -0
  109. package/src/types/customTool.types.ts +261 -0
  110. package/{dist/files.types-lo4zZd87.d.cts → src/types/files.types.ts} +3 -5
  111. package/src/types/mcp.experimental.types.ts +163 -0
  112. package/src/types/mcp.types.ts +362 -0
  113. package/src/types/modifiers.types.ts +663 -0
  114. package/src/types/org.types.ts +0 -0
  115. package/src/types/provider.types.ts +41 -0
  116. package/src/types/pusher.types.ts +18 -0
  117. package/src/types/requestOptions.types.ts +62 -0
  118. package/src/types/telemetry.types.ts +89 -0
  119. package/src/types/tool.types.ts +408 -0
  120. package/src/types/toolRouter.types.ts +761 -0
  121. package/src/types/toolkit.types.ts +130 -0
  122. package/src/types/triggers.types.ts +401 -0
  123. package/src/types/webhookEvents.types.ts +219 -0
  124. package/src/utils/buffer.ts +30 -0
  125. package/src/utils/cancellation.ts +22 -0
  126. package/src/utils/config-defaults/ConfigDefaults.node.ts +7 -0
  127. package/src/utils/config-defaults/ConfigDefaults.workerd.ts +10 -0
  128. package/src/utils/config-defaults/index.ts +1 -0
  129. package/src/utils/config-defaults/types.ts +14 -0
  130. package/src/utils/constants.ts +22 -0
  131. package/src/utils/crypto.ts +34 -0
  132. package/src/utils/env.ts +34 -0
  133. package/src/utils/fileDirs.ts +81 -0
  134. package/src/utils/fileUtils.node.ts +458 -0
  135. package/src/utils/json-schema.ts +1 -0
  136. package/src/utils/jsonSchema.ts +355 -0
  137. package/src/utils/logger.ts +99 -0
  138. package/src/utils/mime.ts +75 -0
  139. package/src/utils/modifiers/FileToolModifier.node.ts +477 -0
  140. package/src/utils/modifiers/FileToolModifier.utils.neutral.ts +132 -0
  141. package/src/utils/modifiers/FileToolModifier.workerd.ts +51 -0
  142. package/src/utils/pagination.ts +73 -0
  143. package/src/utils/pusher.ts +286 -0
  144. package/src/utils/schemaPropertyKeys.ts +433 -0
  145. package/src/utils/sdk.ts +110 -0
  146. package/src/utils/sensitiveFileUploadPaths.node.ts +105 -0
  147. package/src/utils/session.ts +114 -0
  148. package/src/utils/toolArguments.ts +73 -0
  149. package/src/utils/toolkitVersion.ts +26 -0
  150. package/src/utils/transform.ts +42 -0
  151. package/src/utils/transformers/authConfigs.ts +107 -0
  152. package/src/utils/transformers/connectedAccounts.ts +119 -0
  153. package/src/utils/transformers/mcp.ts +164 -0
  154. package/src/utils/transformers/toolRouterResponseTransform.ts +160 -0
  155. package/src/utils/transformers/toolkits.ts +100 -0
  156. package/src/utils/transformers/triggers.ts +118 -0
  157. package/src/utils/uploadDirAllowlist.node.ts +178 -0
  158. package/src/utils/uuid.ts +7 -0
  159. package/src/utils/version.ts +58 -0
  160. package/src/utils/zodSchema.ts +90 -0
  161. package/dist/BaseProvider-BvHvJLXc.d.mts +0 -29378
  162. package/dist/CustomTool-D3-NreIm.cjs +0 -1341
  163. package/dist/FileModifierErrors-BYJBHiay.cjs +0 -554
  164. package/dist/FileToolModifier.utils.neutral-DSBQs9-i.cjs +0 -96
  165. package/dist/Telemetry-BQ_pl5AK.cjs +0 -360
  166. package/dist/buffer-BjWptbNH.cjs +0 -63
  167. package/dist/chunk-CQwRTUmo.cjs +0 -53
  168. package/dist/experimental/index.cjs +0 -5
  169. package/dist/experimental/index.d.cts +0 -3
  170. package/dist/fileUtils.node-DtnSRMWa.cjs +0 -462
  171. package/dist/index.cjs +0 -8523
  172. package/dist/index.d.cts +0 -6065
  173. package/dist/models/Files.node.cjs +0 -55
  174. package/dist/models/Files.node.d.cts +0 -56
  175. package/dist/models/Files.workerd.cjs +0 -29
  176. package/dist/models/Files.workerd.d.cts +0 -13
  177. package/dist/platform/node.cjs +0 -55
  178. package/dist/platform/node.d.cts +0 -11
  179. package/dist/platform/workerd.cjs +0 -42
  180. package/dist/platform/workerd.d.cts +0 -12
  181. package/dist/types-pDNm1lYs.d.cts +0 -69
  182. package/dist/utils/config-defaults/ConfigDefaults.node.cjs +0 -10
  183. package/dist/utils/config-defaults/ConfigDefaults.node.d.cts +0 -7
  184. package/dist/utils/config-defaults/ConfigDefaults.workerd.cjs +0 -10
  185. package/dist/utils/config-defaults/ConfigDefaults.workerd.d.cts +0 -7
  186. package/dist/utils/modifiers/FileToolModifier.node.cjs +0 -224
  187. package/dist/utils/modifiers/FileToolModifier.node.d.cts +0 -22
  188. package/dist/utils/modifiers/FileToolModifier.workerd.cjs +0 -27
  189. package/dist/utils/modifiers/FileToolModifier.workerd.d.cts +0 -20
  190. /package/dist/{FileToolModifier.utils.neutral-BpSceNK8.mjs → FileToolModifier.utils.neutral-B5rT711M.mjs} +0 -0
  191. /package/dist/{buffer-yOtEsT4J.mjs → buffer-PcbMMsgm.mjs} +0 -0
  192. /package/dist/{files.types-BXDWA_zS.d.mts → files.types-DeMC_mAW.d.mts} +0 -0
  193. /package/dist/{types-HpJQ8K9l.d.mts → types-DdoCRzLj.d.mts} +0 -0
@@ -0,0 +1,453 @@
1
+ ---
2
+ title: "Tools"
3
+ description: "This class is used to manage tools in the Composio SDK. It provides methods to list, get, and execute tools."
4
+ ---
5
+
6
+ ## Usage
7
+
8
+ Access this class through the `composio.tools` property:
9
+
10
+ ```typescript
11
+ const composio = new Composio({ apiKey: 'your-api-key' });
12
+ const result = await composio.tools.list();
13
+ ```
14
+
15
+ ## Methods
16
+
17
+ ### execute()
18
+
19
+ Executes a given tool with the provided parameters.
20
+
21
+ This method calls the Composio API to execute the tool and returns the response.
22
+
23
+ **Version Control:**
24
+ By default, manual tool execution requires a specific toolkit version. If the version resolves to "latest",
25
+ the execution will throw a `ComposioToolVersionRequiredError` unless `dangerouslySkipVersionCheck` is set to `true`.
26
+ This helps prevent unexpected behavior when new toolkit versions are released.
27
+
28
+ ```typescript
29
+ async execute(slug: string, body: ToolExecuteParams, options?: ExecuteToolModifiers & ComposioRequestOptions): Promise<ToolExecuteResponse>
30
+ ```
31
+
32
+ **Parameters**
33
+
34
+ | Name | Type | Description |
35
+ |------|------|-------------|
36
+ | `slug` | `string` | The slug/ID of the tool to be executed |
37
+ | `body` | `ToolExecuteParams` | The parameters to be passed to the tool |
38
+ | `options?` | `ExecuteToolModifiers & ComposioRequestOptions` | Optional modifiers and request options |
39
+
40
+ **Returns**
41
+
42
+ `Promise<ToolExecuteResponse>` — The response from the tool execution
43
+
44
+ **Example**
45
+
46
+ ```typescript
47
+ const result = await composio.tools.execute('GITHUB_GET_REPOS', {
48
+ userId: 'default',
49
+ version: '20250909_00',
50
+ arguments: { owner: 'composio' }
51
+ });
52
+ ```
53
+
54
+ ```typescript
55
+ const result = await composio.tools.execute('HACKERNEWS_GET_USER', {
56
+ userId: 'default',
57
+ arguments: { userId: 'pg' },
58
+ dangerouslySkipVersionCheck: true // Allows execution with "latest" version
59
+ });
60
+ ```
61
+
62
+ ```typescript
63
+ // If toolkitVersions are set during Composio initialization, no need to pass version
64
+ const composio = new Composio({ toolkitVersions: { github: '20250909_00' } });
65
+ const result = await composio.tools.execute('GITHUB_GET_REPOS', {
66
+ userId: 'default',
67
+ arguments: { owner: 'composio' }
68
+ });
69
+ ```
70
+
71
+ ```typescript
72
+ const result = await composio.tools.execute('GITHUB_GET_ISSUES', {
73
+ userId: 'default',
74
+ version: '20250909_00',
75
+ arguments: { owner: 'composio', repo: 'sdk' }
76
+ }, {
77
+ beforeExecute: ({ toolSlug, toolkitSlug, params }) => {
78
+ console.log(`Executing ${toolSlug} from ${toolkitSlug}`);
79
+ return params;
80
+ },
81
+ afterExecute: ({ toolSlug, toolkitSlug, result }) => {
82
+ console.log(`Completed ${toolSlug}`);
83
+ return result;
84
+ }
85
+ });
86
+ ```
87
+
88
+ ```typescript
89
+ const result = await composio.tools.execute('HACKERNEWS_GET_FRONTPAGE', {
90
+ userId: 'default',
91
+ arguments: {},
92
+ dangerouslySkipVersionCheck: true,
93
+ }, { signal: AbortSignal.timeout(5_000) });
94
+ ```
95
+
96
+ ---
97
+
98
+ ### executeSessionTool()
99
+
100
+ Executes a tool based on a tool router session.
101
+
102
+ ```typescript
103
+ async executeSessionTool(toolSlug: string, body: ToolExecuteMetaParams, modifiers?: SessionExecuteMetaModifiers, tool?: Tool, options?: ToolRouterSessionExecuteOptions, requestOptions?: ComposioRequestOptions): Promise<ToolExecuteResponse>
104
+ ```
105
+
106
+ **Parameters**
107
+
108
+ | Name | Type | Description |
109
+ |------|------|-------------|
110
+ | `toolSlug` | `string` | The slug of the tool to execute |
111
+ | `body` | `ToolExecuteMetaParams` | The execution parameters |
112
+ | `modifiers?` | `SessionExecuteMetaModifiers` | The modifiers to apply to the tool |
113
+ | `tool?` | `Tool` | Optional tool schema used to resolve toolkit metadata for modifiers |
114
+ | `options?` | `ToolRouterSessionExecuteOptions` | |
115
+ | `requestOptions?` | `ComposioRequestOptions` | |
116
+
117
+ **Returns**
118
+
119
+ `Promise<ToolExecuteResponse>` — The response from the tool execution
120
+
121
+ ---
122
+
123
+ ### get()
124
+
125
+ Get a list of tools from Composio based on filters.
126
+ This method fetches the tools from the Composio API and wraps them using the provider.
127
+
128
+ **Overload 1**
129
+
130
+ ```typescript
131
+ async get(userId: string, filters: ToolListParams, options?: ProviderOptions & ComposioRequestOptions): Promise<ReturnType<T['wrapTools']>>
132
+ ```
133
+
134
+ **Parameters**
135
+
136
+ | Name | Type | Description |
137
+ |------|------|-------------|
138
+ | `userId` | `string` | The user id to get the tools for |
139
+ | `filters` | `ToolListParams` | The filters to apply when fetching tools |
140
+ | `options?` | `ProviderOptions & ComposioRequestOptions` | Provider options, modifiers, and/or AbortSignal |
141
+
142
+ **Returns**
143
+
144
+ `Promise<ReturnType<T['wrapTools']>>` — The wrapped tools collection
145
+
146
+ **Overload 2**
147
+
148
+ ```typescript
149
+ async get(userId: string, slug: string, options?: ProviderOptions & ComposioRequestOptions): Promise<ReturnType<T['wrapTools']>>
150
+ ```
151
+
152
+ **Parameters**
153
+
154
+ | Name | Type | Description |
155
+ |------|------|-------------|
156
+ | `userId` | `string` | The user id to get the tool for |
157
+ | `slug` | `string` | The slug of the tool to fetch |
158
+ | `options?` | `ProviderOptions & ComposioRequestOptions` | Optional provider options including modifiers and signal |
159
+
160
+ **Returns**
161
+
162
+ `Promise<ReturnType<T['wrapTools']>>` — The wrapped tool
163
+
164
+ **Example**
165
+
166
+ ```typescript
167
+ // Get tools from the GitHub toolkit
168
+ const tools = await composio.tools.get('default', {
169
+ toolkits: ['github'],
170
+ limit: 10
171
+ });
172
+
173
+ // Timeout a slow search after 5s
174
+ const emailTools = await composio.tools.get('default', {
175
+ search: 'send email',
176
+ }, { signal: AbortSignal.timeout(5_000) });
177
+ ```
178
+
179
+ ---
180
+
181
+ ### getInput()
182
+
183
+ Fetches the input parameters for a given tool.
184
+
185
+ This method is used to get the input parameters for a tool before executing it.
186
+
187
+ ```typescript
188
+ async getInput(slug: string, body: ToolGetInputParams, requestOptions?: ComposioRequestOptions): Promise<ToolGetInputResponse>
189
+ ```
190
+
191
+ **Parameters**
192
+
193
+ | Name | Type | Description |
194
+ |------|------|-------------|
195
+ | `slug` | `string` | The ID of the tool to find input for |
196
+ | `body` | `ToolGetInputParams` | The parameters to be passed to the tool |
197
+ | `requestOptions?` | `ComposioRequestOptions` | |
198
+
199
+ **Returns**
200
+
201
+ `Promise<ToolGetInputResponse>` — The input parameters schema for the specified tool
202
+
203
+ **Example**
204
+
205
+ ```typescript
206
+ // Get input parameters for a specific tool
207
+ const inputParams = await composio.tools.getInput('GITHUB_CREATE_ISSUE', {
208
+ userId: 'default'
209
+ });
210
+ console.log(inputParams.schema);
211
+ ```
212
+
213
+ ---
214
+
215
+ ### getRawComposioToolBySlug()
216
+
217
+ Retrieves a specific tool by its slug from the Composio API.
218
+
219
+ This method fetches a single tool in raw format without provider-specific wrapping,
220
+ providing direct access to the tool's schema and metadata. Tool versions are controlled
221
+ at the Composio SDK initialization level through the `toolkitVersions` configuration.
222
+ Local experimental custom tools are session-scoped; attach them when creating or reusing a
223
+ Tool Router session, then use `session.tools()`, `session.customTools()`, or
224
+ `session.execute()`.
225
+
226
+ ```typescript
227
+ async getRawComposioToolBySlug(slug: string, options?: ToolRetrievalOptions, requestOptions?: ComposioRequestOptions): Promise<Tool>
228
+ ```
229
+
230
+ **Parameters**
231
+
232
+ | Name | Type | Description |
233
+ |------|------|-------------|
234
+ | `slug` | `string` | The unique identifier of the tool (e.g., 'GITHUB_GET_REPOS') |
235
+ | `options?` | `ToolRetrievalOptions` | Optional configuration for tool retrieval |
236
+ | `requestOptions?` | `ComposioRequestOptions` | |
237
+
238
+ **Returns**
239
+
240
+ `Promise<Tool>` — The requested tool with its complete schema and metadata
241
+
242
+ **Example**
243
+
244
+ ```typescript
245
+ // Get a tool by slug
246
+ const tool = await composio.tools.getRawComposioToolBySlug('GITHUB_GET_REPOS');
247
+ console.log(tool.name, tool.description);
248
+
249
+ // Get a tool with schema transformation
250
+ const customizedTool = await composio.tools.getRawComposioToolBySlug(
251
+ 'SLACK_SEND_MESSAGE',
252
+ {
253
+ modifySchema: ({ toolSlug, toolkitSlug, schema }) => {
254
+ return {
255
+ ...schema,
256
+ description: `Enhanced ${schema.description} with custom modifications`,
257
+ customMetadata: {
258
+ lastModified: new Date().toISOString(),
259
+ toolkit: toolkitSlug
260
+ }
261
+ };
262
+ }
263
+ }
264
+ );
265
+
266
+ // Access tool properties
267
+ const githubTool = await composio.tools.getRawComposioToolBySlug('GITHUB_CREATE_ISSUE');
268
+ console.log({
269
+ slug: githubTool.slug,
270
+ name: githubTool.name,
271
+ toolkit: githubTool.toolkit?.name,
272
+ version: githubTool.version,
273
+ availableVersions: githubTool.availableVersions,
274
+ inputParameters: githubTool.inputParameters
275
+ });
276
+ ```
277
+
278
+ ---
279
+
280
+ ### getRawComposioTools()
281
+
282
+ Lists Composio API tools available to the SDK.
283
+
284
+ This method fetches remote Composio tools from the API in raw format. The response can be
285
+ filtered and modified as needed. Local experimental custom tools are session-scoped; attach
286
+ them when creating or reusing a Tool Router session, then use `session.tools()`,
287
+ `session.customTools()`, or `session.execute()`.
288
+ It provides access to the underlying tool data without provider-specific wrapping.
289
+
290
+ ```typescript
291
+ async getRawComposioTools(query: ToolListParams, options?: SchemaModifierOptions, requestOptions?: ComposioRequestOptions): Promise<ToolList>
292
+ ```
293
+
294
+ **Parameters**
295
+
296
+ | Name | Type | Description |
297
+ |------|------|-------------|
298
+ | `query` | `ToolListParams` | Query parameters to filter the tools (required) |
299
+ | `options?` | `SchemaModifierOptions` | Optional configuration for tool retrieval |
300
+ | `requestOptions?` | `ComposioRequestOptions` | |
301
+
302
+ **Returns**
303
+
304
+ `Promise<ToolList>` — List of tools matching the query criteria
305
+
306
+ **Example**
307
+
308
+ ```typescript
309
+ // Get tools from specific toolkits
310
+ const githubTools = await composio.tools.getRawComposioTools({
311
+ toolkits: ['github'],
312
+ limit: 10
313
+ });
314
+
315
+ // Get specific tools by slug
316
+ const specificTools = await composio.tools.getRawComposioTools({
317
+ tools: ['GITHUB_GET_REPOS', 'HACKERNEWS_GET_USER']
318
+ });
319
+
320
+ // Get tools from specific toolkits
321
+ const githubTools = await composio.tools.getRawComposioTools({
322
+ toolkits: ['github'],
323
+ limit: 10
324
+ });
325
+
326
+ // Get tools with schema transformation
327
+ const customizedTools = await composio.tools.getRawComposioTools({
328
+ toolkits: ['github'],
329
+ limit: 5
330
+ }, {
331
+ modifySchema: ({ toolSlug, toolkitSlug, schema }) => {
332
+ // Add custom properties to tool schema
333
+ return {
334
+ ...schema,
335
+ customProperty: `Modified ${toolSlug} from ${toolkitSlug}`,
336
+ tags: [...(schema.tags || []), 'customized']
337
+ };
338
+ }
339
+ });
340
+
341
+ // Search for tools
342
+ const searchResults = await composio.tools.getRawComposioTools({
343
+ search: 'user management'
344
+ });
345
+
346
+ // Get tools by authentication config
347
+ const authSpecificTools = await composio.tools.getRawComposioTools({
348
+ authConfigIds: ['auth_config_123']
349
+ });
350
+ ```
351
+
352
+ ---
353
+
354
+ ### getRawToolRouterSessionTools()
355
+
356
+ Fetches tools exposed by a tool router session.
357
+ This includes helper/meta tools plus any tools preloaded into the session.
358
+ It provides access to the underlying tool data without provider-specific wrapping.
359
+
360
+ ```typescript
361
+ async getRawToolRouterSessionTools(sessionId: string, options?: SchemaModifierOptions, requestOptions?: ComposioRequestOptions): Promise<ToolList>
362
+ ```
363
+
364
+ **Parameters**
365
+
366
+ | Name | Type | Description |
367
+ |------|------|-------------|
368
+ | `sessionId` | `string` | \{string\} The session id to get tools for |
369
+ | `options?` | `SchemaModifierOptions` | \{SchemaModifierOptions\} Optional configuration for tool retrieval |
370
+ | `requestOptions?` | `ComposioRequestOptions` | |
371
+
372
+ **Returns**
373
+
374
+ `Promise<ToolList>` — The list of session tools
375
+
376
+ **Example**
377
+
378
+ ```typescript
379
+ const sessionTools = await composio.tools.getRawToolRouterSessionTools('session_123');
380
+ console.log(sessionTools);
381
+ ```
382
+
383
+ ---
384
+
385
+ ### getToolsEnum()
386
+
387
+ Fetches the list of all available tools in the Composio SDK.
388
+
389
+ This method is mostly used by the CLI to get the list of tools.
390
+ No filtering is done on the tools, the list is cached in the backend, no further optimization is required.
391
+
392
+ ```typescript
393
+ async getToolsEnum(requestOptions?: ComposioRequestOptions): Promise<ToolRetrieveEnumResponse>
394
+ ```
395
+
396
+ **Parameters**
397
+
398
+ | Name | Type |
399
+ |------|------|
400
+ | `requestOptions?` | `ComposioRequestOptions` |
401
+
402
+ **Returns**
403
+
404
+ `Promise<ToolRetrieveEnumResponse>` — The complete list of all available tools with their metadata
405
+
406
+ **Example**
407
+
408
+ ```typescript
409
+ // Get all available tools as an enum
410
+ const toolsEnum = await composio.tools.getToolsEnum();
411
+ console.log(toolsEnum.items);
412
+ ```
413
+
414
+ ---
415
+
416
+ ### proxyExecute()
417
+
418
+ Proxies a custom request to a toolkit/integration.
419
+
420
+ This method allows sending custom requests to a specific toolkit or integration
421
+ when you need more flexibility than the standard tool execution methods provide.
422
+
423
+ ```typescript
424
+ async proxyExecute(body: ToolProxyParams, requestOptions?: ComposioRequestOptions): Promise<ToolProxyResponse>
425
+ ```
426
+
427
+ **Parameters**
428
+
429
+ | Name | Type | Description |
430
+ |------|------|-------------|
431
+ | `body` | `ToolProxyParams` | The parameters for the proxy request including toolkit slug and custom data |
432
+ | `requestOptions?` | `ComposioRequestOptions` | |
433
+
434
+ **Returns**
435
+
436
+ `Promise<ToolProxyResponse>` — The response from the proxied request
437
+
438
+ **Example**
439
+
440
+ ```typescript
441
+ // Send a custom request to a toolkit
442
+ const response = await composio.tools.proxyExecute({
443
+ toolkitSlug: 'github',
444
+ userId: 'default',
445
+ data: {
446
+ endpoint: '/repos/owner/repo/issues',
447
+ method: 'GET'
448
+ }
449
+ });
450
+ console.log(response.data);
451
+ ```
452
+
453
+ ---