@composio/client 0.1.0-alpha.68 → 0.1.0-alpha.69

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 (142) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/package.json +1 -1
  3. package/resources/auth-configs.js +6 -6
  4. package/resources/auth-configs.js.map +1 -1
  5. package/resources/auth-configs.mjs +6 -6
  6. package/resources/auth-configs.mjs.map +1 -1
  7. package/resources/cli/cli.js +2 -2
  8. package/resources/cli/cli.js.map +1 -1
  9. package/resources/cli/cli.mjs +2 -2
  10. package/resources/cli/cli.mjs.map +1 -1
  11. package/resources/cli/realtime.js +2 -2
  12. package/resources/cli/realtime.js.map +1 -1
  13. package/resources/cli/realtime.mjs +2 -2
  14. package/resources/cli/realtime.mjs.map +1 -1
  15. package/resources/connected-accounts.d.mts +164 -11
  16. package/resources/connected-accounts.d.mts.map +1 -1
  17. package/resources/connected-accounts.d.ts +164 -11
  18. package/resources/connected-accounts.d.ts.map +1 -1
  19. package/resources/connected-accounts.js +16 -7
  20. package/resources/connected-accounts.js.map +1 -1
  21. package/resources/connected-accounts.mjs +16 -7
  22. package/resources/connected-accounts.mjs.map +1 -1
  23. package/resources/files.js +2 -2
  24. package/resources/files.js.map +1 -1
  25. package/resources/files.mjs +2 -2
  26. package/resources/files.mjs.map +1 -1
  27. package/resources/link.d.mts +78 -44
  28. package/resources/link.d.mts.map +1 -1
  29. package/resources/link.d.ts +78 -44
  30. package/resources/link.d.ts.map +1 -1
  31. package/resources/link.js +1 -1
  32. package/resources/link.js.map +1 -1
  33. package/resources/link.mjs +1 -1
  34. package/resources/link.mjs.map +1 -1
  35. package/resources/logs/tools.js +2 -2
  36. package/resources/logs/tools.js.map +1 -1
  37. package/resources/logs/tools.mjs +2 -2
  38. package/resources/logs/tools.mjs.map +1 -1
  39. package/resources/logs/triggers.js +2 -2
  40. package/resources/logs/triggers.js.map +1 -1
  41. package/resources/logs/triggers.mjs +2 -2
  42. package/resources/logs/triggers.mjs.map +1 -1
  43. package/resources/mcp/custom.js +1 -1
  44. package/resources/mcp/custom.js.map +1 -1
  45. package/resources/mcp/custom.mjs +1 -1
  46. package/resources/mcp/custom.mjs.map +1 -1
  47. package/resources/mcp/generate.js +1 -1
  48. package/resources/mcp/generate.js.map +1 -1
  49. package/resources/mcp/generate.mjs +1 -1
  50. package/resources/mcp/generate.mjs.map +1 -1
  51. package/resources/mcp/mcp.js +6 -6
  52. package/resources/mcp/mcp.js.map +1 -1
  53. package/resources/mcp/mcp.mjs +6 -6
  54. package/resources/mcp/mcp.mjs.map +1 -1
  55. package/resources/migration.js +1 -1
  56. package/resources/migration.js.map +1 -1
  57. package/resources/migration.mjs +1 -1
  58. package/resources/migration.mjs.map +1 -1
  59. package/resources/project/config.js +2 -2
  60. package/resources/project/config.js.map +1 -1
  61. package/resources/project/config.mjs +2 -2
  62. package/resources/project/config.mjs.map +1 -1
  63. package/resources/tool-router/index.d.mts +1 -1
  64. package/resources/tool-router/index.d.mts.map +1 -1
  65. package/resources/tool-router/index.d.ts +1 -1
  66. package/resources/tool-router/index.d.ts.map +1 -1
  67. package/resources/tool-router/index.js.map +1 -1
  68. package/resources/tool-router/index.mjs.map +1 -1
  69. package/resources/tool-router/session/files.js +4 -7
  70. package/resources/tool-router/session/files.js.map +1 -1
  71. package/resources/tool-router/session/files.mjs +4 -7
  72. package/resources/tool-router/session/files.mjs.map +1 -1
  73. package/resources/tool-router/session/index.d.mts +1 -1
  74. package/resources/tool-router/session/index.d.mts.map +1 -1
  75. package/resources/tool-router/session/index.d.ts +1 -1
  76. package/resources/tool-router/session/index.d.ts.map +1 -1
  77. package/resources/tool-router/session/index.js.map +1 -1
  78. package/resources/tool-router/session/index.mjs.map +1 -1
  79. package/resources/tool-router/session/session.d.mts +2124 -556
  80. package/resources/tool-router/session/session.d.mts.map +1 -1
  81. package/resources/tool-router/session/session.d.ts +2124 -556
  82. package/resources/tool-router/session/session.d.ts.map +1 -1
  83. package/resources/tool-router/session/session.js +65 -29
  84. package/resources/tool-router/session/session.js.map +1 -1
  85. package/resources/tool-router/session/session.mjs +65 -29
  86. package/resources/tool-router/session/session.mjs.map +1 -1
  87. package/resources/tool-router/tool-router.d.mts +2 -2
  88. package/resources/tool-router/tool-router.d.mts.map +1 -1
  89. package/resources/tool-router/tool-router.d.ts +2 -2
  90. package/resources/tool-router/tool-router.d.ts.map +1 -1
  91. package/resources/tool-router/tool-router.js +1 -1
  92. package/resources/tool-router/tool-router.js.map +1 -1
  93. package/resources/tool-router/tool-router.mjs +1 -1
  94. package/resources/tool-router/tool-router.mjs.map +1 -1
  95. package/resources/toolkits.js +3 -3
  96. package/resources/toolkits.js.map +1 -1
  97. package/resources/toolkits.mjs +3 -3
  98. package/resources/toolkits.mjs.map +1 -1
  99. package/resources/tools.js +6 -6
  100. package/resources/tools.js.map +1 -1
  101. package/resources/tools.mjs +6 -6
  102. package/resources/tools.mjs.map +1 -1
  103. package/resources/trigger-instances/manage.js +2 -2
  104. package/resources/trigger-instances/manage.js.map +1 -1
  105. package/resources/trigger-instances/manage.mjs +2 -2
  106. package/resources/trigger-instances/manage.mjs.map +1 -1
  107. package/resources/trigger-instances/trigger-instances.js +2 -2
  108. package/resources/trigger-instances/trigger-instances.js.map +1 -1
  109. package/resources/trigger-instances/trigger-instances.mjs +2 -2
  110. package/resources/trigger-instances/trigger-instances.mjs.map +1 -1
  111. package/resources/triggers-types.js +3 -3
  112. package/resources/triggers-types.js.map +1 -1
  113. package/resources/triggers-types.mjs +3 -3
  114. package/resources/triggers-types.mjs.map +1 -1
  115. package/src/resources/auth-configs.ts +6 -6
  116. package/src/resources/cli/cli.ts +2 -2
  117. package/src/resources/cli/realtime.ts +2 -2
  118. package/src/resources/connected-accounts.ts +285 -18
  119. package/src/resources/files.ts +2 -2
  120. package/src/resources/link.ts +122 -61
  121. package/src/resources/logs/tools.ts +2 -2
  122. package/src/resources/logs/triggers.ts +2 -2
  123. package/src/resources/mcp/custom.ts +1 -1
  124. package/src/resources/mcp/generate.ts +1 -1
  125. package/src/resources/mcp/mcp.ts +6 -6
  126. package/src/resources/migration.ts +1 -1
  127. package/src/resources/project/config.ts +2 -2
  128. package/src/resources/tool-router/index.ts +6 -0
  129. package/src/resources/tool-router/session/files.ts +7 -7
  130. package/src/resources/tool-router/session/index.ts +6 -0
  131. package/src/resources/tool-router/session/session.ts +2556 -724
  132. package/src/resources/tool-router/tool-router.ts +13 -1
  133. package/src/resources/toolkits.ts +3 -3
  134. package/src/resources/tools.ts +6 -6
  135. package/src/resources/trigger-instances/manage.ts +2 -2
  136. package/src/resources/trigger-instances/trigger-instances.ts +2 -2
  137. package/src/resources/triggers-types.ts +3 -3
  138. package/src/version.ts +1 -1
  139. package/version.d.mts +1 -1
  140. package/version.d.ts +1 -1
  141. package/version.js +1 -1
  142. package/version.mjs +1 -1
@@ -37,7 +37,7 @@ export class Session extends APIResource {
37
37
  * ```
38
38
  */
39
39
  create(body: SessionCreateParams, options?: RequestOptions): APIPromise<SessionCreateResponse> {
40
- return this._client.post('/api/v3/tool_router/session', { body, ...options });
40
+ return this._client.post('/api/v3.1/tool_router/session', { body, ...options });
41
41
  }
42
42
 
43
43
  /**
@@ -52,20 +52,53 @@ export class Session extends APIResource {
52
52
  * ```
53
53
  */
54
54
  retrieve(sessionID: string, options?: RequestOptions): APIPromise<SessionRetrieveResponse> {
55
- return this._client.get(path`/api/v3/tool_router/session/${sessionID}`, options);
55
+ return this._client.get(path`/api/v3.1/tool_router/session/${sessionID}`, options);
56
56
  }
57
57
 
58
58
  /**
59
- * Executes a specific tool within a tool router session. This is the primary
60
- * execution endpoint for both meta tools and app tools exposed by the session. The
61
- * toolkit is automatically inferred from the tool slug. For app tools, the tool
62
- * must belong to an allowed toolkit and must not be disabled in the session
63
- * configuration. The endpoint validates permissions, resolves connected accounts
64
- * when needed, and executes the tool with the session context. The top-level
65
- * account field applies only to direct app tool execution in multi-account
66
- * sessions. Meta/helper tools either ignore it or define their own
67
- * account-selection fields, for example
68
- * COMPOSIO_MULTI_EXECUTE_TOOL.tools[].account.
59
+ * Fetch an existing tool router session by ID.
60
+ *
61
+ * @example
62
+ * ```ts
63
+ * const response = await client.toolRouter.session.attach(
64
+ * 'trs_1a2b3c4d5e6f',
65
+ * );
66
+ * ```
67
+ */
68
+ attach(
69
+ sessionID: string,
70
+ body: SessionAttachParams | null | undefined = {},
71
+ options?: RequestOptions,
72
+ ): APIPromise<SessionAttachResponse> {
73
+ return this._client.post(path`/api/v3.1/tool_router/session/${sessionID}/attach`, { body, ...options });
74
+ }
75
+
76
+ /**
77
+ * Returns the session config history ordered by version DESC (newest first). The
78
+ * live (current) config appears once, on the first page only, with
79
+ * `is_current: true`; archived versions have `is_current: false`.
80
+ *
81
+ * @example
82
+ * ```ts
83
+ * const response =
84
+ * await client.toolRouter.session.configHistory(
85
+ * 'trs_1a2b3c4d5e6f',
86
+ * );
87
+ * ```
88
+ */
89
+ configHistory(
90
+ sessionID: string,
91
+ query: SessionConfigHistoryParams | null | undefined = {},
92
+ options?: RequestOptions,
93
+ ): APIPromise<SessionConfigHistoryResponse> {
94
+ return this._client.get(path`/api/v3.1/tool_router/session/${sessionID}/config_history`, {
95
+ query,
96
+ ...options,
97
+ });
98
+ }
99
+
100
+ /**
101
+ * Execute a tool (meta or app) within an existing tool router session.
69
102
  *
70
103
  * @example
71
104
  * ```ts
@@ -80,13 +113,12 @@ export class Session extends APIResource {
80
113
  body: SessionExecuteParams,
81
114
  options?: RequestOptions,
82
115
  ): APIPromise<SessionExecuteResponse> {
83
- return this._client.post(path`/api/v3/tool_router/session/${sessionID}/execute`, { body, ...options });
116
+ return this._client.post(path`/api/v3.1/tool_router/session/${sessionID}/execute`, { body, ...options });
84
117
  }
85
118
 
86
119
  /**
87
- * Executes a Composio meta tool (COMPOSIO\_\*) within a tool router session. This
88
- * endpoint is kept for meta-tool compatibility; clients can also use the primary
89
- * /execute endpoint.
120
+ * Execute a Composio meta tool (COMPOSIO\_\*) within an existing tool router
121
+ * session.
90
122
  *
91
123
  * @example
92
124
  * ```ts
@@ -102,7 +134,7 @@ export class Session extends APIResource {
102
134
  body: SessionExecuteMetaParams,
103
135
  options?: RequestOptions,
104
136
  ): APIPromise<SessionExecuteMetaResponse> {
105
- return this._client.post(path`/api/v3/tool_router/session/${sessionID}/execute_meta`, {
137
+ return this._client.post(path`/api/v3.1/tool_router/session/${sessionID}/execute_meta`, {
106
138
  body,
107
139
  ...options,
108
140
  });
@@ -126,7 +158,28 @@ export class Session extends APIResource {
126
158
  body: SessionLinkParams,
127
159
  options?: RequestOptions,
128
160
  ): APIPromise<SessionLinkResponse> {
129
- return this._client.post(path`/api/v3/tool_router/session/${sessionID}/link`, { body, ...options });
161
+ return this._client.post(path`/api/v3.1/tool_router/session/${sessionID}/link`, { body, ...options });
162
+ }
163
+
164
+ /**
165
+ * Partially updates the configuration of an existing tool router session. Only the
166
+ * fields provided in the request body will be updated. Uses optimistic concurrency
167
+ * control to prevent lost updates. The previous config is stored in config
168
+ * history.
169
+ *
170
+ * @example
171
+ * ```ts
172
+ * const response = await client.toolRouter.session.patch(
173
+ * 'trs_1a2b3c4d5e6f',
174
+ * );
175
+ * ```
176
+ */
177
+ patch(
178
+ sessionID: string,
179
+ body: SessionPatchParams | null | undefined = {},
180
+ options?: RequestOptions,
181
+ ): APIPromise<SessionPatchResponse> {
182
+ return this._client.patch(path`/api/v3.1/tool_router/session/${sessionID}`, { body, ...options });
130
183
  }
131
184
 
132
185
  /**
@@ -156,16 +209,15 @@ export class Session extends APIResource {
156
209
  body: SessionProxyExecuteParams,
157
210
  options?: RequestOptions,
158
211
  ): APIPromise<SessionProxyExecuteResponse> {
159
- return this._client.post(path`/api/v3/tool_router/session/${sessionID}/proxy_execute`, {
212
+ return this._client.post(path`/api/v3.1/tool_router/session/${sessionID}/proxy_execute`, {
160
213
  body,
161
214
  ...options,
162
215
  });
163
216
  }
164
217
 
165
218
  /**
166
- * Search for tools matching a given use case query within a tool router session.
167
- * Returns matching tool slugs, full tool schemas, toolkit connection statuses, and
168
- * workflow guidance in a predictable format.
219
+ * Search for tools matching a use case query within an existing tool router
220
+ * session.
169
221
  *
170
222
  * @example
171
223
  * ```ts
@@ -184,7 +236,7 @@ export class Session extends APIResource {
184
236
  body: SessionSearchParams,
185
237
  options?: RequestOptions,
186
238
  ): APIPromise<SessionSearchResponse> {
187
- return this._client.post(path`/api/v3/tool_router/session/${sessionID}/search`, { body, ...options });
239
+ return this._client.post(path`/api/v3.1/tool_router/session/${sessionID}/search`, { body, ...options });
188
240
  }
189
241
 
190
242
  /**
@@ -204,13 +256,12 @@ export class Session extends APIResource {
204
256
  query: SessionToolkitsParams | null | undefined = {},
205
257
  options?: RequestOptions,
206
258
  ): APIPromise<SessionToolkitsResponse> {
207
- return this._client.get(path`/api/v3/tool_router/session/${sessionID}/toolkits`, { query, ...options });
259
+ return this._client.get(path`/api/v3.1/tool_router/session/${sessionID}/toolkits`, { query, ...options });
208
260
  }
209
261
 
210
262
  /**
211
- * Returns the tools available in a tool router session with their complete
212
- * schemas. This includes both meta tools and any preloaded app tools exposed by
213
- * the session.
263
+ * Returns tools available in a tool router session with complete schemas. Results
264
+ * are paginated; use `next_cursor` to fetch the next page.
214
265
  *
215
266
  * @example
216
267
  * ```ts
@@ -221,16 +272,16 @@ export class Session extends APIResource {
221
272
  */
222
273
  tools(
223
274
  sessionID: string,
224
- query?: SessionToolsParams | null | undefined,
275
+ query: SessionToolsParams | null | undefined = {},
225
276
  options?: RequestOptions,
226
277
  ): APIPromise<SessionToolsResponse> {
227
- return this._client.get(path`/api/v3/tool_router/session/${sessionID}/tools`, options);
278
+ return this._client.get(path`/api/v3.1/tool_router/session/${sessionID}/tools`, { query, ...options });
228
279
  }
229
280
  }
230
281
 
231
282
  export interface SessionCreateResponse {
232
283
  /**
233
- * The session configuration including user, toolkits, and overrides
284
+ * The configuration used to create this session
234
285
  */
235
286
  config: SessionCreateResponse.Config;
236
287
 
@@ -267,18 +318,25 @@ export interface SessionCreateResponse {
267
318
 
268
319
  export namespace SessionCreateResponse {
269
320
  /**
270
- * The session configuration including user, toolkits, and overrides
321
+ * The configuration used to create this session
271
322
  */
272
323
  export interface Config {
273
324
  /**
274
- * Preload configuration. Controls which tools appear in `session.tools` and the
275
- * MCP server tool list, callable directly without going through search. Each
276
- * preloaded tool adds to the agent context — roughly ≤20 tools is recommended.
277
- * Always present in the response (empty `tools: []` when the session was created
278
- * without a preload config).
325
+ * Execute helper configuration
326
+ */
327
+ execute: Config.Execute;
328
+
329
+ /**
330
+ * Preload configuration. Explicit slugs are returned as an array; dynamic preload
331
+ * is returned as "all".
279
332
  */
280
333
  preload: Config.Preload;
281
334
 
335
+ /**
336
+ * Search helper configuration
337
+ */
338
+ search: Config.Search;
339
+
282
340
  /**
283
341
  * User identifier for this session
284
342
  */
@@ -330,19 +388,29 @@ export namespace SessionCreateResponse {
330
388
 
331
389
  export namespace Config {
332
390
  /**
333
- * Preload configuration. Controls which tools appear in `session.tools` and the
334
- * MCP server tool list, callable directly without going through search. Each
335
- * preloaded tool adds to the agent context — roughly ≤20 tools is recommended.
336
- * Always present in the response (empty `tools: []` when the session was created
337
- * without a preload config).
391
+ * Execute helper configuration
392
+ */
393
+ export interface Execute {
394
+ enable_multi_execute?: boolean;
395
+ }
396
+
397
+ /**
398
+ * Preload configuration. Explicit slugs are returned as an array; dynamic preload
399
+ * is returned as "all".
338
400
  */
339
401
  export interface Preload {
340
402
  /**
341
- * Tool slugs preloaded for this session. Appear in `session.tools` and the MCP
342
- * server tool list, callable directly without going through search. Empty array
343
- * when no preload was configured.
403
+ * Explicit preloaded tool slugs, or "all" when the session dynamically exposes all
404
+ * app tools allowed by its filters.
344
405
  */
345
- tools: Array<string>;
406
+ tools: Array<string> | 'all';
407
+ }
408
+
409
+ /**
410
+ * Search helper configuration
411
+ */
412
+ export interface Search {
413
+ enable?: boolean;
346
414
  }
347
415
 
348
416
  /**
@@ -579,7 +647,7 @@ export namespace SessionCreateResponse {
579
647
 
580
648
  export interface SessionRetrieveResponse {
581
649
  /**
582
- * The session configuration including user, toolkits, and overrides
650
+ * The configuration used to create this session
583
651
  */
584
652
  config: SessionRetrieveResponse.Config;
585
653
 
@@ -615,18 +683,25 @@ export interface SessionRetrieveResponse {
615
683
 
616
684
  export namespace SessionRetrieveResponse {
617
685
  /**
618
- * The session configuration including user, toolkits, and overrides
686
+ * The configuration used to create this session
619
687
  */
620
688
  export interface Config {
621
689
  /**
622
- * Preload configuration. Controls which tools appear in `session.tools` and the
623
- * MCP server tool list, callable directly without going through search. Each
624
- * preloaded tool adds to the agent context — roughly ≤20 tools is recommended.
625
- * Always present in the response (empty `tools: []` when the session was created
626
- * without a preload config).
690
+ * Execute helper configuration
691
+ */
692
+ execute: Config.Execute;
693
+
694
+ /**
695
+ * Preload configuration. Explicit slugs are returned as an array; dynamic preload
696
+ * is returned as "all".
627
697
  */
628
698
  preload: Config.Preload;
629
699
 
700
+ /**
701
+ * Search helper configuration
702
+ */
703
+ search: Config.Search;
704
+
630
705
  /**
631
706
  * User identifier for this session
632
707
  */
@@ -678,19 +753,29 @@ export namespace SessionRetrieveResponse {
678
753
 
679
754
  export namespace Config {
680
755
  /**
681
- * Preload configuration. Controls which tools appear in `session.tools` and the
682
- * MCP server tool list, callable directly without going through search. Each
683
- * preloaded tool adds to the agent context — roughly ≤20 tools is recommended.
684
- * Always present in the response (empty `tools: []` when the session was created
685
- * without a preload config).
756
+ * Execute helper configuration
757
+ */
758
+ export interface Execute {
759
+ enable_multi_execute?: boolean;
760
+ }
761
+
762
+ /**
763
+ * Preload configuration. Explicit slugs are returned as an array; dynamic preload
764
+ * is returned as "all".
686
765
  */
687
766
  export interface Preload {
688
767
  /**
689
- * Tool slugs preloaded for this session. Appear in `session.tools` and the MCP
690
- * server tool list, callable directly without going through search. Empty array
691
- * when no preload was configured.
768
+ * Explicit preloaded tool slugs, or "all" when the session dynamically exposes all
769
+ * app tools allowed by its filters.
692
770
  */
693
- tools: Array<string>;
771
+ tools: Array<string> | 'all';
772
+ }
773
+
774
+ /**
775
+ * Search helper configuration
776
+ */
777
+ export interface Search {
778
+ enable?: boolean;
694
779
  }
695
780
 
696
781
  /**
@@ -924,436 +1009,374 @@ export namespace SessionRetrieveResponse {
924
1009
  }
925
1010
  }
926
1011
 
927
- export interface SessionExecuteResponse {
928
- /**
929
- * The data returned by the tool execution
930
- */
931
- data: { [key: string]: unknown };
932
-
933
- /**
934
- * Error message if the execution failed, null otherwise
935
- */
936
- error: string | null;
937
-
938
- /**
939
- * Unique identifier for the execution log
940
- */
941
- log_id: string;
942
- }
943
-
944
- export interface SessionExecuteMetaResponse {
945
- /**
946
- * The data returned by the tool execution
947
- */
948
- data: { [key: string]: unknown };
949
-
950
- /**
951
- * Error message if the execution failed, null otherwise
952
- */
953
- error: string | null;
954
-
955
- /**
956
- * Unique identifier for the execution log
957
- */
958
- log_id: string;
959
- }
960
-
961
- export interface SessionLinkResponse {
1012
+ export interface SessionAttachResponse {
962
1013
  /**
963
- * The unique identifier for the connected account
1014
+ * The configuration used to create this session
964
1015
  */
965
- connected_account_id: string;
1016
+ config: SessionAttachResponse.Config;
966
1017
 
967
1018
  /**
968
- * Token used to complete the authentication flow
1019
+ * Monotonic version of the config. Incremented on each PATCH. Use for optimistic
1020
+ * concurrency control.
969
1021
  */
970
- link_token: string;
1022
+ config_version: number;
971
1023
 
972
- /**
973
- * The URL where users should be redirected to complete OAuth
974
- */
975
- redirect_url: string;
976
- }
1024
+ mcp: SessionAttachResponse.Mcp;
977
1025
 
978
- export interface SessionProxyExecuteResponse {
979
1026
  /**
980
- * The HTTP status code returned from the proxied API
1027
+ * The identifier of the session
981
1028
  */
982
- status: number;
1029
+ session_id: string;
983
1030
 
984
1031
  /**
985
- * Binary body response data. Present when the response is a binary file.
1032
+ * List of available tools in this session
986
1033
  */
987
- binary_data?: SessionProxyExecuteResponse.BinaryData;
1034
+ tool_router_tools: Array<string>;
988
1035
 
989
1036
  /**
990
- * The response data returned from the proxied API
1037
+ * Experimental features
991
1038
  */
992
- data?: unknown;
1039
+ experimental?: SessionAttachResponse.Experimental;
993
1040
 
994
1041
  /**
995
- * The HTTP headers returned from the proxied API
1042
+ * Advisory list the session exists and is usable, but the listed issues may
1043
+ * warrant attention.
996
1044
  */
997
- headers?: { [key: string]: string };
1045
+ warnings?: Array<SessionAttachResponse.Warning>;
998
1046
  }
999
1047
 
1000
- export namespace SessionProxyExecuteResponse {
1048
+ export namespace SessionAttachResponse {
1001
1049
  /**
1002
- * Binary body response data. Present when the response is a binary file.
1050
+ * The configuration used to create this session
1003
1051
  */
1004
- export interface BinaryData {
1052
+ export interface Config {
1005
1053
  /**
1006
- * Content-Type of the binary data
1054
+ * Execute helper configuration
1007
1055
  */
1008
- content_type: string;
1056
+ execute: Config.Execute;
1009
1057
 
1010
1058
  /**
1011
- * File size in bytes
1059
+ * Preload configuration. Explicit slugs are returned as an array; dynamic preload
1060
+ * is returned as "all".
1012
1061
  */
1013
- size: number;
1062
+ preload: Config.Preload;
1014
1063
 
1015
1064
  /**
1016
- * URL to download binary content
1065
+ * Search helper configuration
1017
1066
  */
1018
- url: string;
1067
+ search: Config.Search;
1019
1068
 
1020
1069
  /**
1021
- * ISO 8601 timestamp when the URL expires
1070
+ * User identifier for this session
1022
1071
  */
1023
- expires_at?: string;
1024
- }
1025
- }
1026
-
1027
- export interface SessionSearchResponse {
1028
- /**
1029
- * Error message if any searches failed, null if all succeeded. Format: "X out of Y
1030
- * searches failed, reasons: <details>"
1031
- */
1032
- error: string | null;
1033
-
1034
- /**
1035
- * Combined workflow guidance covering connections, planner, and memory usage. Each
1036
- * element is a step instruction.
1037
- */
1038
- next_steps_guidance: Array<string>;
1039
-
1040
- /**
1041
- * Per-query search results with tools, reasoning, and memory. One entry per query
1042
- * in request order.
1043
- */
1044
- results: Array<SessionSearchResponse.Result>;
1045
-
1046
- /**
1047
- * Session info for correlating meta tool calls
1048
- */
1049
- session: SessionSearchResponse.Session;
1050
-
1051
- /**
1052
- * Whether all searches completed successfully. False if any query failed.
1053
- */
1054
- success: boolean;
1055
-
1056
- /**
1057
- * Time information for the query
1058
- */
1059
- time_info: SessionSearchResponse.TimeInfo;
1060
-
1061
- /**
1062
- * Deduplicated tool definitions keyed by tool_slug for O(1) lookup. Each tool
1063
- * appears once even if used in multiple queries.
1064
- */
1065
- tool_schemas: { [key: string]: SessionSearchResponse.ToolSchemas };
1066
-
1067
- /**
1068
- * Connection status for all toolkits mentioned across all queries, with
1069
- * descriptions merged in.
1070
- */
1071
- toolkit_connection_statuses: Array<SessionSearchResponse.ToolkitConnectionStatus>;
1072
- }
1072
+ user_id: string;
1073
1073
 
1074
- export namespace SessionSearchResponse {
1075
- export interface Result {
1076
1074
  /**
1077
- * 1-based index of the query in the request
1075
+ * Auth config overrides per toolkit
1078
1076
  */
1079
- index: number;
1077
+ auth_configs?: { [key: string]: string };
1080
1078
 
1081
1079
  /**
1082
- * List of main tool slugs matching the search criteria
1080
+ * Connected account overrides per toolkit. Each connected account must belong to
1081
+ * the same user_id as the session.
1083
1082
  */
1084
- primary_tool_slugs: Array<string>;
1083
+ connected_accounts?: { [key: string]: string };
1085
1084
 
1086
1085
  /**
1087
- * List of related tool slugs that might be useful
1086
+ * Manage connections configuration
1088
1087
  */
1089
- related_tool_slugs: Array<string>;
1088
+ manage_connections?: Config.ManageConnections;
1090
1089
 
1091
1090
  /**
1092
- * List of unique toolkit slugs used by tools in this query
1091
+ * Multi-account configuration for this session.
1093
1092
  */
1094
- toolkits: Array<string>;
1093
+ multi_account?: Config.MultiAccount;
1095
1094
 
1096
1095
  /**
1097
- * The use case that was searched
1096
+ * MCP tool annotation hints for filtering tools with enabled/disabled support.
1097
+ * enabled: tags that the tool must have at least one of. disabled: tags that the
1098
+ * tool must NOT have any of. Both conditions must be satisfied.
1098
1099
  */
1099
- use_case: string;
1100
+ tags?: Config.Tags;
1100
1101
 
1101
1102
  /**
1102
- * Task difficulty assessment (e.g., "easy - Simple single-tool operation with
1103
- * known parameters")
1103
+ * Toolkit configuration - either enabled list or disabled list
1104
1104
  */
1105
- difficulty?: string;
1105
+ toolkits?: Config.Enabled | Config.Disabled;
1106
1106
 
1107
1107
  /**
1108
- * Error message if the search for this query failed, null otherwise. Always
1109
- * present for failed queries.
1108
+ * Tool-level configuration per toolkit
1110
1109
  */
1111
- error?: string | null;
1110
+ tools?: { [key: string]: Config.Enabled | Config.Disabled | Config.Tags };
1112
1111
 
1113
1112
  /**
1114
- * Guidance message about the search results, particularly when a cached plan is
1115
- * available
1113
+ * Workbench configuration
1116
1114
  */
1117
- execution_guidance?: string;
1115
+ workbench?: Config.Workbench;
1116
+ }
1118
1117
 
1118
+ export namespace Config {
1119
1119
  /**
1120
- * Common pitfalls and considerations (only present when cached plan is available)
1120
+ * Execute helper configuration
1121
1121
  */
1122
- known_pitfalls?: Array<string>;
1122
+ export interface Execute {
1123
+ enable_multi_execute?: boolean;
1124
+ }
1123
1125
 
1124
1126
  /**
1125
- * Memory data relevant to this query, grouped by app. Only present for non-cached
1126
- * search results.
1127
+ * Preload configuration. Explicit slugs are returned as an array; dynamic preload
1128
+ * is returned as "all".
1127
1129
  */
1128
- memory?: { [key: string]: Array<string> };
1130
+ export interface Preload {
1131
+ /**
1132
+ * Explicit preloaded tool slugs, or "all" when the session dynamically exposes all
1133
+ * app tools allowed by its filters.
1134
+ */
1135
+ tools: Array<string> | 'all';
1136
+ }
1129
1137
 
1130
1138
  /**
1131
- * ID of cached plan if available
1139
+ * Search helper configuration
1132
1140
  */
1133
- plan_id?: string;
1141
+ export interface Search {
1142
+ enable?: boolean;
1143
+ }
1134
1144
 
1135
1145
  /**
1136
- * Workflow steps from cached plan (only present when cached plan is available)
1146
+ * Manage connections configuration
1137
1147
  */
1138
- recommended_plan_steps?: Array<string>;
1139
-
1140
- /**
1141
- * Reference Python code snippets for processing tool responses in the workbench
1142
- * (only present when cached plan is available)
1143
- */
1144
- reference_workbench_snippets?: Array<Result.ReferenceWorkbenchSnippet>;
1145
- }
1148
+ export interface ManageConnections {
1149
+ /**
1150
+ * Custom callback URL for connected account auth flows
1151
+ */
1152
+ callback_url?: string;
1146
1153
 
1147
- export namespace Result {
1148
- export interface ReferenceWorkbenchSnippet {
1149
1154
  /**
1150
- * Python code snippet for the workbench
1155
+ * Enable the "remove" action in COMPOSIO_MANAGE_CONNECTIONS. Default true.
1151
1156
  */
1152
- code: string;
1157
+ enable_connection_removal?: boolean;
1153
1158
 
1154
1159
  /**
1155
- * Description of what the code snippet does
1160
+ * Enable the COMPOSIO_WAIT_FOR_CONNECTIONS tool for polling connection status.
1161
+ * Default false. May not work reliably with GPT models.
1156
1162
  */
1157
- description: string;
1158
- }
1159
- }
1163
+ enable_wait_for_connections?: boolean;
1160
1164
 
1161
- /**
1162
- * Session info for correlating meta tool calls
1163
- */
1164
- export interface Session {
1165
- /**
1166
- * Session identifier to be passed to subsequent meta tool calls as session_id.
1167
- */
1168
- id: string;
1165
+ /**
1166
+ * Whether to enable the connection manager for automatic connection handling
1167
+ */
1168
+ enabled?: boolean;
1169
+ }
1169
1170
 
1170
1171
  /**
1171
- * Whether a fresh session id was generated in this call.
1172
+ * Multi-account configuration for this session.
1172
1173
  */
1173
- generate_id: boolean;
1174
+ export interface MultiAccount {
1175
+ /**
1176
+ * When true, enables multi-account mode for this session. When not set, falls back
1177
+ * to org/project-level configuration.
1178
+ */
1179
+ enable?: boolean;
1174
1180
 
1175
- /**
1176
- * LLM-facing guidance on how to reuse this session id
1177
- */
1178
- instructions: string;
1179
- }
1181
+ /**
1182
+ * Maximum number of connected accounts allowed per toolkit. Defaults to 5 when
1183
+ * multi-account is enabled.
1184
+ */
1185
+ max_accounts_per_toolkit?: number;
1180
1186
 
1181
- /**
1182
- * Time information for the query
1183
- */
1184
- export interface TimeInfo {
1185
- /**
1186
- * Current time in ISO format (UTC)
1187
- */
1188
- current_time_utc: string;
1187
+ /**
1188
+ * When true, require explicit account selection when multiple accounts are
1189
+ * connected. When false (default), use the first/default account.
1190
+ */
1191
+ require_explicit_selection?: boolean;
1192
+ }
1189
1193
 
1190
1194
  /**
1191
- * Current time as Unix epoch timestamp in seconds
1195
+ * MCP tool annotation hints for filtering tools with enabled/disabled support.
1196
+ * enabled: tags that the tool must have at least one of. disabled: tags that the
1197
+ * tool must NOT have any of. Both conditions must be satisfied.
1192
1198
  */
1193
- current_time_utc_epoch_seconds: number;
1199
+ export interface Tags {
1200
+ /**
1201
+ * Tags that the tool must NOT have any of
1202
+ */
1203
+ disabled?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>;
1194
1204
 
1195
- /**
1196
- * Important message about time handling and timezone considerations
1197
- */
1198
- message: string;
1199
- }
1205
+ /**
1206
+ * Tags that the tool must have at least one of
1207
+ */
1208
+ enabled?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>;
1209
+ }
1200
1210
 
1201
- export interface ToolSchemas {
1202
- /**
1203
- * The slug of the tool
1204
- */
1205
- tool_slug: string;
1211
+ export interface Enabled {
1212
+ enabled: Array<string>;
1213
+ }
1206
1214
 
1207
- /**
1208
- * The slug of the toolkit that provides this tool
1209
- */
1210
- toolkit: string;
1215
+ export interface Disabled {
1216
+ disabled: Array<string>;
1217
+ }
1211
1218
 
1212
- /**
1213
- * Description of the tool
1214
- */
1215
- description?: string;
1219
+ export interface Enabled {
1220
+ enabled: Array<string>;
1221
+ }
1216
1222
 
1217
- /**
1218
- * Whether the full input_schema is included in this response
1219
- */
1220
- hasFullSchema?: boolean;
1223
+ export interface Disabled {
1224
+ disabled: Array<string>;
1225
+ }
1221
1226
 
1222
- /**
1223
- * Input schema for the tool (only present when hasFullSchema is true)
1224
- */
1225
- input_schema?: { [key: string]: unknown };
1227
+ export interface Tags {
1228
+ tags: Tags.Tags;
1229
+ }
1226
1230
 
1227
- /**
1228
- * Output/response schema for the tool. Only included when include_output_schemas
1229
- * is true.
1230
- */
1231
- output_schema?: { [key: string]: unknown };
1231
+ export namespace Tags {
1232
+ export interface Tags {
1233
+ /**
1234
+ * Tags that the tool must NOT have any of
1235
+ */
1236
+ disabled?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>;
1232
1237
 
1233
- /**
1234
- * Reference to fetch full schema when hasFullSchema is false
1235
- */
1236
- schemaRef?: ToolSchemas.SchemaRef;
1237
- }
1238
+ /**
1239
+ * Tags that the tool must have at least one of
1240
+ */
1241
+ enabled?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>;
1242
+ }
1243
+ }
1238
1244
 
1239
- export namespace ToolSchemas {
1240
1245
  /**
1241
- * Reference to fetch full schema when hasFullSchema is false
1246
+ * Workbench configuration
1242
1247
  */
1243
- export interface SchemaRef {
1248
+ export interface Workbench {
1244
1249
  /**
1245
- * Arguments to pass to the tool
1250
+ * Character threshold after which tool execution response are saved to a file in
1251
+ * workbench. Default is 20k.
1246
1252
  */
1247
- args: SchemaRef.Args;
1253
+ auto_offload_threshold?: number;
1248
1254
 
1249
1255
  /**
1250
- * Tool to call
1256
+ * Whether the workbench (code execution sandbox) is enabled. When false,
1257
+ * COMPOSIO_REMOTE_WORKBENCH and COMPOSIO_REMOTE_BASH_TOOL are not exposed.
1251
1258
  */
1252
- tool: 'COMPOSIO_GET_TOOL_SCHEMAS';
1259
+ enable?: boolean;
1253
1260
 
1254
1261
  /**
1255
- * Instruction message for the LLM
1262
+ * Whether proxy execution is enabled in the workbench
1256
1263
  */
1257
- message?: string;
1258
- }
1264
+ proxy_execution_enabled?: boolean;
1259
1265
 
1260
- export namespace SchemaRef {
1261
1266
  /**
1262
- * Arguments to pass to the tool
1267
+ * Sandbox compute tier: standard (1 vCPU / 1 GB), medium (2 vCPU / 2 GB), large (4
1268
+ * vCPU / 4 GB), xlarge (8 vCPU / 8 GB). Defaults to standard.
1263
1269
  */
1264
- export interface Args {
1265
- /**
1266
- * Tool slugs to fetch schemas for
1267
- */
1268
- tool_slugs: Array<string>;
1269
- }
1270
+ sandbox_size?: 'standard' | 'medium' | 'large' | 'xlarge';
1270
1271
  }
1271
1272
  }
1272
1273
 
1273
- export interface ToolkitConnectionStatus {
1274
+ export interface Mcp {
1274
1275
  /**
1275
- * Description of what the toolkit does and its capabilities
1276
+ * The type of the MCP server. Can be http
1276
1277
  */
1277
- description: string;
1278
+ type: 'http';
1278
1279
 
1279
1280
  /**
1280
- * Whether an active connection exists for this toolkit
1281
+ * The URL of the MCP server
1281
1282
  */
1282
- has_active_connection: boolean;
1283
+ url: string;
1284
+ }
1283
1285
 
1286
+ /**
1287
+ * Experimental features
1288
+ */
1289
+ export interface Experimental {
1284
1290
  /**
1285
- * Human-readable message about the connection status and next steps
1291
+ * The assistive system prompt for the tool router session
1286
1292
  */
1287
- status_message: string;
1293
+ assistive_prompt?: string;
1288
1294
 
1289
1295
  /**
1290
- * The toolkit slug identifier (e.g., "gmail", "slack")
1296
+ * User-defined custom toolkits with grouped tools (no-auth)
1291
1297
  */
1292
- toolkit: string;
1298
+ custom_toolkits?: Array<Experimental.CustomToolkit>;
1293
1299
 
1294
1300
  /**
1295
- * When "required", the agent must specify which account to use. Present only when
1296
- * multiple accounts exist.
1301
+ * Custom tools standalone or extending Composio toolkits
1297
1302
  */
1298
- account_selection?: 'required';
1303
+ custom_tools?: Array<Experimental.CustomTool>;
1304
+ }
1299
1305
 
1300
- /**
1301
- * List of connected accounts for this toolkit. Present when multi-account is
1302
- * enabled.
1303
- */
1304
- accounts?: Array<ToolkitConnectionStatus.Account>;
1306
+ export namespace Experimental {
1307
+ export interface CustomToolkit {
1308
+ description: string;
1305
1309
 
1306
- /**
1307
- * Connection details including auth config and connected account IDs. Only present
1308
- * when has_active_connection is true.
1309
- */
1310
- connection_details?: { [key: string]: unknown };
1310
+ name: string;
1311
1311
 
1312
- /**
1313
- * Information about the currently connected user (email, name, etc.)
1314
- */
1315
- current_user_info?: { [key: string]: unknown };
1316
- }
1312
+ slug: string;
1317
1313
 
1318
- export namespace ToolkitConnectionStatus {
1319
- export interface Account {
1320
- /**
1321
- * Unique identifier for this account
1322
- */
1323
- id: string;
1314
+ tools: Array<CustomToolkit.Tool>;
1315
+ }
1324
1316
 
1325
- /**
1326
- * ISO 8601 timestamp of when the account was connected
1327
- */
1328
- created_at: string;
1317
+ export namespace CustomToolkit {
1318
+ export interface Tool {
1319
+ description: string;
1329
1320
 
1330
- /**
1331
- * Whether this is the default account for the toolkit
1332
- */
1333
- is_default: boolean;
1321
+ input_schema: { [key: string]: unknown };
1334
1322
 
1335
- /**
1336
- * Connection status (e.g., "active")
1337
- */
1338
- status: string;
1323
+ name: string;
1339
1324
 
1340
- /**
1341
- * User-assigned alias for this account
1342
- */
1343
- alias?: string;
1325
+ /**
1326
+ * Original tool slug as provided by the user
1327
+ */
1328
+ original_slug: string;
1329
+
1330
+ /**
1331
+ * Prefixed tool slug (e.g. LOCAL_CRM_FIND_CUSTOMER)
1332
+ */
1333
+ slug: string;
1334
+
1335
+ output_schema?: { [key: string]: unknown };
1336
+ }
1337
+ }
1338
+
1339
+ export interface CustomTool {
1340
+ description: string;
1341
+
1342
+ input_schema: { [key: string]: unknown };
1343
+
1344
+ name: string;
1344
1345
 
1345
1346
  /**
1346
- * Information about the connected user (email, name, etc.)
1347
+ * Original tool slug as provided by the user
1347
1348
  */
1348
- user_info?: { [key: string]: unknown };
1349
+ original_slug: string;
1350
+
1351
+ /**
1352
+ * Prefixed tool slug (e.g. LOCAL_GMAIL_GET_IMPORTANT_EMAILS)
1353
+ */
1354
+ slug: string;
1355
+
1356
+ extends_toolkit?: string;
1357
+
1358
+ output_schema?: { [key: string]: unknown };
1349
1359
  }
1350
1360
  }
1361
+
1362
+ export interface Warning {
1363
+ /**
1364
+ * Stable machine code identifying the advisory. Safe to switch on in client code.
1365
+ */
1366
+ code: 'PRELOAD_TOOLS_HIGH_CONTEXT_USAGE';
1367
+
1368
+ /**
1369
+ * Human-readable description of the advisory. Suitable for logging or surfacing to
1370
+ * end users.
1371
+ */
1372
+ message: string;
1373
+ }
1351
1374
  }
1352
1375
 
1353
- export interface SessionToolkitsResponse {
1376
+ export interface SessionConfigHistoryResponse {
1354
1377
  current_page: number;
1355
1378
 
1356
- items: Array<SessionToolkitsResponse.Item>;
1379
+ items: Array<SessionConfigHistoryResponse.Item>;
1357
1380
 
1358
1381
  total_items: number;
1359
1382
 
@@ -1362,356 +1385,2036 @@ export interface SessionToolkitsResponse {
1362
1385
  next_cursor?: string | null;
1363
1386
  }
1364
1387
 
1365
- export namespace SessionToolkitsResponse {
1388
+ export namespace SessionConfigHistoryResponse {
1366
1389
  export interface Item {
1367
1390
  /**
1368
- * Available Composio-managed auth schemes
1391
+ * The session configuration at this version
1369
1392
  */
1370
- composio_managed_auth_schemes: Array<string>;
1393
+ config: Item.Config;
1371
1394
 
1372
1395
  /**
1373
- * Connected account if available
1396
+ * ISO timestamp. For history rows, when the entry was archived (i.e. the moment
1397
+ * the version was superseded by a PATCH).
1374
1398
  */
1375
- connected_account: Item.ConnectedAccount | null;
1399
+ created_at: string;
1400
+
1401
+ /**
1402
+ * True only for the live (current) session config, present on the first page.
1403
+ * False for archived history rows.
1404
+ */
1405
+ is_current: boolean;
1406
+
1407
+ /**
1408
+ * The config version this entry represents
1409
+ */
1410
+ version: number;
1411
+ }
1412
+
1413
+ export namespace Item {
1414
+ /**
1415
+ * The session configuration at this version
1416
+ */
1417
+ export interface Config {
1418
+ /**
1419
+ * Execute helper configuration
1420
+ */
1421
+ execute: Config.Execute;
1422
+
1423
+ /**
1424
+ * Preload configuration. Explicit slugs are returned as an array; dynamic preload
1425
+ * is returned as "all".
1426
+ */
1427
+ preload: Config.Preload;
1428
+
1429
+ /**
1430
+ * Search helper configuration
1431
+ */
1432
+ search: Config.Search;
1433
+
1434
+ /**
1435
+ * User identifier for this session
1436
+ */
1437
+ user_id: string;
1438
+
1439
+ /**
1440
+ * Auth config overrides per toolkit
1441
+ */
1442
+ auth_configs?: { [key: string]: string };
1443
+
1444
+ /**
1445
+ * Connected account overrides per toolkit. Each connected account must belong to
1446
+ * the same user_id as the session.
1447
+ */
1448
+ connected_accounts?: { [key: string]: string };
1449
+
1450
+ /**
1451
+ * Manage connections configuration
1452
+ */
1453
+ manage_connections?: Config.ManageConnections;
1454
+
1455
+ /**
1456
+ * Multi-account configuration for this session.
1457
+ */
1458
+ multi_account?: Config.MultiAccount;
1459
+
1460
+ /**
1461
+ * MCP tool annotation hints for filtering tools with enabled/disabled support.
1462
+ * enabled: tags that the tool must have at least one of. disabled: tags that the
1463
+ * tool must NOT have any of. Both conditions must be satisfied.
1464
+ */
1465
+ tags?: Config.Tags;
1466
+
1467
+ /**
1468
+ * Toolkit configuration - either enabled list or disabled list
1469
+ */
1470
+ toolkits?: Config.Enabled | Config.Disabled;
1471
+
1472
+ /**
1473
+ * Tool-level configuration per toolkit
1474
+ */
1475
+ tools?: { [key: string]: Config.Enabled | Config.Disabled | Config.Tags };
1476
+
1477
+ /**
1478
+ * Workbench configuration
1479
+ */
1480
+ workbench?: Config.Workbench;
1481
+ }
1482
+
1483
+ export namespace Config {
1484
+ /**
1485
+ * Execute helper configuration
1486
+ */
1487
+ export interface Execute {
1488
+ enable_multi_execute?: boolean;
1489
+ }
1490
+
1491
+ /**
1492
+ * Preload configuration. Explicit slugs are returned as an array; dynamic preload
1493
+ * is returned as "all".
1494
+ */
1495
+ export interface Preload {
1496
+ /**
1497
+ * Explicit preloaded tool slugs, or "all" when the session dynamically exposes all
1498
+ * app tools allowed by its filters.
1499
+ */
1500
+ tools: Array<string> | 'all';
1501
+ }
1502
+
1503
+ /**
1504
+ * Search helper configuration
1505
+ */
1506
+ export interface Search {
1507
+ enable?: boolean;
1508
+ }
1509
+
1510
+ /**
1511
+ * Manage connections configuration
1512
+ */
1513
+ export interface ManageConnections {
1514
+ /**
1515
+ * Custom callback URL for connected account auth flows
1516
+ */
1517
+ callback_url?: string;
1518
+
1519
+ /**
1520
+ * Enable the "remove" action in COMPOSIO_MANAGE_CONNECTIONS. Default true.
1521
+ */
1522
+ enable_connection_removal?: boolean;
1523
+
1524
+ /**
1525
+ * Enable the COMPOSIO_WAIT_FOR_CONNECTIONS tool for polling connection status.
1526
+ * Default false. May not work reliably with GPT models.
1527
+ */
1528
+ enable_wait_for_connections?: boolean;
1529
+
1530
+ /**
1531
+ * Whether to enable the connection manager for automatic connection handling
1532
+ */
1533
+ enabled?: boolean;
1534
+ }
1535
+
1536
+ /**
1537
+ * Multi-account configuration for this session.
1538
+ */
1539
+ export interface MultiAccount {
1540
+ /**
1541
+ * When true, enables multi-account mode for this session. When not set, falls back
1542
+ * to org/project-level configuration.
1543
+ */
1544
+ enable?: boolean;
1545
+
1546
+ /**
1547
+ * Maximum number of connected accounts allowed per toolkit. Defaults to 5 when
1548
+ * multi-account is enabled.
1549
+ */
1550
+ max_accounts_per_toolkit?: number;
1551
+
1552
+ /**
1553
+ * When true, require explicit account selection when multiple accounts are
1554
+ * connected. When false (default), use the first/default account.
1555
+ */
1556
+ require_explicit_selection?: boolean;
1557
+ }
1558
+
1559
+ /**
1560
+ * MCP tool annotation hints for filtering tools with enabled/disabled support.
1561
+ * enabled: tags that the tool must have at least one of. disabled: tags that the
1562
+ * tool must NOT have any of. Both conditions must be satisfied.
1563
+ */
1564
+ export interface Tags {
1565
+ /**
1566
+ * Tags that the tool must NOT have any of
1567
+ */
1568
+ disabled?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>;
1569
+
1570
+ /**
1571
+ * Tags that the tool must have at least one of
1572
+ */
1573
+ enabled?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>;
1574
+ }
1575
+
1576
+ export interface Enabled {
1577
+ enabled: Array<string>;
1578
+ }
1579
+
1580
+ export interface Disabled {
1581
+ disabled: Array<string>;
1582
+ }
1583
+
1584
+ export interface Enabled {
1585
+ enabled: Array<string>;
1586
+ }
1587
+
1588
+ export interface Disabled {
1589
+ disabled: Array<string>;
1590
+ }
1591
+
1592
+ export interface Tags {
1593
+ tags: Tags.Tags;
1594
+ }
1595
+
1596
+ export namespace Tags {
1597
+ export interface Tags {
1598
+ /**
1599
+ * Tags that the tool must NOT have any of
1600
+ */
1601
+ disabled?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>;
1602
+
1603
+ /**
1604
+ * Tags that the tool must have at least one of
1605
+ */
1606
+ enabled?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>;
1607
+ }
1608
+ }
1609
+
1610
+ /**
1611
+ * Workbench configuration
1612
+ */
1613
+ export interface Workbench {
1614
+ /**
1615
+ * Character threshold after which tool execution response are saved to a file in
1616
+ * workbench. Default is 20k.
1617
+ */
1618
+ auto_offload_threshold?: number;
1619
+
1620
+ /**
1621
+ * Whether the workbench (code execution sandbox) is enabled. When false,
1622
+ * COMPOSIO_REMOTE_WORKBENCH and COMPOSIO_REMOTE_BASH_TOOL are not exposed.
1623
+ */
1624
+ enable?: boolean;
1625
+
1626
+ /**
1627
+ * Whether proxy execution is enabled in the workbench
1628
+ */
1629
+ proxy_execution_enabled?: boolean;
1630
+
1631
+ /**
1632
+ * Sandbox compute tier: standard (1 vCPU / 1 GB), medium (2 vCPU / 2 GB), large (4
1633
+ * vCPU / 4 GB), xlarge (8 vCPU / 8 GB). Defaults to standard.
1634
+ */
1635
+ sandbox_size?: 'standard' | 'medium' | 'large' | 'xlarge';
1636
+ }
1637
+ }
1638
+ }
1639
+ }
1640
+
1641
+ export interface SessionExecuteResponse {
1642
+ /**
1643
+ * The data returned by the tool execution
1644
+ */
1645
+ data: { [key: string]: unknown };
1646
+
1647
+ /**
1648
+ * Error message if the execution failed, null otherwise
1649
+ */
1650
+ error: string | null;
1651
+
1652
+ /**
1653
+ * Unique identifier for the execution log
1654
+ */
1655
+ log_id: string;
1656
+ }
1657
+
1658
+ export interface SessionExecuteMetaResponse {
1659
+ /**
1660
+ * The data returned by the tool execution
1661
+ */
1662
+ data: { [key: string]: unknown };
1663
+
1664
+ /**
1665
+ * Error message if the execution failed, null otherwise
1666
+ */
1667
+ error: string | null;
1668
+
1669
+ /**
1670
+ * Unique identifier for the execution log
1671
+ */
1672
+ log_id: string;
1673
+ }
1674
+
1675
+ export interface SessionLinkResponse {
1676
+ /**
1677
+ * The unique identifier for the connected account
1678
+ */
1679
+ connected_account_id: string;
1680
+
1681
+ /**
1682
+ * Token used to complete the authentication flow
1683
+ */
1684
+ link_token: string;
1685
+
1686
+ /**
1687
+ * The URL where users should be redirected to complete OAuth
1688
+ */
1689
+ redirect_url: string;
1690
+ }
1691
+
1692
+ export interface SessionPatchResponse {
1693
+ /**
1694
+ * The configuration used to create this session
1695
+ */
1696
+ config: SessionPatchResponse.Config;
1697
+
1698
+ /**
1699
+ * Monotonic version of the config. Incremented on each PATCH. Use for optimistic
1700
+ * concurrency control.
1701
+ */
1702
+ config_version: number;
1703
+
1704
+ mcp: SessionPatchResponse.Mcp;
1705
+
1706
+ /**
1707
+ * The identifier of the session
1708
+ */
1709
+ session_id: string;
1710
+
1711
+ /**
1712
+ * List of available tools in this session
1713
+ */
1714
+ tool_router_tools: Array<string>;
1715
+
1716
+ /**
1717
+ * Experimental features
1718
+ */
1719
+ experimental?: SessionPatchResponse.Experimental;
1720
+
1721
+ /**
1722
+ * Advisory list — the session exists and is usable, but the listed issues may
1723
+ * warrant attention.
1724
+ */
1725
+ warnings?: Array<SessionPatchResponse.Warning>;
1726
+ }
1727
+
1728
+ export namespace SessionPatchResponse {
1729
+ /**
1730
+ * The configuration used to create this session
1731
+ */
1732
+ export interface Config {
1733
+ /**
1734
+ * Execute helper configuration
1735
+ */
1736
+ execute: Config.Execute;
1737
+
1738
+ /**
1739
+ * Preload configuration. Explicit slugs are returned as an array; dynamic preload
1740
+ * is returned as "all".
1741
+ */
1742
+ preload: Config.Preload;
1743
+
1744
+ /**
1745
+ * Search helper configuration
1746
+ */
1747
+ search: Config.Search;
1748
+
1749
+ /**
1750
+ * User identifier for this session
1751
+ */
1752
+ user_id: string;
1753
+
1754
+ /**
1755
+ * Auth config overrides per toolkit
1756
+ */
1757
+ auth_configs?: { [key: string]: string };
1758
+
1759
+ /**
1760
+ * Connected account overrides per toolkit. Each connected account must belong to
1761
+ * the same user_id as the session.
1762
+ */
1763
+ connected_accounts?: { [key: string]: string };
1764
+
1765
+ /**
1766
+ * Manage connections configuration
1767
+ */
1768
+ manage_connections?: Config.ManageConnections;
1769
+
1770
+ /**
1771
+ * Multi-account configuration for this session.
1772
+ */
1773
+ multi_account?: Config.MultiAccount;
1774
+
1775
+ /**
1776
+ * MCP tool annotation hints for filtering tools with enabled/disabled support.
1777
+ * enabled: tags that the tool must have at least one of. disabled: tags that the
1778
+ * tool must NOT have any of. Both conditions must be satisfied.
1779
+ */
1780
+ tags?: Config.Tags;
1781
+
1782
+ /**
1783
+ * Toolkit configuration - either enabled list or disabled list
1784
+ */
1785
+ toolkits?: Config.Enabled | Config.Disabled;
1786
+
1787
+ /**
1788
+ * Tool-level configuration per toolkit
1789
+ */
1790
+ tools?: { [key: string]: Config.Enabled | Config.Disabled | Config.Tags };
1791
+
1792
+ /**
1793
+ * Workbench configuration
1794
+ */
1795
+ workbench?: Config.Workbench;
1796
+ }
1797
+
1798
+ export namespace Config {
1799
+ /**
1800
+ * Execute helper configuration
1801
+ */
1802
+ export interface Execute {
1803
+ enable_multi_execute?: boolean;
1804
+ }
1805
+
1806
+ /**
1807
+ * Preload configuration. Explicit slugs are returned as an array; dynamic preload
1808
+ * is returned as "all".
1809
+ */
1810
+ export interface Preload {
1811
+ /**
1812
+ * Explicit preloaded tool slugs, or "all" when the session dynamically exposes all
1813
+ * app tools allowed by its filters.
1814
+ */
1815
+ tools: Array<string> | 'all';
1816
+ }
1817
+
1818
+ /**
1819
+ * Search helper configuration
1820
+ */
1821
+ export interface Search {
1822
+ enable?: boolean;
1823
+ }
1824
+
1825
+ /**
1826
+ * Manage connections configuration
1827
+ */
1828
+ export interface ManageConnections {
1829
+ /**
1830
+ * Custom callback URL for connected account auth flows
1831
+ */
1832
+ callback_url?: string;
1833
+
1834
+ /**
1835
+ * Enable the "remove" action in COMPOSIO_MANAGE_CONNECTIONS. Default true.
1836
+ */
1837
+ enable_connection_removal?: boolean;
1838
+
1839
+ /**
1840
+ * Enable the COMPOSIO_WAIT_FOR_CONNECTIONS tool for polling connection status.
1841
+ * Default false. May not work reliably with GPT models.
1842
+ */
1843
+ enable_wait_for_connections?: boolean;
1844
+
1845
+ /**
1846
+ * Whether to enable the connection manager for automatic connection handling
1847
+ */
1848
+ enabled?: boolean;
1849
+ }
1850
+
1851
+ /**
1852
+ * Multi-account configuration for this session.
1853
+ */
1854
+ export interface MultiAccount {
1855
+ /**
1856
+ * When true, enables multi-account mode for this session. When not set, falls back
1857
+ * to org/project-level configuration.
1858
+ */
1859
+ enable?: boolean;
1860
+
1861
+ /**
1862
+ * Maximum number of connected accounts allowed per toolkit. Defaults to 5 when
1863
+ * multi-account is enabled.
1864
+ */
1865
+ max_accounts_per_toolkit?: number;
1866
+
1867
+ /**
1868
+ * When true, require explicit account selection when multiple accounts are
1869
+ * connected. When false (default), use the first/default account.
1870
+ */
1871
+ require_explicit_selection?: boolean;
1872
+ }
1873
+
1874
+ /**
1875
+ * MCP tool annotation hints for filtering tools with enabled/disabled support.
1876
+ * enabled: tags that the tool must have at least one of. disabled: tags that the
1877
+ * tool must NOT have any of. Both conditions must be satisfied.
1878
+ */
1879
+ export interface Tags {
1880
+ /**
1881
+ * Tags that the tool must NOT have any of
1882
+ */
1883
+ disabled?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>;
1884
+
1885
+ /**
1886
+ * Tags that the tool must have at least one of
1887
+ */
1888
+ enabled?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>;
1889
+ }
1890
+
1891
+ export interface Enabled {
1892
+ enabled: Array<string>;
1893
+ }
1894
+
1895
+ export interface Disabled {
1896
+ disabled: Array<string>;
1897
+ }
1898
+
1899
+ export interface Enabled {
1900
+ enabled: Array<string>;
1901
+ }
1902
+
1903
+ export interface Disabled {
1904
+ disabled: Array<string>;
1905
+ }
1906
+
1907
+ export interface Tags {
1908
+ tags: Tags.Tags;
1909
+ }
1910
+
1911
+ export namespace Tags {
1912
+ export interface Tags {
1913
+ /**
1914
+ * Tags that the tool must NOT have any of
1915
+ */
1916
+ disabled?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>;
1917
+
1918
+ /**
1919
+ * Tags that the tool must have at least one of
1920
+ */
1921
+ enabled?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>;
1922
+ }
1923
+ }
1924
+
1925
+ /**
1926
+ * Workbench configuration
1927
+ */
1928
+ export interface Workbench {
1929
+ /**
1930
+ * Character threshold after which tool execution response are saved to a file in
1931
+ * workbench. Default is 20k.
1932
+ */
1933
+ auto_offload_threshold?: number;
1934
+
1935
+ /**
1936
+ * Whether the workbench (code execution sandbox) is enabled. When false,
1937
+ * COMPOSIO_REMOTE_WORKBENCH and COMPOSIO_REMOTE_BASH_TOOL are not exposed.
1938
+ */
1939
+ enable?: boolean;
1940
+
1941
+ /**
1942
+ * Whether proxy execution is enabled in the workbench
1943
+ */
1944
+ proxy_execution_enabled?: boolean;
1945
+
1946
+ /**
1947
+ * Sandbox compute tier: standard (1 vCPU / 1 GB), medium (2 vCPU / 2 GB), large (4
1948
+ * vCPU / 4 GB), xlarge (8 vCPU / 8 GB). Defaults to standard.
1949
+ */
1950
+ sandbox_size?: 'standard' | 'medium' | 'large' | 'xlarge';
1951
+ }
1952
+ }
1953
+
1954
+ export interface Mcp {
1955
+ /**
1956
+ * The type of the MCP server. Can be http
1957
+ */
1958
+ type: 'http';
1959
+
1960
+ /**
1961
+ * The URL of the MCP server
1962
+ */
1963
+ url: string;
1964
+ }
1965
+
1966
+ /**
1967
+ * Experimental features
1968
+ */
1969
+ export interface Experimental {
1970
+ /**
1971
+ * The assistive system prompt for the tool router session
1972
+ */
1973
+ assistive_prompt?: string;
1974
+
1975
+ /**
1976
+ * User-defined custom toolkits with grouped tools (no-auth)
1977
+ */
1978
+ custom_toolkits?: Array<Experimental.CustomToolkit>;
1979
+
1980
+ /**
1981
+ * Custom tools — standalone or extending Composio toolkits
1982
+ */
1983
+ custom_tools?: Array<Experimental.CustomTool>;
1984
+ }
1985
+
1986
+ export namespace Experimental {
1987
+ export interface CustomToolkit {
1988
+ description: string;
1989
+
1990
+ name: string;
1991
+
1992
+ slug: string;
1993
+
1994
+ tools: Array<CustomToolkit.Tool>;
1995
+ }
1996
+
1997
+ export namespace CustomToolkit {
1998
+ export interface Tool {
1999
+ description: string;
2000
+
2001
+ input_schema: { [key: string]: unknown };
2002
+
2003
+ name: string;
2004
+
2005
+ /**
2006
+ * Original tool slug as provided by the user
2007
+ */
2008
+ original_slug: string;
2009
+
2010
+ /**
2011
+ * Prefixed tool slug (e.g. LOCAL_CRM_FIND_CUSTOMER)
2012
+ */
2013
+ slug: string;
2014
+
2015
+ output_schema?: { [key: string]: unknown };
2016
+ }
2017
+ }
2018
+
2019
+ export interface CustomTool {
2020
+ description: string;
2021
+
2022
+ input_schema: { [key: string]: unknown };
2023
+
2024
+ name: string;
2025
+
2026
+ /**
2027
+ * Original tool slug as provided by the user
2028
+ */
2029
+ original_slug: string;
2030
+
2031
+ /**
2032
+ * Prefixed tool slug (e.g. LOCAL_GMAIL_GET_IMPORTANT_EMAILS)
2033
+ */
2034
+ slug: string;
2035
+
2036
+ extends_toolkit?: string;
2037
+
2038
+ output_schema?: { [key: string]: unknown };
2039
+ }
2040
+ }
2041
+
2042
+ export interface Warning {
2043
+ /**
2044
+ * Stable machine code identifying the advisory. Safe to switch on in client code.
2045
+ */
2046
+ code: 'PRELOAD_TOOLS_HIGH_CONTEXT_USAGE';
2047
+
2048
+ /**
2049
+ * Human-readable description of the advisory. Suitable for logging or surfacing to
2050
+ * end users.
2051
+ */
2052
+ message: string;
2053
+ }
2054
+ }
2055
+
2056
+ export interface SessionProxyExecuteResponse {
2057
+ /**
2058
+ * The HTTP status code returned from the proxied API
2059
+ */
2060
+ status: number;
2061
+
2062
+ /**
2063
+ * Binary body response data. Present when the response is a binary file.
2064
+ */
2065
+ binary_data?: SessionProxyExecuteResponse.BinaryData;
2066
+
2067
+ /**
2068
+ * The response data returned from the proxied API
2069
+ */
2070
+ data?: unknown;
2071
+
2072
+ /**
2073
+ * The HTTP headers returned from the proxied API
2074
+ */
2075
+ headers?: { [key: string]: string };
2076
+ }
2077
+
2078
+ export namespace SessionProxyExecuteResponse {
2079
+ /**
2080
+ * Binary body response data. Present when the response is a binary file.
2081
+ */
2082
+ export interface BinaryData {
2083
+ /**
2084
+ * Content-Type of the binary data
2085
+ */
2086
+ content_type: string;
2087
+
2088
+ /**
2089
+ * File size in bytes
2090
+ */
2091
+ size: number;
2092
+
2093
+ /**
2094
+ * URL to download binary content
2095
+ */
2096
+ url: string;
2097
+
2098
+ /**
2099
+ * ISO 8601 timestamp when the URL expires
2100
+ */
2101
+ expires_at?: string;
2102
+ }
2103
+ }
2104
+
2105
+ export interface SessionSearchResponse {
2106
+ /**
2107
+ * Error message if any searches failed, null if all succeeded. Format: "X out of Y
2108
+ * searches failed, reasons: <details>"
2109
+ */
2110
+ error: string | null;
2111
+
2112
+ /**
2113
+ * Combined workflow guidance covering connections, planner, and memory usage. Each
2114
+ * element is a step instruction.
2115
+ */
2116
+ next_steps_guidance: Array<string>;
2117
+
2118
+ /**
2119
+ * Per-query search results with tools, reasoning, and memory. One entry per query
2120
+ * in request order.
2121
+ */
2122
+ results: Array<SessionSearchResponse.Result>;
2123
+
2124
+ /**
2125
+ * Session info for correlating meta tool calls
2126
+ */
2127
+ session: SessionSearchResponse.Session;
2128
+
2129
+ /**
2130
+ * Whether all searches completed successfully. False if any query failed.
2131
+ */
2132
+ success: boolean;
2133
+
2134
+ /**
2135
+ * Time information for the query
2136
+ */
2137
+ time_info: SessionSearchResponse.TimeInfo;
2138
+
2139
+ /**
2140
+ * Deduplicated tool definitions keyed by tool_slug for O(1) lookup. Each tool
2141
+ * appears once even if used in multiple queries.
2142
+ */
2143
+ tool_schemas: { [key: string]: SessionSearchResponse.ToolSchemas };
2144
+
2145
+ /**
2146
+ * Connection status for all toolkits mentioned across all queries, with
2147
+ * descriptions merged in.
2148
+ */
2149
+ toolkit_connection_statuses: Array<SessionSearchResponse.ToolkitConnectionStatus>;
2150
+ }
2151
+
2152
+ export namespace SessionSearchResponse {
2153
+ export interface Result {
2154
+ /**
2155
+ * 1-based index of the query in the request
2156
+ */
2157
+ index: number;
2158
+
2159
+ /**
2160
+ * List of main tool slugs matching the search criteria
2161
+ */
2162
+ primary_tool_slugs: Array<string>;
2163
+
2164
+ /**
2165
+ * List of related tool slugs that might be useful
2166
+ */
2167
+ related_tool_slugs: Array<string>;
2168
+
2169
+ /**
2170
+ * List of unique toolkit slugs used by tools in this query
2171
+ */
2172
+ toolkits: Array<string>;
2173
+
2174
+ /**
2175
+ * The use case that was searched
2176
+ */
2177
+ use_case: string;
2178
+
2179
+ /**
2180
+ * Task difficulty assessment (e.g., "easy - Simple single-tool operation with
2181
+ * known parameters")
2182
+ */
2183
+ difficulty?: string;
2184
+
2185
+ /**
2186
+ * Error message if the search for this query failed, null otherwise. Always
2187
+ * present for failed queries.
2188
+ */
2189
+ error?: string | null;
2190
+
2191
+ /**
2192
+ * Guidance message about the search results, particularly when a cached plan is
2193
+ * available
2194
+ */
2195
+ execution_guidance?: string;
2196
+
2197
+ /**
2198
+ * Common pitfalls and considerations (only present when cached plan is available)
2199
+ */
2200
+ known_pitfalls?: Array<string>;
2201
+
2202
+ /**
2203
+ * Memory data relevant to this query, grouped by app. Only present for non-cached
2204
+ * search results.
2205
+ */
2206
+ memory?: { [key: string]: Array<string> };
2207
+
2208
+ /**
2209
+ * ID of cached plan if available
2210
+ */
2211
+ plan_id?: string;
2212
+
2213
+ /**
2214
+ * Workflow steps from cached plan (only present when cached plan is available)
2215
+ */
2216
+ recommended_plan_steps?: Array<string>;
2217
+
2218
+ /**
2219
+ * Reference Python code snippets for processing tool responses in the workbench
2220
+ * (only present when cached plan is available)
2221
+ */
2222
+ reference_workbench_snippets?: Array<Result.ReferenceWorkbenchSnippet>;
2223
+ }
2224
+
2225
+ export namespace Result {
2226
+ export interface ReferenceWorkbenchSnippet {
2227
+ /**
2228
+ * Python code snippet for the workbench
2229
+ */
2230
+ code: string;
2231
+
2232
+ /**
2233
+ * Description of what the code snippet does
2234
+ */
2235
+ description: string;
2236
+ }
2237
+ }
2238
+
2239
+ /**
2240
+ * Session info for correlating meta tool calls
2241
+ */
2242
+ export interface Session {
2243
+ /**
2244
+ * Session identifier to be passed to subsequent meta tool calls as session_id.
2245
+ */
2246
+ id: string;
2247
+
2248
+ /**
2249
+ * Whether a fresh session id was generated in this call.
2250
+ */
2251
+ generate_id: boolean;
2252
+
2253
+ /**
2254
+ * LLM-facing guidance on how to reuse this session id
2255
+ */
2256
+ instructions: string;
2257
+ }
2258
+
2259
+ /**
2260
+ * Time information for the query
2261
+ */
2262
+ export interface TimeInfo {
2263
+ /**
2264
+ * Current time in ISO format (UTC)
2265
+ */
2266
+ current_time_utc: string;
2267
+
2268
+ /**
2269
+ * Current time as Unix epoch timestamp in seconds
2270
+ */
2271
+ current_time_utc_epoch_seconds: number;
2272
+
2273
+ /**
2274
+ * Important message about time handling and timezone considerations
2275
+ */
2276
+ message: string;
2277
+ }
2278
+
2279
+ export interface ToolSchemas {
2280
+ /**
2281
+ * The slug of the tool
2282
+ */
2283
+ tool_slug: string;
2284
+
2285
+ /**
2286
+ * The slug of the toolkit that provides this tool
2287
+ */
2288
+ toolkit: string;
2289
+
2290
+ /**
2291
+ * Description of the tool
2292
+ */
2293
+ description?: string;
2294
+
2295
+ /**
2296
+ * Whether the full input_schema is included in this response
2297
+ */
2298
+ hasFullSchema?: boolean;
2299
+
2300
+ /**
2301
+ * Input schema for the tool (only present when hasFullSchema is true)
2302
+ */
2303
+ input_schema?: { [key: string]: unknown };
2304
+
2305
+ /**
2306
+ * Output/response schema for the tool. Only included when include_output_schemas
2307
+ * is true.
2308
+ */
2309
+ output_schema?: { [key: string]: unknown };
2310
+
2311
+ /**
2312
+ * Reference to fetch full schema when hasFullSchema is false
2313
+ */
2314
+ schemaRef?: ToolSchemas.SchemaRef;
2315
+ }
2316
+
2317
+ export namespace ToolSchemas {
2318
+ /**
2319
+ * Reference to fetch full schema when hasFullSchema is false
2320
+ */
2321
+ export interface SchemaRef {
2322
+ /**
2323
+ * Arguments to pass to the tool
2324
+ */
2325
+ args: SchemaRef.Args;
2326
+
2327
+ /**
2328
+ * Tool to call
2329
+ */
2330
+ tool: 'COMPOSIO_GET_TOOL_SCHEMAS';
2331
+
2332
+ /**
2333
+ * Instruction message for the LLM
2334
+ */
2335
+ message?: string;
2336
+ }
2337
+
2338
+ export namespace SchemaRef {
2339
+ /**
2340
+ * Arguments to pass to the tool
2341
+ */
2342
+ export interface Args {
2343
+ /**
2344
+ * Tool slugs to fetch schemas for
2345
+ */
2346
+ tool_slugs: Array<string>;
2347
+ }
2348
+ }
2349
+ }
2350
+
2351
+ export interface ToolkitConnectionStatus {
2352
+ /**
2353
+ * Description of what the toolkit does and its capabilities
2354
+ */
2355
+ description: string;
2356
+
2357
+ /**
2358
+ * Whether an active connection exists for this toolkit
2359
+ */
2360
+ has_active_connection: boolean;
2361
+
2362
+ /**
2363
+ * Human-readable message about the connection status and next steps
2364
+ */
2365
+ status_message: string;
2366
+
2367
+ /**
2368
+ * The toolkit slug identifier (e.g., "gmail", "slack")
2369
+ */
2370
+ toolkit: string;
2371
+
2372
+ /**
2373
+ * When "required", the agent must specify which account to use. Present only when
2374
+ * multiple accounts exist.
2375
+ */
2376
+ account_selection?: 'required';
2377
+
2378
+ /**
2379
+ * List of connected accounts for this toolkit. Present when multi-account is
2380
+ * enabled.
2381
+ */
2382
+ accounts?: Array<ToolkitConnectionStatus.Account>;
2383
+
2384
+ /**
2385
+ * Connection details including auth config and connected account IDs. Only present
2386
+ * when has_active_connection is true.
2387
+ */
2388
+ connection_details?: { [key: string]: unknown };
2389
+
2390
+ /**
2391
+ * Information about the currently connected user (email, name, etc.)
2392
+ */
2393
+ current_user_info?: { [key: string]: unknown };
2394
+ }
2395
+
2396
+ export namespace ToolkitConnectionStatus {
2397
+ export interface Account {
2398
+ /**
2399
+ * Unique identifier for this account
2400
+ */
2401
+ id: string;
2402
+
2403
+ /**
2404
+ * ISO 8601 timestamp of when the account was connected
2405
+ */
2406
+ created_at: string;
2407
+
2408
+ /**
2409
+ * Whether this is the default account for the toolkit
2410
+ */
2411
+ is_default: boolean;
2412
+
2413
+ /**
2414
+ * Connection status (e.g., "active")
2415
+ */
2416
+ status: string;
2417
+
2418
+ /**
2419
+ * User-assigned alias for this account
2420
+ */
2421
+ alias?: string;
2422
+
2423
+ /**
2424
+ * Information about the connected user (email, name, etc.)
2425
+ */
2426
+ user_info?: { [key: string]: unknown };
2427
+ }
2428
+ }
2429
+ }
2430
+
2431
+ export interface SessionToolkitsResponse {
2432
+ current_page: number;
2433
+
2434
+ items: Array<SessionToolkitsResponse.Item>;
2435
+
2436
+ total_items: number;
2437
+
2438
+ total_pages: number;
2439
+
2440
+ next_cursor?: string | null;
2441
+ }
2442
+
2443
+ export namespace SessionToolkitsResponse {
2444
+ export interface Item {
2445
+ /**
2446
+ * Available Composio-managed auth schemes
2447
+ */
2448
+ composio_managed_auth_schemes: Array<string>;
2449
+
2450
+ /**
2451
+ * Connected account if available
2452
+ */
2453
+ connected_account: Item.ConnectedAccount | null;
2454
+
2455
+ /**
2456
+ * Whether the toolkit is enabled
2457
+ */
2458
+ enabled: boolean;
2459
+
2460
+ /**
2461
+ * Whether the toolkit is no-auth
2462
+ */
2463
+ is_no_auth: boolean;
2464
+
2465
+ /**
2466
+ * Toolkit metadata
2467
+ */
2468
+ meta: Item.Meta;
2469
+
2470
+ /**
2471
+ * Display name of the toolkit
2472
+ */
2473
+ name: string;
2474
+
2475
+ /**
2476
+ * Unique slug identifier
2477
+ */
2478
+ slug: string;
2479
+ }
2480
+
2481
+ export namespace Item {
2482
+ /**
2483
+ * Connected account if available
2484
+ */
2485
+ export interface ConnectedAccount {
2486
+ /**
2487
+ * Connected account identifier
2488
+ */
2489
+ id: string;
2490
+
2491
+ /**
2492
+ * Auth config details
2493
+ */
2494
+ auth_config: ConnectedAccount.AuthConfig;
2495
+
2496
+ /**
2497
+ * Creation timestamp
2498
+ */
2499
+ created_at: string;
2500
+
2501
+ /**
2502
+ * Connection status
2503
+ */
2504
+ status: string;
2505
+
2506
+ /**
2507
+ * User identifier
2508
+ */
2509
+ user_id: string;
2510
+ }
2511
+
2512
+ export namespace ConnectedAccount {
2513
+ /**
2514
+ * Auth config details
2515
+ */
2516
+ export interface AuthConfig {
2517
+ /**
2518
+ * Auth config identifier
2519
+ */
2520
+ id: string;
2521
+
2522
+ /**
2523
+ * Authentication scheme type
2524
+ */
2525
+ auth_scheme: string;
2526
+
2527
+ /**
2528
+ * Whether this is a Composio-managed auth config
2529
+ */
2530
+ is_composio_managed: boolean;
2531
+ }
2532
+ }
2533
+
2534
+ /**
2535
+ * Toolkit metadata
2536
+ */
2537
+ export interface Meta {
2538
+ /**
2539
+ * Description of the toolkit
2540
+ */
2541
+ description: string;
2542
+
2543
+ /**
2544
+ * URL to the toolkit logo
2545
+ */
2546
+ logo: string;
2547
+ }
2548
+ }
2549
+ }
2550
+
2551
+ export interface SessionToolsResponse {
2552
+ current_page: number;
2553
+
2554
+ items: Array<SessionToolsResponse.Item>;
2555
+
2556
+ total_items: number;
2557
+
2558
+ total_pages: number;
2559
+
2560
+ next_cursor?: string | null;
2561
+ }
2562
+
2563
+ export namespace SessionToolsResponse {
2564
+ export interface Item {
2565
+ /**
2566
+ * List of all available versions for this tool
2567
+ */
2568
+ available_versions: Array<string>;
2569
+
2570
+ deprecated: Item.Deprecated;
2571
+
2572
+ /**
2573
+ * Detailed explanation of the tool's functionality and purpose
2574
+ */
2575
+ description: string;
2576
+
2577
+ /**
2578
+ * Schema definition of required input parameters for the tool
2579
+ */
2580
+ input_parameters: { [key: string]: unknown };
2581
+
2582
+ /**
2583
+ * Indicates if this tool is deprecated and may be removed in the future
2584
+ */
2585
+ is_deprecated: boolean;
2586
+
2587
+ /**
2588
+ * Human-readable display name of the tool
2589
+ */
2590
+ name: string;
2591
+
2592
+ /**
2593
+ * Indicates if the tool can be used without authentication
2594
+ */
2595
+ no_auth: boolean;
2596
+
2597
+ /**
2598
+ * Schema definition of return values from the tool
2599
+ */
2600
+ output_parameters: { [key: string]: unknown };
2601
+
2602
+ /**
2603
+ * Structured scope requirements for the tool. Null means the tool is legacy and
2604
+ * only exposes flat scopes.
2605
+ */
2606
+ scope_requirements: Item.ScopeRequirements | null;
2607
+
2608
+ /**
2609
+ * List of scopes associated with the tool
2610
+ */
2611
+ scopes: Array<string>;
2612
+
2613
+ /**
2614
+ * Unique identifier for the tool
2615
+ */
2616
+ slug: string;
2617
+
2618
+ /**
2619
+ * List of tags associated with the tool for categorization and filtering
2620
+ */
2621
+ tags: Array<string>;
2622
+
2623
+ toolkit: Item.Toolkit;
2624
+
2625
+ /**
2626
+ * Current version of the tool
2627
+ */
2628
+ version: string;
2629
+
2630
+ /**
2631
+ * Human-friendly description of the tool, if available
2632
+ */
2633
+ human_description?: string;
2634
+ }
2635
+
2636
+ export namespace Item {
2637
+ export interface Deprecated {
2638
+ /**
2639
+ * List of all available versions for this tool
2640
+ */
2641
+ available_versions: Array<string>;
2642
+
2643
+ /**
2644
+ * The display name of the tool
2645
+ */
2646
+ displayName: string;
2647
+
2648
+ /**
2649
+ * Indicates if this tool is deprecated and may be removed in the future
2650
+ */
2651
+ is_deprecated: boolean;
2652
+
2653
+ toolkit: Deprecated.Toolkit;
2654
+
2655
+ /**
2656
+ * Current version identifier of the tool
2657
+ */
2658
+ version: string;
2659
+ }
2660
+
2661
+ export namespace Deprecated {
2662
+ export interface Toolkit {
2663
+ /**
2664
+ * URL to the toolkit logo image
2665
+ */
2666
+ logo: string;
2667
+ }
2668
+ }
2669
+
2670
+ /**
2671
+ * Structured scope requirements for the tool. Null means the tool is legacy and
2672
+ * only exposes flat scopes.
2673
+ */
2674
+ export interface ScopeRequirements {
2675
+ all_of: Array<string | ScopeRequirements.AnyOf>;
2676
+ }
2677
+
2678
+ export namespace ScopeRequirements {
2679
+ export interface AnyOf {
2680
+ any_of: Array<string>;
2681
+ }
2682
+ }
2683
+
2684
+ export interface Toolkit {
2685
+ /**
2686
+ * URL to the toolkit logo image
2687
+ */
2688
+ logo: string;
2689
+
2690
+ /**
2691
+ * Human-readable name of the parent toolkit
2692
+ */
2693
+ name: string;
2694
+
2695
+ /**
2696
+ * Unique identifier of the parent toolkit
2697
+ */
2698
+ slug: string;
2699
+ }
2700
+ }
2701
+ }
2702
+
2703
+ export interface SessionCreateParams {
2704
+ /**
2705
+ * The identifier of the user who is initiating the session, ideally a unique
2706
+ * identifier from your database like a user ID or email address
2707
+ */
2708
+ user_id: string;
2709
+
2710
+ /**
2711
+ * The auth configs to use for the session. This will override the default behavior
2712
+ * and use the given auth config when specific toolkits are being executed
2713
+ */
2714
+ auth_configs?: { [key: string]: string };
2715
+
2716
+ /**
2717
+ * The connected accounts to use for the session. This will override the default
2718
+ * behaviour and use the given connected account when specific toolkits are being
2719
+ * executed. Each connected account must exist (not deleted or disabled) and belong
2720
+ * to the same `user_id` as the session — otherwise session creation fails with a
2721
+ * clear error explaining which account didn't match.
2722
+ */
2723
+ connected_accounts?: { [key: string]: string };
2724
+
2725
+ execute?: SessionCreateParams.Execute;
2726
+
2727
+ /**
2728
+ * Experimental features - not stable, may be modified or removed in future
2729
+ * versions.
2730
+ */
2731
+ experimental?: SessionCreateParams.Experimental;
2732
+
2733
+ /**
2734
+ * Configuration for connection management settings
2735
+ */
2736
+ manage_connections?: SessionCreateParams.ManageConnections;
2737
+
2738
+ /**
2739
+ * Configure multi-account behavior. When enabled, users can connect multiple
2740
+ * accounts per toolkit.
2741
+ */
2742
+ multi_account?: SessionCreateParams.MultiAccount;
2743
+
2744
+ /**
2745
+ * Preload configuration. Use an explicit list for frequently used tool slugs, or
2746
+ * "all" to dynamically expose every app tool allowed by positive
2747
+ * toolkits/tools/tags filters.
2748
+ */
2749
+ preload?: SessionCreateParams.Preload;
2750
+
2751
+ search?: SessionCreateParams.Search;
2752
+
2753
+ /**
2754
+ * Global MCP tool annotation hints for filtering. Array format is treated as
2755
+ * enabled list. Object format supports both enabled (tool must have at least one)
2756
+ * and disabled (tool must NOT have any) lists. Toolkit-level tags override this.
2757
+ * Toolkit enabled/disabled lists take precedence over tag filtering.
2758
+ */
2759
+ tags?:
2760
+ | Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>
2761
+ | SessionCreateParams.UnionMember1;
2762
+
2763
+ /**
2764
+ * Toolkit configuration - specify either enable toolkits (allowlist) or disable
2765
+ * toolkits (denylist). Mutually exclusive.
2766
+ */
2767
+ toolkits?: SessionCreateParams.Enable | SessionCreateParams.Disable;
2768
+
2769
+ /**
2770
+ * Tool-level configuration per toolkit. Allows you to enable, disable, or filter
2771
+ * by tags for specific tools within each toolkit. Every slug passed in `enable` /
2772
+ * `disable` must be a valid Composio tool slug for that toolkit — invalid or
2773
+ * typo'd slugs fail session creation with a clear error listing which ones didn't
2774
+ * match.
2775
+ */
2776
+ tools?: {
2777
+ [key: string]: SessionCreateParams.Enable | SessionCreateParams.Disable | SessionCreateParams.Tags;
2778
+ };
2779
+
2780
+ /**
2781
+ * Configuration for workbench behavior
2782
+ */
2783
+ workbench?: SessionCreateParams.Workbench;
2784
+ }
2785
+
2786
+ export namespace SessionCreateParams {
2787
+ export interface Execute {
2788
+ enable_multi_execute?: boolean;
2789
+ }
2790
+
2791
+ /**
2792
+ * Experimental features - not stable, may be modified or removed in future
2793
+ * versions.
2794
+ */
2795
+ export interface Experimental {
2796
+ /**
2797
+ * Customize assistive prompt generation (e.g., timezone).
2798
+ */
2799
+ assistive_prompt_config?: Experimental.AssistivePromptConfig;
2800
+
2801
+ /**
2802
+ * Custom toolkits with grouped tools. Toolkit slugs must not conflict with
2803
+ * existing Composio toolkits. All tools are no-auth.
2804
+ */
2805
+ custom_toolkits?: Array<Experimental.CustomToolkit>;
2806
+
2807
+ /**
2808
+ * Custom tools to include in search. Standalone tools need no auth. Tools with
2809
+ * extends_toolkit inherit the Composio toolkit's connection.
2810
+ */
2811
+ custom_tools?: Array<Experimental.CustomTool>;
2812
+
2813
+ /**
2814
+ * Per-tool elicitation permission config. Default behavior + per-tool
2815
+ * always_allow/always_deny overrides. Mutation via PATCH.
2816
+ */
2817
+ permissions?: Experimental.Permissions;
2818
+ }
2819
+
2820
+ export namespace Experimental {
2821
+ /**
2822
+ * Customize assistive prompt generation (e.g., timezone).
2823
+ */
2824
+ export interface AssistivePromptConfig {
2825
+ /**
2826
+ * IANA timezone identifier (e.g., 'America/New_York', 'Europe/London'). Used to
2827
+ * customize the system prompt with timezone-aware instructions.
2828
+ */
2829
+ user_timezone?: string;
2830
+ }
2831
+
2832
+ export interface CustomToolkit {
2833
+ /**
2834
+ * Used for BM25 search matching and shown in toolkit connection statuses.
2835
+ */
2836
+ description: string;
2837
+
2838
+ /**
2839
+ * Display name shown to the LLM and in search results.
2840
+ */
2841
+ name: string;
2842
+
2843
+ /**
2844
+ * Unique slug for the toolkit. Must not conflict with existing Composio toolkit
2845
+ * slugs. Alphanumeric, underscores, and hyphens only.
2846
+ */
2847
+ slug: string;
2848
+
2849
+ /**
2850
+ * Tools in this custom toolkit
2851
+ */
2852
+ tools: Array<CustomToolkit.Tool>;
2853
+ }
2854
+
2855
+ export namespace CustomToolkit {
2856
+ export interface Tool {
2857
+ /**
2858
+ * Used for BM25 search matching and shown to the LLM.
2859
+ */
2860
+ description: string;
2861
+
2862
+ /**
2863
+ * Must have type: "object" and a properties field.
2864
+ */
2865
+ input_schema: { [key: string]: unknown };
2866
+
2867
+ /**
2868
+ * Human-readable display name
2869
+ */
2870
+ name: string;
2871
+
2872
+ /**
2873
+ * Tool slug. Combined with toolkit slug to form LOCAL*<TOOLKIT>*<TOOL> (max 60
2874
+ * chars total).
2875
+ */
2876
+ slug: string;
2877
+
2878
+ /**
2879
+ * Optional output schema for the tool response.
2880
+ */
2881
+ output_schema?: { [key: string]: unknown };
2882
+ }
2883
+ }
2884
+
2885
+ export interface CustomTool {
2886
+ /**
2887
+ * Used for BM25 search matching and shown to the LLM.
2888
+ */
2889
+ description: string;
2890
+
2891
+ /**
2892
+ * Must have type: "object" and a properties field.
2893
+ */
2894
+ input_schema: { [key: string]: unknown };
2895
+
2896
+ /**
2897
+ * Human-readable display name
2898
+ */
2899
+ name: string;
2900
+
2901
+ /**
2902
+ * Tool slug. Forms LOCAL*<TOOL> (standalone) or LOCAL*<TOOLKIT>\_<TOOL>
2903
+ * (extending). Max 60 chars total.
2904
+ */
2905
+ slug: string;
2906
+
2907
+ /**
2908
+ * If set, must be a valid Composio toolkit slug. The tool inherits that toolkit's
2909
+ * auth/connection status. If omitted, the tool is standalone (no-auth).
2910
+ */
2911
+ extends_toolkit?: string;
2912
+
2913
+ /**
2914
+ * JSON Schema describing tool output (optional)
2915
+ */
2916
+ output_schema?: { [key: string]: unknown };
2917
+ }
2918
+
2919
+ /**
2920
+ * Per-tool elicitation permission config. Default behavior + per-tool
2921
+ * always_allow/always_deny overrides. Mutation via PATCH.
2922
+ */
2923
+ export interface Permissions {
2924
+ /**
2925
+ * Default elicitation behavior when no override matches. `allow_all` runs every
2926
+ * tool without prompting; `ask_every_call` prompts on each invocation;
2927
+ * `ask_once_per_session` prompts once and remembers the answer for the rest of the
2928
+ * session.
2929
+ */
2930
+ default: 'allow_all' | 'ask_every_call' | 'ask_once_per_session';
2931
+
2932
+ /**
2933
+ * Per-tool overrides keyed by `${toolSlug}:${connectedAccountId ?? "__none__"}`,
2934
+ * plus account-wide overrides keyed by `*:${connectedAccountId ?? "__none__"}`.
2935
+ * Exact tool overrides take precedence over account-wide overrides. `always_allow`
2936
+ * skips the prompt and runs the tool; `always_deny` blocks the tool; `ask_once`
2937
+ * prompts once per session (allow/deny) and remembers; `ask_always` prompts on
2938
+ * every call with allow-once/allow-session/deny, ignoring any cached session
2939
+ * allow. Overrides take precedence over `default`.
2940
+ */
2941
+ overrides?: { [key: string]: 'always_allow' | 'always_deny' | 'ask_once' | 'ask_always' };
2942
+ }
2943
+ }
2944
+
2945
+ /**
2946
+ * Configuration for connection management settings
2947
+ */
2948
+ export interface ManageConnections {
2949
+ /**
2950
+ * The URL to redirect to after a user completes authentication for a connected
2951
+ * account. This allows you to handle the auth callback in your own application.
2952
+ */
2953
+ callback_url?: string;
2954
+
2955
+ /**
2956
+ * Whether to enable the connection manager for automatic connection handling. If
2957
+ * true, we will provide a tool your agent can use to initiate connections to
2958
+ * toolkits if it doesnt exist. If set to false, then you have to manage
2959
+ * connections manually.
2960
+ */
2961
+ enable?: boolean | null;
2962
+
2963
+ /**
2964
+ * Enable the "remove" action in COMPOSIO_MANAGE_CONNECTIONS to allow deleting
2965
+ * connected accounts. Default true.
2966
+ */
2967
+ enable_connection_removal?: boolean | null;
2968
+
2969
+ /**
2970
+ * When true, the COMPOSIO_WAIT_FOR_CONNECTIONS tool is available for agents to
2971
+ * poll connection status after sharing auth URLs. Default is false (disabled). May
2972
+ * not work reliably with GPT models.
2973
+ */
2974
+ enable_wait_for_connections?: boolean | null;
2975
+ }
2976
+
2977
+ /**
2978
+ * Configure multi-account behavior. When enabled, users can connect multiple
2979
+ * accounts per toolkit.
2980
+ */
2981
+ export interface MultiAccount {
2982
+ /**
2983
+ * When true, enables multi-account mode for this session. When not set, falls back
2984
+ * to org/project-level configuration.
2985
+ */
2986
+ enable?: boolean;
2987
+
2988
+ /**
2989
+ * Maximum number of connected accounts allowed per toolkit. Must be between 2
2990
+ * and 10.
2991
+ */
2992
+ max_accounts_per_toolkit?: number;
2993
+
2994
+ /**
2995
+ * When true, the agent must explicitly select which account to use. When false
2996
+ * (default), the first/default account is used automatically.
2997
+ */
2998
+ require_explicit_selection?: boolean;
2999
+ }
3000
+
3001
+ /**
3002
+ * Preload configuration. Use an explicit list for frequently used tool slugs, or
3003
+ * "all" to dynamically expose every app tool allowed by positive
3004
+ * toolkits/tools/tags filters.
3005
+ */
3006
+ export interface Preload {
3007
+ /**
3008
+ * Explicit tool slugs to preload, or "all" to dynamically expose all current and
3009
+ * future app tools allowed by the positive session filters. "all" is capped at
3010
+ * 1000 tools and is not supported without a positive allowlist.
3011
+ */
3012
+ tools?: Array<string> | string;
3013
+ }
3014
+
3015
+ export interface Search {
3016
+ enable?: boolean;
3017
+ }
3018
+
3019
+ export interface UnionMember1 {
3020
+ disable?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>;
3021
+
3022
+ enable?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>;
3023
+ }
3024
+
3025
+ /**
3026
+ * Enable only specific toolkits (allowlist)
3027
+ */
3028
+ export interface Enable {
3029
+ /**
3030
+ * Only these specific toolkits will be enabled
3031
+ */
3032
+ enable: Array<string>;
3033
+ }
3034
+
3035
+ /**
3036
+ * Disable specific toolkits (denylist)
3037
+ */
3038
+ export interface Disable {
3039
+ /**
3040
+ * These specific toolkits will be disabled
3041
+ */
3042
+ disable: Array<string>;
3043
+ }
3044
+
3045
+ export interface Enable {
3046
+ /**
3047
+ * Only these specific tools will be available for this toolkit
3048
+ */
3049
+ enable: Array<string>;
3050
+ }
3051
+
3052
+ export interface Disable {
3053
+ /**
3054
+ * These specific tools will be disabled for this toolkit
3055
+ */
3056
+ disable: Array<string>;
3057
+ }
3058
+
3059
+ export interface Tags {
3060
+ /**
3061
+ * MCP tags to filter tools. Array format is treated as enabled list. Object format
3062
+ * supports both enabled and disabled lists.
3063
+ */
3064
+ tags: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'> | Tags.UnionMember1;
3065
+ }
3066
+
3067
+ export namespace Tags {
3068
+ export interface UnionMember1 {
3069
+ disable?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>;
3070
+
3071
+ enable?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>;
3072
+ }
3073
+ }
1376
3074
 
3075
+ /**
3076
+ * Configuration for workbench behavior
3077
+ */
3078
+ export interface Workbench {
1377
3079
  /**
1378
- * Whether the toolkit is enabled
3080
+ * Character threshold for automatic offloading. When workbench response exceeds
3081
+ * this threshold, it will be automatically offloaded. Default is picked
3082
+ * automatically based on the response size.
1379
3083
  */
1380
- enabled: boolean;
3084
+ auto_offload_threshold?: number;
1381
3085
 
1382
3086
  /**
1383
- * Whether the toolkit is no-auth
3087
+ * Set to false to disable the workbench entirely. When disabled, no code execution
3088
+ * tools are available in the session.
1384
3089
  */
1385
- is_no_auth: boolean;
3090
+ enable?: boolean;
1386
3091
 
1387
3092
  /**
1388
- * Toolkit metadata
3093
+ * Whether proxy execution is enabled. When enabled, workbench can call URLs and
3094
+ * APIs directly.
1389
3095
  */
1390
- meta: Item.Meta;
3096
+ enable_proxy_execution?: boolean;
1391
3097
 
1392
3098
  /**
1393
- * Display name of the toolkit
3099
+ * Sandbox compute tier: standard (1 vCPU / 1 GB), medium (2 vCPU / 2 GB), large (4
3100
+ * vCPU / 4 GB), xlarge (8 vCPU / 8 GB). Defaults to standard.
1394
3101
  */
1395
- name: string;
3102
+ sandbox_size?: 'standard' | 'medium' | 'large' | 'xlarge';
3103
+ }
3104
+ }
3105
+
3106
+ export interface SessionAttachParams {
3107
+ /**
3108
+ * Inline custom tools and toolkits for this request. v3.1 sessions do not persist
3109
+ * customs — pass them on every request that needs them.
3110
+ */
3111
+ experimental?: SessionAttachParams.Experimental;
3112
+ }
1396
3113
 
3114
+ export namespace SessionAttachParams {
3115
+ /**
3116
+ * Inline custom tools and toolkits for this request. v3.1 sessions do not persist
3117
+ * customs — pass them on every request that needs them.
3118
+ */
3119
+ export interface Experimental {
1397
3120
  /**
1398
- * Unique slug identifier
3121
+ * Custom toolkits with grouped tools. Toolkit slugs must not conflict with
3122
+ * existing Composio toolkits. All tools are no-auth.
1399
3123
  */
1400
- slug: string;
1401
- }
3124
+ custom_toolkits?: Array<Experimental.CustomToolkit>;
1402
3125
 
1403
- export namespace Item {
1404
3126
  /**
1405
- * Connected account if available
3127
+ * Custom tools to include in search. Standalone tools need no auth. Tools with
3128
+ * extends_toolkit inherit the Composio toolkit's connection.
1406
3129
  */
1407
- export interface ConnectedAccount {
1408
- /**
1409
- * Connected account identifier
1410
- */
1411
- id: string;
3130
+ custom_tools?: Array<Experimental.CustomTool>;
3131
+ }
1412
3132
 
3133
+ export namespace Experimental {
3134
+ export interface CustomToolkit {
1413
3135
  /**
1414
- * Auth config details
3136
+ * Used for BM25 search matching and shown in toolkit connection statuses.
1415
3137
  */
1416
- auth_config: ConnectedAccount.AuthConfig;
3138
+ description: string;
1417
3139
 
1418
3140
  /**
1419
- * Creation timestamp
3141
+ * Display name shown to the LLM and in search results.
1420
3142
  */
1421
- created_at: string;
3143
+ name: string;
1422
3144
 
1423
3145
  /**
1424
- * Connection status
3146
+ * Unique slug for the toolkit. Must not conflict with existing Composio toolkit
3147
+ * slugs. Alphanumeric, underscores, and hyphens only.
1425
3148
  */
1426
- status: string;
3149
+ slug: string;
1427
3150
 
1428
3151
  /**
1429
- * User identifier
3152
+ * Tools in this custom toolkit
1430
3153
  */
1431
- user_id: string;
3154
+ tools: Array<CustomToolkit.Tool>;
1432
3155
  }
1433
3156
 
1434
- export namespace ConnectedAccount {
1435
- /**
1436
- * Auth config details
1437
- */
1438
- export interface AuthConfig {
3157
+ export namespace CustomToolkit {
3158
+ export interface Tool {
1439
3159
  /**
1440
- * Auth config identifier
3160
+ * Used for BM25 search matching and shown to the LLM.
1441
3161
  */
1442
- id: string;
3162
+ description: string;
1443
3163
 
1444
3164
  /**
1445
- * Authentication scheme type
3165
+ * Must have type: "object" and a properties field.
1446
3166
  */
1447
- auth_scheme: string;
3167
+ input_schema: { [key: string]: unknown };
1448
3168
 
1449
3169
  /**
1450
- * Whether this is a Composio-managed auth config
3170
+ * Human-readable display name
1451
3171
  */
1452
- is_composio_managed: boolean;
3172
+ name: string;
3173
+
3174
+ /**
3175
+ * Tool slug. Combined with toolkit slug to form LOCAL*<TOOLKIT>*<TOOL> (max 60
3176
+ * chars total).
3177
+ */
3178
+ slug: string;
3179
+
3180
+ /**
3181
+ * Optional output schema for the tool response.
3182
+ */
3183
+ output_schema?: { [key: string]: unknown };
1453
3184
  }
1454
3185
  }
1455
3186
 
1456
- /**
1457
- * Toolkit metadata
1458
- */
1459
- export interface Meta {
3187
+ export interface CustomTool {
1460
3188
  /**
1461
- * Description of the toolkit
3189
+ * Used for BM25 search matching and shown to the LLM.
1462
3190
  */
1463
3191
  description: string;
1464
3192
 
1465
3193
  /**
1466
- * URL to the toolkit logo
3194
+ * Must have type: "object" and a properties field.
1467
3195
  */
1468
- logo: string;
3196
+ input_schema: { [key: string]: unknown };
3197
+
3198
+ /**
3199
+ * Human-readable display name
3200
+ */
3201
+ name: string;
3202
+
3203
+ /**
3204
+ * Tool slug. Forms LOCAL*<TOOL> (standalone) or LOCAL*<TOOLKIT>\_<TOOL>
3205
+ * (extending). Max 60 chars total.
3206
+ */
3207
+ slug: string;
3208
+
3209
+ /**
3210
+ * If set, must be a valid Composio toolkit slug. The tool inherits that toolkit's
3211
+ * auth/connection status. If omitted, the tool is standalone (no-auth).
3212
+ */
3213
+ extends_toolkit?: string;
3214
+
3215
+ /**
3216
+ * JSON Schema describing tool output (optional)
3217
+ */
3218
+ output_schema?: { [key: string]: unknown };
1469
3219
  }
1470
3220
  }
1471
3221
  }
1472
3222
 
1473
- export interface SessionToolsResponse {
3223
+ export interface SessionConfigHistoryParams {
1474
3224
  /**
1475
- * List of tools with their complete schemas
3225
+ * Cursor for pagination. The cursor is a base64 encoded string of the page and
3226
+ * limit. The page is the page number and the limit is the number of items per
3227
+ * page. The cursor is used to paginate through the items. The cursor is not
3228
+ * required for the first page.
1476
3229
  */
1477
- items: Array<SessionToolsResponse.Item>;
1478
- }
1479
-
1480
- export namespace SessionToolsResponse {
1481
- export interface Item {
1482
- /**
1483
- * List of all available versions for this tool
1484
- */
1485
- available_versions: Array<string>;
1486
-
1487
- deprecated: Item.Deprecated;
1488
-
1489
- /**
1490
- * Detailed explanation of the tool's functionality and purpose
1491
- */
1492
- description: string;
1493
-
1494
- /**
1495
- * Schema definition of required input parameters for the tool
1496
- */
1497
- input_parameters: { [key: string]: unknown };
1498
-
1499
- /**
1500
- * Indicates if this tool is deprecated and may be removed in the future
1501
- */
1502
- is_deprecated: boolean;
1503
-
1504
- /**
1505
- * Human-readable display name of the tool
1506
- */
1507
- name: string;
1508
-
1509
- /**
1510
- * Indicates if the tool can be used without authentication
1511
- */
1512
- no_auth: boolean;
3230
+ cursor?: string;
1513
3231
 
1514
- /**
1515
- * Schema definition of return values from the tool
1516
- */
1517
- output_parameters: { [key: string]: unknown };
3232
+ /**
3233
+ * Number of items per page, max allowed is 100
3234
+ */
3235
+ limit?: number;
3236
+ }
1518
3237
 
1519
- /**
1520
- * Structured scope requirements for the tool. Null means the tool is legacy and
1521
- * only exposes flat scopes.
1522
- */
1523
- scope_requirements: Item.ScopeRequirements | null;
3238
+ export interface SessionExecuteParams {
3239
+ /**
3240
+ * The unique slug identifier of the tool to execute. Supports both meta tools and
3241
+ * app tools exposed by the session.
3242
+ */
3243
+ tool_slug: string;
1524
3244
 
1525
- /**
1526
- * List of scopes associated with the tool
1527
- */
1528
- scopes: Array<string>;
3245
+ /**
3246
+ * Account identifier to specify which connected account to use for direct tool
3247
+ * execution. Use the account ID (e.g. "coup_hurricane_dal_analytical") or an
3248
+ * alias. When omitted with a single account, the default is used. When omitted
3249
+ * with multiple accounts, an error lists available accounts. Meta/helper tools
3250
+ * either ignore this top-level field or define their own account-selection fields,
3251
+ * for example COMPOSIO_MULTI_EXECUTE_TOOL.tools[].account.
3252
+ */
3253
+ account?: string;
1529
3254
 
1530
- /**
1531
- * Unique identifier for the tool
1532
- */
1533
- slug: string;
3255
+ /**
3256
+ * The arguments required by the tool
3257
+ */
3258
+ arguments?: { [key: string]: unknown };
1534
3259
 
1535
- /**
1536
- * List of tags associated with the tool for categorization and filtering
1537
- */
1538
- tags: Array<string>;
3260
+ /**
3261
+ * When true, direct non-meta tool execution may return a workbench offload preview
3262
+ * if the response exceeds the configured threshold and the session workbench is
3263
+ * enabled. When omitted or false, direct tool execution returns the normal inline
3264
+ * response. Meta/helper tools are unaffected, and COMPOSIO_MULTI_EXECUTE_TOOL uses
3265
+ * session.workbench configuration for its own batch-level offload behavior.
3266
+ */
3267
+ enable_auto_workbench_offload?: boolean;
1539
3268
 
1540
- toolkit: Item.Toolkit;
3269
+ /**
3270
+ * Inline custom tools and toolkits for this request. v3.1 sessions do not persist
3271
+ * customs — pass them on every request that needs them.
3272
+ */
3273
+ experimental?: SessionExecuteParams.Experimental;
3274
+ }
1541
3275
 
3276
+ export namespace SessionExecuteParams {
3277
+ /**
3278
+ * Inline custom tools and toolkits for this request. v3.1 sessions do not persist
3279
+ * customs — pass them on every request that needs them.
3280
+ */
3281
+ export interface Experimental {
1542
3282
  /**
1543
- * Current version of the tool
3283
+ * Custom toolkits with grouped tools. Toolkit slugs must not conflict with
3284
+ * existing Composio toolkits. All tools are no-auth.
1544
3285
  */
1545
- version: string;
3286
+ custom_toolkits?: Array<Experimental.CustomToolkit>;
1546
3287
 
1547
3288
  /**
1548
- * Human-friendly description of the tool, if available
3289
+ * Custom tools to include in search. Standalone tools need no auth. Tools with
3290
+ * extends_toolkit inherit the Composio toolkit's connection.
1549
3291
  */
1550
- human_description?: string;
3292
+ custom_tools?: Array<Experimental.CustomTool>;
1551
3293
  }
1552
3294
 
1553
- export namespace Item {
1554
- export interface Deprecated {
3295
+ export namespace Experimental {
3296
+ export interface CustomToolkit {
1555
3297
  /**
1556
- * List of all available versions for this tool
3298
+ * Used for BM25 search matching and shown in toolkit connection statuses.
1557
3299
  */
1558
- available_versions: Array<string>;
3300
+ description: string;
1559
3301
 
1560
3302
  /**
1561
- * The display name of the tool
3303
+ * Display name shown to the LLM and in search results.
1562
3304
  */
1563
- displayName: string;
3305
+ name: string;
1564
3306
 
1565
3307
  /**
1566
- * Indicates if this tool is deprecated and may be removed in the future
3308
+ * Unique slug for the toolkit. Must not conflict with existing Composio toolkit
3309
+ * slugs. Alphanumeric, underscores, and hyphens only.
1567
3310
  */
1568
- is_deprecated: boolean;
1569
-
1570
- toolkit: Deprecated.Toolkit;
3311
+ slug: string;
1571
3312
 
1572
3313
  /**
1573
- * Current version identifier of the tool
3314
+ * Tools in this custom toolkit
1574
3315
  */
1575
- version: string;
3316
+ tools: Array<CustomToolkit.Tool>;
1576
3317
  }
1577
3318
 
1578
- export namespace Deprecated {
1579
- export interface Toolkit {
3319
+ export namespace CustomToolkit {
3320
+ export interface Tool {
1580
3321
  /**
1581
- * URL to the toolkit logo image
3322
+ * Used for BM25 search matching and shown to the LLM.
1582
3323
  */
1583
- logo: string;
1584
- }
1585
- }
3324
+ description: string;
1586
3325
 
1587
- /**
1588
- * Structured scope requirements for the tool. Null means the tool is legacy and
1589
- * only exposes flat scopes.
1590
- */
1591
- export interface ScopeRequirements {
1592
- all_of: Array<string | ScopeRequirements.AnyOf>;
1593
- }
3326
+ /**
3327
+ * Must have type: "object" and a properties field.
3328
+ */
3329
+ input_schema: { [key: string]: unknown };
1594
3330
 
1595
- export namespace ScopeRequirements {
1596
- export interface AnyOf {
1597
- any_of: Array<string>;
3331
+ /**
3332
+ * Human-readable display name
3333
+ */
3334
+ name: string;
3335
+
3336
+ /**
3337
+ * Tool slug. Combined with toolkit slug to form LOCAL*<TOOLKIT>*<TOOL> (max 60
3338
+ * chars total).
3339
+ */
3340
+ slug: string;
3341
+
3342
+ /**
3343
+ * Optional output schema for the tool response.
3344
+ */
3345
+ output_schema?: { [key: string]: unknown };
1598
3346
  }
1599
3347
  }
1600
3348
 
1601
- export interface Toolkit {
3349
+ export interface CustomTool {
1602
3350
  /**
1603
- * URL to the toolkit logo image
3351
+ * Used for BM25 search matching and shown to the LLM.
1604
3352
  */
1605
- logo: string;
3353
+ description: string;
1606
3354
 
1607
3355
  /**
1608
- * Human-readable name of the parent toolkit
3356
+ * Must have type: "object" and a properties field.
3357
+ */
3358
+ input_schema: { [key: string]: unknown };
3359
+
3360
+ /**
3361
+ * Human-readable display name
1609
3362
  */
1610
3363
  name: string;
1611
3364
 
1612
3365
  /**
1613
- * Unique identifier of the parent toolkit
3366
+ * Tool slug. Forms LOCAL*<TOOL> (standalone) or LOCAL*<TOOLKIT>\_<TOOL>
3367
+ * (extending). Max 60 chars total.
1614
3368
  */
1615
3369
  slug: string;
3370
+
3371
+ /**
3372
+ * If set, must be a valid Composio toolkit slug. The tool inherits that toolkit's
3373
+ * auth/connection status. If omitted, the tool is standalone (no-auth).
3374
+ */
3375
+ extends_toolkit?: string;
3376
+
3377
+ /**
3378
+ * JSON Schema describing tool output (optional)
3379
+ */
3380
+ output_schema?: { [key: string]: unknown };
1616
3381
  }
1617
3382
  }
1618
3383
  }
1619
3384
 
1620
- export interface SessionCreateParams {
1621
- /**
1622
- * The identifier of the user who is initiating the session, ideally a unique
1623
- * identifier from your database like a user ID or email address
1624
- */
1625
- user_id: string;
1626
-
1627
- /**
1628
- * The auth configs to use for the session. This will override the default behavior
1629
- * and use the given auth config when specific toolkits are being executed
1630
- */
1631
- auth_configs?: { [key: string]: string };
1632
-
1633
- /**
1634
- * The connected accounts to use for the session. This will override the default
1635
- * behaviour and use the given connected account when specific toolkits are being
1636
- * executed. Each connected account must exist (not deleted or disabled) and belong
1637
- * to the same `user_id` as the session — otherwise session creation fails with a
1638
- * clear error explaining which account didn't match.
1639
- */
1640
- connected_accounts?: { [key: string]: string };
1641
-
1642
- /**
1643
- * Experimental features - not stable, may be modified or removed in future
1644
- * versions.
1645
- */
1646
- experimental?: SessionCreateParams.Experimental;
1647
-
1648
- /**
1649
- * Configuration for connection management settings
1650
- */
1651
- manage_connections?: SessionCreateParams.ManageConnections;
1652
-
1653
- /**
1654
- * Configure multi-account behavior. When enabled, users can connect multiple
1655
- * accounts per toolkit.
1656
- */
1657
- multi_account?: SessionCreateParams.MultiAccount;
1658
-
1659
- /**
1660
- * Preload configuration. Controls which tools appear in `session.tools` and the
1661
- * MCP server tool list so the agent can call them directly without going through
1662
- * search first — useful for frequently used tools. Each slug must be allowed by
1663
- * the session filters (`toolkits`, `tools`, `tags`), otherwise session creation
1664
- * fails with a 400. Custom tools declared in `custom_tools` / `custom_toolkits`
1665
- * can also be preloaded. Not supported when multi-account is enabled. Each
1666
- * preloaded tool adds to the agent context window, so keep the list at or under
1667
- * ~20 tools.
1668
- */
1669
- preload?: SessionCreateParams.Preload;
1670
-
1671
- /**
1672
- * Global MCP tool annotation hints for filtering. Array format is treated as
1673
- * enabled list. Object format supports both enabled (tool must have at least one)
1674
- * and disabled (tool must NOT have any) lists. Toolkit-level tags override this.
1675
- * Toolkit enabled/disabled lists take precedence over tag filtering.
1676
- */
1677
- tags?:
1678
- | Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>
1679
- | SessionCreateParams.UnionMember1;
1680
-
3385
+ export interface SessionExecuteMetaParams {
1681
3386
  /**
1682
- * Toolkit configuration - specify either enable toolkits (allowlist) or disable
1683
- * toolkits (denylist). Mutually exclusive.
3387
+ * The unique slug identifier of the meta tool to execute
1684
3388
  */
1685
- toolkits?: SessionCreateParams.Enable | SessionCreateParams.Disable;
3389
+ slug:
3390
+ | 'COMPOSIO_SEARCH_TOOLS'
3391
+ | 'COMPOSIO_MULTI_EXECUTE_TOOL'
3392
+ | 'COMPOSIO_MANAGE_CONNECTIONS'
3393
+ | 'COMPOSIO_WAIT_FOR_CONNECTIONS'
3394
+ | 'COMPOSIO_REMOTE_WORKBENCH'
3395
+ | 'COMPOSIO_REMOTE_BASH_TOOL'
3396
+ | 'COMPOSIO_GET_TOOL_SCHEMAS'
3397
+ | 'COMPOSIO_UPSERT_RECIPE'
3398
+ | 'COMPOSIO_GET_RECIPE';
1686
3399
 
1687
3400
  /**
1688
- * Tool-level configuration per toolkit. Allows you to enable, disable, or filter
1689
- * by tags for specific tools within each toolkit. Every slug passed in `enable` /
1690
- * `disable` must be a valid Composio tool slug for that toolkit — invalid or
1691
- * typo'd slugs fail session creation with a clear error listing which ones didn't
1692
- * match.
3401
+ * The arguments required by the meta tool
1693
3402
  */
1694
- tools?: {
1695
- [key: string]: SessionCreateParams.Enable | SessionCreateParams.Disable | SessionCreateParams.Tags;
1696
- };
3403
+ arguments?: { [key: string]: unknown };
1697
3404
 
1698
3405
  /**
1699
- * Configuration for workbench behavior
3406
+ * Inline custom tools and toolkits for this request. v3.1 sessions do not persist
3407
+ * customs — pass them on every request that needs them.
1700
3408
  */
1701
- workbench?: SessionCreateParams.Workbench;
3409
+ experimental?: SessionExecuteMetaParams.Experimental;
1702
3410
  }
1703
3411
 
1704
- export namespace SessionCreateParams {
3412
+ export namespace SessionExecuteMetaParams {
1705
3413
  /**
1706
- * Experimental features - not stable, may be modified or removed in future
1707
- * versions.
3414
+ * Inline custom tools and toolkits for this request. v3.1 sessions do not persist
3415
+ * customs — pass them on every request that needs them.
1708
3416
  */
1709
3417
  export interface Experimental {
1710
- /**
1711
- * Customize assistive prompt generation (e.g., timezone).
1712
- */
1713
- assistive_prompt_config?: Experimental.AssistivePromptConfig;
1714
-
1715
3418
  /**
1716
3419
  * Custom toolkits with grouped tools. Toolkit slugs must not conflict with
1717
3420
  * existing Composio toolkits. All tools are no-auth.
@@ -1723,26 +3426,9 @@ export namespace SessionCreateParams {
1723
3426
  * extends_toolkit inherit the Composio toolkit's connection.
1724
3427
  */
1725
3428
  custom_tools?: Array<Experimental.CustomTool>;
1726
-
1727
- /**
1728
- * Per-tool elicitation permission config. Default behavior + per-tool
1729
- * always_allow/always_deny overrides. Mutation via PATCH.
1730
- */
1731
- permissions?: Experimental.Permissions;
1732
3429
  }
1733
3430
 
1734
3431
  export namespace Experimental {
1735
- /**
1736
- * Customize assistive prompt generation (e.g., timezone).
1737
- */
1738
- export interface AssistivePromptConfig {
1739
- /**
1740
- * IANA timezone identifier (e.g., 'America/New_York', 'Europe/London'). Used to
1741
- * customize the system prompt with timezone-aware instructions.
1742
- */
1743
- user_timezone?: string;
1744
- }
1745
-
1746
3432
  export interface CustomToolkit {
1747
3433
  /**
1748
3434
  * Used for BM25 search matching and shown in toolkit connection statuses.
@@ -1802,37 +3488,130 @@ export namespace SessionCreateParams {
1802
3488
  */
1803
3489
  description: string;
1804
3490
 
1805
- /**
1806
- * Must have type: "object" and a properties field.
1807
- */
1808
- input_schema: { [key: string]: unknown };
3491
+ /**
3492
+ * Must have type: "object" and a properties field.
3493
+ */
3494
+ input_schema: { [key: string]: unknown };
3495
+
3496
+ /**
3497
+ * Human-readable display name
3498
+ */
3499
+ name: string;
3500
+
3501
+ /**
3502
+ * Tool slug. Forms LOCAL*<TOOL> (standalone) or LOCAL*<TOOLKIT>\_<TOOL>
3503
+ * (extending). Max 60 chars total.
3504
+ */
3505
+ slug: string;
3506
+
3507
+ /**
3508
+ * If set, must be a valid Composio toolkit slug. The tool inherits that toolkit's
3509
+ * auth/connection status. If omitted, the tool is standalone (no-auth).
3510
+ */
3511
+ extends_toolkit?: string;
3512
+
3513
+ /**
3514
+ * JSON Schema describing tool output (optional)
3515
+ */
3516
+ output_schema?: { [key: string]: unknown };
3517
+ }
3518
+ }
3519
+ }
3520
+
3521
+ export interface SessionLinkParams {
3522
+ /**
3523
+ * The unique slug identifier of the toolkit to connect
3524
+ */
3525
+ toolkit: string;
3526
+
3527
+ /**
3528
+ * A human-readable alias for this connected account. Must be unique per entity and
3529
+ * toolkit within the project.
3530
+ */
3531
+ alias?: string;
3532
+
3533
+ /**
3534
+ * URL where users will be redirected after completing auth
3535
+ */
3536
+ callback_url?: string;
3537
+ }
3538
+
3539
+ export interface SessionPatchParams {
3540
+ /**
3541
+ * The auth configs to use for the session. This will override the default behavior
3542
+ * and use the given auth config when specific toolkits are being executed
3543
+ */
3544
+ auth_configs?: { [key: string]: string };
3545
+
3546
+ /**
3547
+ * The connected accounts to use for the session. This will override the default
3548
+ * behaviour and use the given connected account when specific toolkits are being
3549
+ * executed. Each connected account must exist (not deleted or disabled) and belong
3550
+ * to the same `user_id` as the session — otherwise session creation fails with a
3551
+ * clear error explaining which account didn't match.
3552
+ */
3553
+ connected_accounts?: { [key: string]: string };
3554
+
3555
+ execute?: SessionPatchParams.Execute;
3556
+
3557
+ experimental?: SessionPatchParams.Experimental | null;
3558
+
3559
+ manage_connections?: SessionPatchParams.ManageConnections | null;
3560
+
3561
+ multi_account?: SessionPatchParams.MultiAccount | null;
3562
+
3563
+ /**
3564
+ * Preload configuration. Use an explicit list for frequently used tool slugs, or
3565
+ * "all" to dynamically expose every app tool allowed by positive
3566
+ * toolkits/tools/tags filters.
3567
+ */
3568
+ preload?: SessionPatchParams.Preload;
3569
+
3570
+ search?: SessionPatchParams.Search;
3571
+
3572
+ /**
3573
+ * Global MCP tool annotation hints for filtering. Array format is treated as
3574
+ * enabled list. Object format supports both enabled (tool must have at least one)
3575
+ * and disabled (tool must NOT have any) lists. Toolkit-level tags override this.
3576
+ * Toolkit enabled/disabled lists take precedence over tag filtering.
3577
+ */
3578
+ tags?:
3579
+ | Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>
3580
+ | SessionPatchParams.UnionMember1;
3581
+
3582
+ /**
3583
+ * Toolkit configuration - specify either enable toolkits (allowlist) or disable
3584
+ * toolkits (denylist). Mutually exclusive.
3585
+ */
3586
+ toolkits?: SessionPatchParams.Enable | SessionPatchParams.Disable;
1809
3587
 
1810
- /**
1811
- * Human-readable display name
1812
- */
1813
- name: string;
3588
+ /**
3589
+ * Tool-level configuration per toolkit. Allows you to enable, disable, or filter
3590
+ * by tags for specific tools within each toolkit. Every slug passed in `enable` /
3591
+ * `disable` must be a valid Composio tool slug for that toolkit — invalid or
3592
+ * typo'd slugs fail session creation with a clear error listing which ones didn't
3593
+ * match.
3594
+ */
3595
+ tools?: { [key: string]: SessionPatchParams.Enable | SessionPatchParams.Disable | SessionPatchParams.Tags };
1814
3596
 
1815
- /**
1816
- * Tool slug. Forms LOCAL*<TOOL> (standalone) or LOCAL*<TOOLKIT>\_<TOOL>
1817
- * (extending). Max 60 chars total.
1818
- */
1819
- slug: string;
3597
+ workbench?: SessionPatchParams.Workbench | null;
3598
+ }
1820
3599
 
1821
- /**
1822
- * If set, must be a valid Composio toolkit slug. The tool inherits that toolkit's
1823
- * auth/connection status. If omitted, the tool is standalone (no-auth).
1824
- */
1825
- extends_toolkit?: string;
3600
+ export namespace SessionPatchParams {
3601
+ export interface Execute {
3602
+ enable_multi_execute?: boolean;
3603
+ }
1826
3604
 
1827
- /**
1828
- * JSON Schema describing tool output (optional)
1829
- */
1830
- output_schema?: { [key: string]: unknown };
1831
- }
3605
+ export interface Experimental {
3606
+ /**
3607
+ * Per-tool elicitation permission config. Replaces the stored block when provided.
3608
+ */
3609
+ permissions?: Experimental.Permissions;
3610
+ }
1832
3611
 
3612
+ export namespace Experimental {
1833
3613
  /**
1834
- * Per-tool elicitation permission config. Default behavior + per-tool
1835
- * always_allow/always_deny overrides. Mutation via PATCH.
3614
+ * Per-tool elicitation permission config. Replaces the stored block when provided.
1836
3615
  */
1837
3616
  export interface Permissions {
1838
3617
  /**
@@ -1844,17 +3623,18 @@ export namespace SessionCreateParams {
1844
3623
  default: 'allow_all' | 'ask_every_call' | 'ask_once_per_session';
1845
3624
 
1846
3625
  /**
1847
- * Per-tool overrides keyed by `${toolSlug}:${connectedAccountId ?? "__none__"}`.
1848
- * `always_allow` skips the prompt and runs the tool; `always_deny` blocks the
1849
- * tool. Overrides take precedence over `default` and the session cache.
3626
+ * Per-tool overrides keyed by `${toolSlug}:${connectedAccountId ?? "__none__"}`,
3627
+ * plus account-wide overrides keyed by `*:${connectedAccountId ?? "__none__"}`.
3628
+ * Exact tool overrides take precedence over account-wide overrides. `always_allow`
3629
+ * skips the prompt and runs the tool; `always_deny` blocks the tool; `ask_once`
3630
+ * prompts once per session (allow/deny) and remembers; `ask_always` prompts on
3631
+ * every call with allow-once/allow-session/deny, ignoring any cached session
3632
+ * allow. Overrides take precedence over `default`.
1850
3633
  */
1851
- overrides?: { [key: string]: 'always_allow' | 'always_deny' };
3634
+ overrides?: { [key: string]: 'always_allow' | 'always_deny' | 'ask_once' | 'ask_always' };
1852
3635
  }
1853
3636
  }
1854
3637
 
1855
- /**
1856
- * Configuration for connection management settings
1857
- */
1858
3638
  export interface ManageConnections {
1859
3639
  /**
1860
3640
  * The URL to redirect to after a user completes authentication for a connected
@@ -1884,10 +3664,6 @@ export namespace SessionCreateParams {
1884
3664
  enable_wait_for_connections?: boolean | null;
1885
3665
  }
1886
3666
 
1887
- /**
1888
- * Configure multi-account behavior. When enabled, users can connect multiple
1889
- * accounts per toolkit.
1890
- */
1891
3667
  export interface MultiAccount {
1892
3668
  /**
1893
3669
  * When true, enables multi-account mode for this session. When not set, falls back
@@ -1909,23 +3685,21 @@ export namespace SessionCreateParams {
1909
3685
  }
1910
3686
 
1911
3687
  /**
1912
- * Preload configuration. Controls which tools appear in `session.tools` and the
1913
- * MCP server tool list so the agent can call them directly without going through
1914
- * search first — useful for frequently used tools. Each slug must be allowed by
1915
- * the session filters (`toolkits`, `tools`, `tags`), otherwise session creation
1916
- * fails with a 400. Custom tools declared in `custom_tools` / `custom_toolkits`
1917
- * can also be preloaded. Not supported when multi-account is enabled. Each
1918
- * preloaded tool adds to the agent context window, so keep the list at or under
1919
- * ~20 tools.
3688
+ * Preload configuration. Use an explicit list for frequently used tool slugs, or
3689
+ * "all" to dynamically expose every app tool allowed by positive
3690
+ * toolkits/tools/tags filters.
1920
3691
  */
1921
3692
  export interface Preload {
1922
3693
  /**
1923
- * Tool slugs to preload. Each slug must be allowed by the session filters
1924
- * (`toolkits`, `tools`, `tags`) and exist either in the Composio tool catalog or
1925
- * in `custom_tools` / `custom_toolkits` unknown or blocked slugs return a 400 at
1926
- * session creation.
3694
+ * Explicit tool slugs to preload, or "all" to dynamically expose all current and
3695
+ * future app tools allowed by the positive session filters. "all" is capped at
3696
+ * 1000 tools and is not supported without a positive allowlist.
1927
3697
  */
1928
- tools?: Array<string>;
3698
+ tools?: Array<string> | string;
3699
+ }
3700
+
3701
+ export interface Search {
3702
+ enable?: boolean;
1929
3703
  }
1930
3704
 
1931
3705
  export interface UnionMember1 {
@@ -1984,9 +3758,6 @@ export namespace SessionCreateParams {
1984
3758
  }
1985
3759
  }
1986
3760
 
1987
- /**
1988
- * Configuration for workbench behavior
1989
- */
1990
3761
  export interface Workbench {
1991
3762
  /**
1992
3763
  * Character threshold for automatic offloading. When workbench response exceeds
@@ -2009,83 +3780,13 @@ export namespace SessionCreateParams {
2009
3780
 
2010
3781
  /**
2011
3782
  * Sandbox compute tier: standard (1 vCPU / 1 GB), medium (2 vCPU / 2 GB), large (4
2012
- * vCPU / 4 GB), xlarge (8 vCPU / 8 GB). Defaults to standard.
3783
+ * vCPU / 4 GB), xlarge (8 vCPU / 8 GB). Patching this value recreates the sandbox
3784
+ * on next access — sandbox FS state is lost, but /mnt/files/ R2 mount persists.
2013
3785
  */
2014
3786
  sandbox_size?: 'standard' | 'medium' | 'large' | 'xlarge';
2015
3787
  }
2016
3788
  }
2017
3789
 
2018
- export interface SessionExecuteParams {
2019
- /**
2020
- * The unique slug identifier of the tool to execute. Supports both meta tools and
2021
- * app tools exposed by the session.
2022
- */
2023
- tool_slug: string;
2024
-
2025
- /**
2026
- * Account identifier to specify which connected account to use for direct tool
2027
- * execution. Use the account ID (e.g. "coup_hurricane_dal_analytical") or an
2028
- * alias. When omitted with a single account, the default is used. When omitted
2029
- * with multiple accounts, an error lists available accounts. Meta/helper tools
2030
- * either ignore this top-level field or define their own account-selection fields,
2031
- * for example COMPOSIO_MULTI_EXECUTE_TOOL.tools[].account.
2032
- */
2033
- account?: string;
2034
-
2035
- /**
2036
- * The arguments required by the tool
2037
- */
2038
- arguments?: { [key: string]: unknown };
2039
-
2040
- /**
2041
- * When true, direct non-meta tool execution may return a workbench offload preview
2042
- * if the response exceeds the configured threshold and the session workbench is
2043
- * enabled. When omitted or false, direct tool execution returns the normal inline
2044
- * response. Meta/helper tools are unaffected, and COMPOSIO_MULTI_EXECUTE_TOOL uses
2045
- * session.workbench configuration for its own batch-level offload behavior.
2046
- */
2047
- enable_auto_workbench_offload?: boolean;
2048
- }
2049
-
2050
- export interface SessionExecuteMetaParams {
2051
- /**
2052
- * The unique slug identifier of the meta tool to execute
2053
- */
2054
- slug:
2055
- | 'COMPOSIO_SEARCH_TOOLS'
2056
- | 'COMPOSIO_MULTI_EXECUTE_TOOL'
2057
- | 'COMPOSIO_MANAGE_CONNECTIONS'
2058
- | 'COMPOSIO_WAIT_FOR_CONNECTIONS'
2059
- | 'COMPOSIO_REMOTE_WORKBENCH'
2060
- | 'COMPOSIO_REMOTE_BASH_TOOL'
2061
- | 'COMPOSIO_GET_TOOL_SCHEMAS'
2062
- | 'COMPOSIO_UPSERT_RECIPE'
2063
- | 'COMPOSIO_GET_RECIPE';
2064
-
2065
- /**
2066
- * The arguments required by the meta tool
2067
- */
2068
- arguments?: { [key: string]: unknown };
2069
- }
2070
-
2071
- export interface SessionLinkParams {
2072
- /**
2073
- * The unique slug identifier of the toolkit to connect
2074
- */
2075
- toolkit: string;
2076
-
2077
- /**
2078
- * A human-readable alias for this connected account. Must be unique per entity and
2079
- * toolkit within the project.
2080
- */
2081
- alias?: string;
2082
-
2083
- /**
2084
- * URL where users will be redirected after completing auth
2085
- */
2086
- callback_url?: string;
2087
- }
2088
-
2089
3790
  export interface SessionProxyExecuteParams {
2090
3791
  /**
2091
3792
  * The API endpoint to call (absolute URL or path relative to base URL of the
@@ -2945,13 +4646,18 @@ export namespace SessionProxyExecuteParams {
2945
4646
 
2946
4647
  export interface SessionSearchParams {
2947
4648
  /**
2948
- * List of search queries to execute in parallel. Up to 7 queries supported.
4649
+ * List of search queries to execute in parallel.
2949
4650
  */
2950
4651
  queries: Array<SessionSearchParams.Query>;
2951
4652
 
2952
4653
  /**
2953
- * Optional model hint for search/planning behavior (e.g., "gpt-4o"). Ignored if
2954
- * invalid.
4654
+ * Inline custom tools and toolkits for this request. v3.1 sessions do not persist
4655
+ * customs — pass them on every request that needs them.
4656
+ */
4657
+ experimental?: SessionSearchParams.Experimental;
4658
+
4659
+ /**
4660
+ * Optional model hint for search/planning behavior (e.g., "gpt-4o").
2955
4661
  */
2956
4662
  model?: string;
2957
4663
  }
@@ -2970,6 +4676,113 @@ export namespace SessionSearchParams {
2970
4676
  */
2971
4677
  known_fields?: string;
2972
4678
  }
4679
+
4680
+ /**
4681
+ * Inline custom tools and toolkits for this request. v3.1 sessions do not persist
4682
+ * customs — pass them on every request that needs them.
4683
+ */
4684
+ export interface Experimental {
4685
+ /**
4686
+ * Custom toolkits with grouped tools. Toolkit slugs must not conflict with
4687
+ * existing Composio toolkits. All tools are no-auth.
4688
+ */
4689
+ custom_toolkits?: Array<Experimental.CustomToolkit>;
4690
+
4691
+ /**
4692
+ * Custom tools to include in search. Standalone tools need no auth. Tools with
4693
+ * extends_toolkit inherit the Composio toolkit's connection.
4694
+ */
4695
+ custom_tools?: Array<Experimental.CustomTool>;
4696
+ }
4697
+
4698
+ export namespace Experimental {
4699
+ export interface CustomToolkit {
4700
+ /**
4701
+ * Used for BM25 search matching and shown in toolkit connection statuses.
4702
+ */
4703
+ description: string;
4704
+
4705
+ /**
4706
+ * Display name shown to the LLM and in search results.
4707
+ */
4708
+ name: string;
4709
+
4710
+ /**
4711
+ * Unique slug for the toolkit. Must not conflict with existing Composio toolkit
4712
+ * slugs. Alphanumeric, underscores, and hyphens only.
4713
+ */
4714
+ slug: string;
4715
+
4716
+ /**
4717
+ * Tools in this custom toolkit
4718
+ */
4719
+ tools: Array<CustomToolkit.Tool>;
4720
+ }
4721
+
4722
+ export namespace CustomToolkit {
4723
+ export interface Tool {
4724
+ /**
4725
+ * Used for BM25 search matching and shown to the LLM.
4726
+ */
4727
+ description: string;
4728
+
4729
+ /**
4730
+ * Must have type: "object" and a properties field.
4731
+ */
4732
+ input_schema: { [key: string]: unknown };
4733
+
4734
+ /**
4735
+ * Human-readable display name
4736
+ */
4737
+ name: string;
4738
+
4739
+ /**
4740
+ * Tool slug. Combined with toolkit slug to form LOCAL*<TOOLKIT>*<TOOL> (max 60
4741
+ * chars total).
4742
+ */
4743
+ slug: string;
4744
+
4745
+ /**
4746
+ * Optional output schema for the tool response.
4747
+ */
4748
+ output_schema?: { [key: string]: unknown };
4749
+ }
4750
+ }
4751
+
4752
+ export interface CustomTool {
4753
+ /**
4754
+ * Used for BM25 search matching and shown to the LLM.
4755
+ */
4756
+ description: string;
4757
+
4758
+ /**
4759
+ * Must have type: "object" and a properties field.
4760
+ */
4761
+ input_schema: { [key: string]: unknown };
4762
+
4763
+ /**
4764
+ * Human-readable display name
4765
+ */
4766
+ name: string;
4767
+
4768
+ /**
4769
+ * Tool slug. Forms LOCAL*<TOOL> (standalone) or LOCAL*<TOOLKIT>\_<TOOL>
4770
+ * (extending). Max 60 chars total.
4771
+ */
4772
+ slug: string;
4773
+
4774
+ /**
4775
+ * If set, must be a valid Composio toolkit slug. The tool inherits that toolkit's
4776
+ * auth/connection status. If omitted, the tool is standalone (no-auth).
4777
+ */
4778
+ extends_toolkit?: string;
4779
+
4780
+ /**
4781
+ * JSON Schema describing tool output (optional)
4782
+ */
4783
+ output_schema?: { [key: string]: unknown };
4784
+ }
4785
+ }
2973
4786
  }
2974
4787
 
2975
4788
  export interface SessionToolkitsParams {
@@ -3004,7 +4817,20 @@ export interface SessionToolkitsParams {
3004
4817
  toolkits?: Array<string> | null;
3005
4818
  }
3006
4819
 
3007
- export interface SessionToolsParams {}
4820
+ export interface SessionToolsParams {
4821
+ /**
4822
+ * Cursor for pagination. The cursor is a base64 encoded string of the page and
4823
+ * limit. The page is the page number and the limit is the number of items per
4824
+ * page. The cursor is used to paginate through the items. The cursor is not
4825
+ * required for the first page.
4826
+ */
4827
+ cursor?: string;
4828
+
4829
+ /**
4830
+ * Number of items per page, max allowed is 500
4831
+ */
4832
+ limit?: number;
4833
+ }
3008
4834
 
3009
4835
  Session.Files = Files;
3010
4836
 
@@ -3012,17 +4838,23 @@ export declare namespace Session {
3012
4838
  export {
3013
4839
  type SessionCreateResponse as SessionCreateResponse,
3014
4840
  type SessionRetrieveResponse as SessionRetrieveResponse,
4841
+ type SessionAttachResponse as SessionAttachResponse,
4842
+ type SessionConfigHistoryResponse as SessionConfigHistoryResponse,
3015
4843
  type SessionExecuteResponse as SessionExecuteResponse,
3016
4844
  type SessionExecuteMetaResponse as SessionExecuteMetaResponse,
3017
4845
  type SessionLinkResponse as SessionLinkResponse,
4846
+ type SessionPatchResponse as SessionPatchResponse,
3018
4847
  type SessionProxyExecuteResponse as SessionProxyExecuteResponse,
3019
4848
  type SessionSearchResponse as SessionSearchResponse,
3020
4849
  type SessionToolkitsResponse as SessionToolkitsResponse,
3021
4850
  type SessionToolsResponse as SessionToolsResponse,
3022
4851
  type SessionCreateParams as SessionCreateParams,
4852
+ type SessionAttachParams as SessionAttachParams,
4853
+ type SessionConfigHistoryParams as SessionConfigHistoryParams,
3023
4854
  type SessionExecuteParams as SessionExecuteParams,
3024
4855
  type SessionExecuteMetaParams as SessionExecuteMetaParams,
3025
4856
  type SessionLinkParams as SessionLinkParams,
4857
+ type SessionPatchParams as SessionPatchParams,
3026
4858
  type SessionProxyExecuteParams as SessionProxyExecuteParams,
3027
4859
  type SessionSearchParams as SessionSearchParams,
3028
4860
  type SessionToolkitsParams as SessionToolkitsParams,