@composio/core 0.3.4 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -2993,6 +2993,37 @@ var Tools = class {
2993
2993
  return modifiedTools;
2994
2994
  }
2995
2995
  /**
2996
+ * Fetches the meta tools for a tool router session.
2997
+ * This method fetches the meta tools from the Composio API and transforms them to the expected format.
2998
+ * It provides access to the underlying meta tool data without provider-specific wrapping.
2999
+ *
3000
+ * @param sessionId {string} The session id to get the meta tools for
3001
+ * @param options {SchemaModifierOptions} Optional configuration for tool retrieval
3002
+ * @param {TransformToolSchemaModifier} [options.modifySchema] - Function to transform the tool schema
3003
+ * @returns {Promise<ToolList>} The list of meta tools
3004
+ *
3005
+ * @example
3006
+ * ```typescript
3007
+ * const metaTools = await composio.tools.getRawToolRouterMetaTools('session_123');
3008
+ * console.log(metaTools);
3009
+ * ```
3010
+ */
3011
+ async getRawToolRouterMetaTools(sessionId, options) {
3012
+ let modifiedTools = (await this.client.toolRouter.session.tools(sessionId)).items.map((tool) => this.transformToolCases(tool));
3013
+ if (options?.modifySchema) {
3014
+ const modifier = options.modifySchema;
3015
+ if (typeof modifier === "function") {
3016
+ const modifiedPromises = modifiedTools.map((tool) => modifier({
3017
+ toolSlug: tool.slug,
3018
+ toolkitSlug: tool.toolkit?.slug ?? "unknown",
3019
+ schema: tool
3020
+ }));
3021
+ modifiedTools = await Promise.all(modifiedPromises);
3022
+ } else throw new ComposioInvalidModifierError("Invalid schema modifier. Not a function.");
3023
+ }
3024
+ return modifiedTools;
3025
+ }
3026
+ /**
2996
3027
  * Retrieves a specific tool by its slug from the Composio API.
2997
3028
  *
2998
3029
  * This method fetches a single tool in raw format without provider-specific wrapping,
@@ -3120,7 +3151,7 @@ var Tools = class {
3120
3151
  *
3121
3152
  * @param {string} sessionId - The session id to execute the tool for
3122
3153
  * @param {Tool[]} tools - The tools to wrap
3123
- * @param {ExecuteToolModifiers} modifiers - The modifiers to apply to the tool
3154
+ * @param {SessionExecuteMetaModifiers} modifiers - The modifiers to apply to the tool
3124
3155
  * @returns {Tool[]} The wrapped tools
3125
3156
  */
3126
3157
  wrapToolsForToolRouter(sessionId, tools, modifiers) {
@@ -3152,7 +3183,7 @@ var Tools = class {
3152
3183
  * Creates a function that executes a tool for a tool router session
3153
3184
  *
3154
3185
  * @param {string} sessionId - The session id to execute the tool for
3155
- * @param {ExecuteToolModifiers} modifiers - The modifiers to apply to the tool
3186
+ * @param {SessionExecuteMetaModifiers} modifiers - The modifiers to apply to the tool
3156
3187
  * @returns {ExecuteToolFn} The execute tool function
3157
3188
  */
3158
3189
  createExecuteToolFnForToolRouter(sessionId, modifiers) {
@@ -3290,36 +3321,36 @@ var Tools = class {
3290
3321
  * @param {ToolExecuteMetaParams} body - The execution parameters
3291
3322
  * @param {string} body.sessionId - The session id to execute the tool for
3292
3323
  * @param {Record<string, unknown>} body.arguments - The input to pass to the tool
3293
- * @param {ExecuteToolModifiers} modifiers - The modifiers to apply to the tool
3324
+ * @param {SessionExecuteMetaModifiers} modifiers - The modifiers to apply to the tool
3294
3325
  * @returns {Promise<ToolExecuteResponse>} The response from the tool execution
3295
3326
  */
3296
3327
  async executeMetaTool(toolSlug, body, modifiers) {
3297
3328
  const executeMetaParams = ToolExecuteMetaParamsSchema.safeParse(body);
3298
3329
  if (!executeMetaParams.success) throw new ValidationError("Invalid tool execute meta parameters", { cause: executeMetaParams.error });
3299
- const tool = await this.getRawComposioToolBySlug(toolSlug);
3300
- if (!tool) throw new ComposioToolNotFoundError(`Tool ${toolSlug} not found`, { meta: {
3301
- slug: toolSlug,
3302
- sessionId: body.sessionId
3303
- } });
3304
- const params = await this.applyBeforeExecuteModifiers(tool, {
3330
+ let modifiedParams = body.arguments ?? {};
3331
+ if (modifiers?.beforeExecute) modifiedParams = await modifiers.beforeExecute({
3305
3332
  toolSlug,
3306
- toolkitSlug: tool.toolkit?.slug ?? "unknown",
3307
- params: body.arguments ?? {}
3308
- }, modifiers?.beforeExecute);
3333
+ toolkitSlug: "composio",
3334
+ sessionId: body.sessionId,
3335
+ params: modifiedParams
3336
+ });
3309
3337
  const response = await this.client.toolRouter.session.executeMeta(body.sessionId, {
3310
3338
  slug: toolSlug,
3311
- arguments: params
3339
+ arguments: modifiedParams
3312
3340
  });
3313
- return await this.applyAfterExecuteModifiers(tool, {
3341
+ let result = {
3342
+ data: response.data,
3343
+ error: response.error,
3344
+ successful: !response.error,
3345
+ logId: response.log_id
3346
+ };
3347
+ if (modifiers?.afterExecute) result = await modifiers.afterExecute({
3314
3348
  toolSlug,
3315
- toolkitSlug: tool.toolkit?.slug ?? "unknown",
3316
- result: {
3317
- data: response.data,
3318
- error: response.error,
3319
- successful: !response.error,
3320
- logId: response.log_id
3321
- }
3322
- }, modifiers?.afterExecute);
3349
+ toolkitSlug: "composio",
3350
+ sessionId: body.sessionId,
3351
+ result
3352
+ });
3353
+ return result;
3323
3354
  }
3324
3355
  /**
3325
3356
  * Fetches the list of all available tools in the Composio SDK.
@@ -5322,7 +5353,7 @@ const MCPServerConnectedAccountsSchema = z.record(z.string(), z.array(z.object({
5322
5353
  })));
5323
5354
 
5324
5355
  //#endregion
5325
- //#region src/models/MCP.experimental.ts
5356
+ //#region src/models/MCP.ts
5326
5357
  function transformMCPItemResponse(response) {
5327
5358
  return transform(response).with(MCPItemSchema).using((raw) => ({
5328
5359
  name: raw.name,
@@ -5341,7 +5372,7 @@ function transformMCPItemResponse(response) {
5341
5372
  * Handles MCP server operations.
5342
5373
  * When `config.experimental.mcp` is enabled, this class augments the features of `composio.mcp`.
5343
5374
  */
5344
- var MCP$1 = class {
5375
+ var MCP = class {
5345
5376
  client;
5346
5377
  constructor(client) {
5347
5378
  this.client = client;
@@ -6224,7 +6255,7 @@ var OpenAIProvider = class extends BaseNonAgenticProvider {
6224
6255
 
6225
6256
  //#endregion
6226
6257
  //#region package.json
6227
- var version = "0.3.4";
6258
+ var version = "0.4.0";
6228
6259
 
6229
6260
  //#endregion
6230
6261
  //#region src/models/Files.ts
@@ -6305,7 +6336,8 @@ const getDefaultHeaders = (headers, provider) => {
6305
6336
  const MCPServerTypeSchema = z.enum(["http", "sse"]);
6306
6337
  const ToolRouterConfigManageConnectionsSchema = z.object({
6307
6338
  enable: z.boolean().default(true).optional().describe("Whether to use tools to manage connections in the tool router session. Defaults to true, if set to false, you need to manage connections manually"),
6308
- callbackUrl: z.string().optional().describe("The callback uri to use in the tool router session")
6339
+ callbackUrl: z.string().optional().describe("The callback uri to use in the tool router session"),
6340
+ waitForConnections: z.boolean().optional().describe("Whether to wait for users to finish authenticating connections before proceeding to the next step. Defaults to false, if set to true, a wait for connections tool call will happen and finish when the connections are ready")
6309
6341
  }).strict();
6310
6342
  const ToolRouterToolkitsParamSchema = z.array(z.string()).describe("List of toolkits to enable in the tool router session");
6311
6343
  const ToolRouterToolkitsDisabledConfigSchema = z.object({ disable: ToolRouterToolkitsParamSchema.describe("List of toolkits to disable in the tool router session") }).strict();
@@ -6445,6 +6477,30 @@ const transformToolRouterTagsParams = (params) => {
6445
6477
  disable: params.disable
6446
6478
  };
6447
6479
  };
6480
+ const transformToolRouterManageConnectionsParams = (params) => {
6481
+ if (params === void 0) return { enable: true };
6482
+ if (typeof params === "boolean") return { enable: params };
6483
+ const parsedResult = ToolRouterConfigManageConnectionsSchema.safeParse(params);
6484
+ if (!parsedResult.success) throw new ValidationError("Failed to parse manage connections config", { cause: parsedResult.error });
6485
+ const config = parsedResult.data;
6486
+ return {
6487
+ enable: config.enable ?? true,
6488
+ callback_url: config.callbackUrl,
6489
+ enable_wait_for_connections: config.waitForConnections
6490
+ };
6491
+ };
6492
+ const transformToolRouterWorkbenchParams = (params) => {
6493
+ if (!params) return;
6494
+ return {
6495
+ enable_proxy_execution: params.enableProxyExecution,
6496
+ auto_offload_threshold: params.autoOffloadThreshold
6497
+ };
6498
+ };
6499
+ const transformToolRouterToolkitsParams = (params) => {
6500
+ if (!params) return;
6501
+ if (Array.isArray(params)) return { enable: params };
6502
+ return params;
6503
+ };
6448
6504
 
6449
6505
  //#endregion
6450
6506
  //#region src/models/ToolRouter.ts
@@ -6529,14 +6585,13 @@ var ToolRouter = class {
6529
6585
  * Creates a function that wraps the tools based on the provider.
6530
6586
  * The returned tools will be of the type the frameworks expects.
6531
6587
  *
6532
- * @param userId - The user id to get the tools for
6533
- * @param tools - The tools to wrap
6534
- * @returns A function that wraps the tools based on the provider.
6588
+ * @param sessionId - The session id to get the tools for
6589
+ * @returns A function that wraps the tools based on the provider with session-specific modifiers.
6535
6590
  */
6536
- createToolsFn = (sessionId, toolSlugs) => {
6591
+ createToolsFn = (sessionId) => {
6537
6592
  return async (modifiers) => {
6538
6593
  const ToolsModel = new Tools(this.client, this.config);
6539
- const tools = await ToolsModel.getRawComposioTools({ tools: toolSlugs }, modifiers?.modifySchema ? { modifySchema: modifiers?.modifySchema } : void 0);
6594
+ const tools = await ToolsModel.getRawToolRouterMetaTools(sessionId, modifiers?.modifySchema ? { modifySchema: modifiers?.modifySchema } : void 0);
6540
6595
  return ToolsModel.wrapToolsForToolRouter(sessionId, tools, modifiers);
6541
6596
  };
6542
6597
  };
@@ -6590,31 +6645,21 @@ var ToolRouter = class {
6590
6645
  */
6591
6646
  async create(userId, config) {
6592
6647
  const routerConfig = ToolRouterCreateSessionConfigSchema.parse(config ?? {});
6593
- const manageConnectedAccounts = typeof routerConfig.manageConnections === "boolean" ? routerConfig.manageConnections : routerConfig.manageConnections?.enable ?? true;
6594
- const toolkits = Array.isArray(routerConfig.toolkits) ? { enable: routerConfig.toolkits } : routerConfig.toolkits;
6595
- const tags = transformToolRouterTagsParams(routerConfig.tags);
6596
- const tools = transformToolRouterToolsParams(routerConfig.tools);
6597
6648
  const payload = {
6598
6649
  user_id: userId,
6599
- toolkits,
6600
6650
  auth_configs: routerConfig.authConfigs,
6601
6651
  connected_accounts: routerConfig.connectedAccounts,
6602
- tools,
6603
- tags,
6604
- manage_connections: {
6605
- enable: manageConnectedAccounts,
6606
- callback_url: typeof routerConfig.manageConnections === "object" ? routerConfig.manageConnections.callbackUrl : void 0
6607
- },
6608
- workbench: routerConfig.workbench ? {
6609
- enable_proxy_execution: routerConfig.workbench?.enableProxyExecution,
6610
- auto_offload_threshold: routerConfig.workbench?.autoOffloadThreshold
6611
- } : void 0
6652
+ toolkits: transformToolRouterToolkitsParams(routerConfig.toolkits),
6653
+ tools: transformToolRouterToolsParams(routerConfig.tools),
6654
+ tags: transformToolRouterTagsParams(routerConfig.tags),
6655
+ manage_connections: transformToolRouterManageConnectionsParams(routerConfig.manageConnections),
6656
+ workbench: transformToolRouterWorkbenchParams(routerConfig.workbench)
6612
6657
  };
6613
6658
  const session = await this.client.toolRouter.session.create(payload);
6614
6659
  return {
6615
6660
  sessionId: session.session_id,
6616
6661
  mcp: this.createMCPServerConfig(session.mcp),
6617
- tools: this.createToolsFn(session.session_id, session.tool_router_tools),
6662
+ tools: this.createToolsFn(session.session_id),
6618
6663
  authorize: this.createAuthorizeFn(session.session_id),
6619
6664
  toolkits: this.createToolkitsFn(session.session_id)
6620
6665
  };
@@ -6641,7 +6686,7 @@ var ToolRouter = class {
6641
6686
  return {
6642
6687
  sessionId: session.session_id,
6643
6688
  mcp: this.createMCPServerConfig(session.mcp),
6644
- tools: this.createToolsFn(session.session_id, session.tool_router_tools),
6689
+ tools: this.createToolsFn(session.session_id),
6645
6690
  authorize: this.createAuthorizeFn(session.session_id),
6646
6691
  toolkits: this.createToolkitsFn(session.session_id)
6647
6692
  };
@@ -6668,13 +6713,21 @@ var Composio = class Composio {
6668
6713
  /**
6669
6714
  * Core models for Composio.
6670
6715
  */
6716
+ /** List, retrieve, and execute tools */
6671
6717
  tools;
6718
+ /** Retrieve toolkit metadata and authorize user connections */
6672
6719
  toolkits;
6720
+ /** Manage webhook triggers and event subscriptions */
6673
6721
  triggers;
6722
+ /** The tool provider instance used for wrapping tools in framework-specific formats */
6674
6723
  provider;
6724
+ /** Upload and download files */
6675
6725
  files;
6726
+ /** Manage authentication configurations for toolkits */
6676
6727
  authConfigs;
6728
+ /** Manage authenticated connections */
6677
6729
  connectedAccounts;
6730
+ /** Model Context Protocol server management */
6678
6731
  mcp;
6679
6732
  /**
6680
6733
  * Experimental feature, use with caution
@@ -6713,10 +6766,6 @@ var Composio = class Composio {
6713
6766
  */
6714
6767
  use;
6715
6768
  /**
6716
- * Experimental features
6717
- */
6718
- experimental;
6719
- /**
6720
6769
  * Creates a new instance of the Composio SDK.
6721
6770
  *
6722
6771
  * The constructor initializes the SDK with the provided configuration options,
@@ -6777,7 +6826,7 @@ var Composio = class Composio {
6777
6826
  logLevel: COMPOSIO_LOG_LEVEL
6778
6827
  });
6779
6828
  this.tools = new Tools(this.client, this.config);
6780
- this.mcp = new MCP$1(this.client);
6829
+ this.mcp = new MCP(this.client);
6781
6830
  this.toolkits = new Toolkits(this.client);
6782
6831
  this.triggers = new Triggers(this.client, this.config);
6783
6832
  this.authConfigs = new AuthConfigs(this.client);
@@ -6791,17 +6840,6 @@ var Composio = class Composio {
6791
6840
  this.create = this.toolRouter.create.bind(this.toolRouter);
6792
6841
  this.use = this.toolRouter.use.bind(this.toolRouter);
6793
6842
  /**
6794
- * Initialize Experimental features
6795
- */
6796
- this.experimental = {
6797
- create: async (userId, routerConfig) => {
6798
- return this.toolRouter.create(userId, routerConfig);
6799
- },
6800
- use: async (id) => {
6801
- return this.toolRouter.use(id);
6802
- }
6803
- };
6804
- /**
6805
6843
  * Initialize the client telemetry.
6806
6844
  */
6807
6845
  if (this.config.allowTracking) telemetry.setup({
@@ -7291,627 +7329,5 @@ const ComposioMcpUpdateResponseSchema = z$1.object({
7291
7329
  tools: z$1.array(z$1.string()).optional()
7292
7330
  });
7293
7331
 
7294
- //#endregion
7295
- //#region src/utils/transformers/mcp.ts
7296
- /**
7297
- * Transform MCP create response from snake_case to camelCase
7298
- */
7299
- function transformMcpCreateResponse(response) {
7300
- const result = CustomCreateResponseSchema.safeParse({
7301
- id: response.id,
7302
- name: response.name,
7303
- createdAt: response.created_at,
7304
- updatedAt: response.updated_at,
7305
- status: response.status
7306
- });
7307
- if (!result.success) throw new ValidationError("Failed to parse MCP create response", { cause: result.error });
7308
- return result.data;
7309
- }
7310
- /**
7311
- * Transform MCP list response from snake_case to camelCase
7312
- */
7313
- function transformMcpListResponse(response) {
7314
- const transformedItems = response.items?.map((item) => ({
7315
- id: item.id,
7316
- name: item.name,
7317
- createdAt: item.created_at,
7318
- updatedAt: item.updated_at,
7319
- status: item.status
7320
- }));
7321
- const result = McpListResponseSchema.safeParse({ items: transformedItems });
7322
- if (!result.success) throw new ValidationError("Failed to parse MCP list response", { cause: result.error });
7323
- return result.data;
7324
- }
7325
- /**
7326
- * Transform MCP retrieve response from snake_case to camelCase
7327
- */
7328
- function transformMcpRetrieveResponse(response) {
7329
- const result = McpRetrieveResponseSchema.safeParse({
7330
- id: response.id,
7331
- name: response.name,
7332
- createdAt: response.created_at,
7333
- updatedAt: response.updated_at,
7334
- status: response.status,
7335
- toolkits: response.toolkits,
7336
- tools: response.allowed_tools,
7337
- managedAuthViaComposio: response.managed_auth_via_composio,
7338
- authConfigIds: response.auth_config_ids,
7339
- mcpUrl: response.mcp_url,
7340
- commands: response.commands
7341
- });
7342
- if (!result.success) throw new ValidationError("Failed to parse MCP retrieve response", { cause: result.error });
7343
- return result.data;
7344
- }
7345
- /**
7346
- * Transform MCP delete response from snake_case to camelCase
7347
- */
7348
- function transformMcpDeleteResponse(response) {
7349
- const result = McpDeleteResponseSchema.safeParse({
7350
- id: response.id,
7351
- deleted: response.deleted,
7352
- message: response.message
7353
- });
7354
- if (!result.success) throw new ValidationError("Failed to parse MCP delete response", { cause: result.error });
7355
- return result.data;
7356
- }
7357
- /**
7358
- * Transform MCP update response from snake_case to camelCase
7359
- */
7360
- function transformMcpUpdateResponse(response) {
7361
- const result = McpUpdateResponseSchema.safeParse({
7362
- id: response.id,
7363
- name: response.name,
7364
- createdAt: response.created_at,
7365
- updatedAt: response.updated_at,
7366
- status: response.status,
7367
- toolkits: response.toolkits,
7368
- tools: response.tools
7369
- });
7370
- if (!result.success) throw new ValidationError("Failed to parse MCP update response", { cause: result.error });
7371
- return result.data;
7372
- }
7373
- /**
7374
- * Transform MCP generate URL response from snake_case to camelCase
7375
- */
7376
- function transformMcpGenerateUrlResponse(response) {
7377
- const result = GenerateURLResponseSchema.safeParse({
7378
- connectedAccountUrls: response.connected_account_urls,
7379
- userIdsUrl: response.user_ids_url,
7380
- mcpUrl: response.mcp_url
7381
- });
7382
- if (!result.success) throw new ValidationError("Failed to parse MCP generate URL response", { cause: result.error });
7383
- return result.data;
7384
- }
7385
-
7386
- //#endregion
7387
- //#region src/models/MCP.ts
7388
- /**
7389
- * MCP (Model Control Protocol) class
7390
- * Handles MCP server operations
7391
- */
7392
- var MCP = class {
7393
- client;
7394
- toolkits;
7395
- provider;
7396
- constructor(client, provider) {
7397
- this.client = client;
7398
- this.provider = provider;
7399
- this.toolkits = new Toolkits(client);
7400
- telemetry.instrument(this, "MCP");
7401
- }
7402
- /**
7403
- * Validates toolkit configurations using Zod schema
7404
- * @private
7405
- * @param {MCPToolkitConfig[]} toolkitConfigs - Array of toolkit configurations to validate
7406
- * @param {MCPAuthOptions} [authOptions] - Authentication options to validate
7407
- * @throws {ValidationError} If validation fails
7408
- */
7409
- validateInputs(toolkitConfigs, authOptions) {
7410
- const toolkitConfigsResult = MCPToolkitConfigsArraySchema.safeParse(toolkitConfigs);
7411
- if (toolkitConfigsResult.error) throw new ValidationError("Failed to parse toolkit configurations", { cause: toolkitConfigsResult.error });
7412
- if (authOptions !== void 0) {
7413
- const authOptionsResult = MCPAuthOptionsSchema.safeParse(authOptions);
7414
- if (authOptionsResult.error) throw new ValidationError("Failed to parse auth options", { cause: authOptionsResult.error });
7415
- }
7416
- }
7417
- /**
7418
- * Create a new MCP server
7419
- * @param {Object} params - Parameters for creating the MCP server
7420
- * @param {Array} params.authConfig - Array of auth configurations with id and allowed tools
7421
- * @param {Object} params.options - Server creation options
7422
- * @param {string} params.options.name - Unique name for the MCP server
7423
- * @param {boolean} [params.options.isChatAuth] - Whether to use chat-based authentication
7424
- * @returns {Promise<McpServerCreateResponse<TMcpResponse>>} Created server details with instance getter
7425
- *
7426
- * @example
7427
- * ```typescript
7428
- * const server = await composio.mcp.create("personal-mcp-server", [
7429
- * {
7430
- * authConfigId: "ac_xyz",
7431
- * allowedTools: ["GMAIL_FETCH_EMAILS", "SLACK_SEND_MESSAGE"]
7432
- * }
7433
- * ],
7434
- * {
7435
- * isChatAuth: true
7436
- * }
7437
- * });
7438
- *
7439
- * // Use convenience method on response
7440
- * const urls = await server.getServer({
7441
- * userId: "user123"
7442
- * });
7443
- * ```
7444
- */
7445
- async create(name, serverConfig, options) {
7446
- if (!serverConfig || serverConfig.length === 0) throw new ValidationError("At least one auth config is required", {});
7447
- if (!name) throw new ValidationError("Server name is required", {});
7448
- try {
7449
- const mcpServer = await this.getByName(name);
7450
- const authConfigs = mcpServer.authConfigIds?.sort();
7451
- const sortedCurrentAuthConfigs = serverConfig.map((config) => config.authConfigId).sort();
7452
- if (authConfigs.length > 0 && !authConfigs.every((config, index) => config === sortedCurrentAuthConfigs[index])) throw new ValidationError("MCP server with this name already exists with different auth configs", { meta: { serverName: name } });
7453
- const tools = mcpServer.tools?.sort();
7454
- const sortedCurrentTools = serverConfig.flatMap((config) => config.allowedTools).sort();
7455
- if (tools?.length > 0 && !tools.every((tool, index) => tool === sortedCurrentTools[index])) throw new ValidationError("MCP server with this name already exists with different tools", { meta: { serverName: name } });
7456
- const toolkits$1 = (await Promise.all(serverConfig.map((config) => this.client.authConfigs.retrieve(config.authConfigId)))).map((config) => config.toolkit.slug);
7457
- const camelCaseResponse$1 = transformMcpCreateResponse({
7458
- id: mcpServer.id,
7459
- name: mcpServer.name,
7460
- auth_config_ids: serverConfig.map((config) => config.authConfigId),
7461
- allowed_tools: serverConfig.flatMap((config) => config.allowedTools),
7462
- managed_auth_via_composio: options.isChatAuth || false,
7463
- commands: mcpServer.commands,
7464
- created_at: mcpServer.createdAt,
7465
- updated_at: mcpServer.updatedAt,
7466
- mcp_url: mcpServer.mcpUrl
7467
- });
7468
- return {
7469
- ...camelCaseResponse$1,
7470
- toolkits: toolkits$1,
7471
- getServer: async (params) => {
7472
- return this.getServer(camelCaseResponse$1.id, params.userId || "", { isChatAuth: options.isChatAuth });
7473
- }
7474
- };
7475
- } catch (error) {
7476
- if (error instanceof ValidationError && !error.message.includes("not found")) throw error;
7477
- }
7478
- const toolkits = (await Promise.all(serverConfig.map((config) => this.client.authConfigs.retrieve(config.authConfigId)))).map((config) => config.toolkit.slug);
7479
- let mcpServerCreatedResponse;
7480
- try {
7481
- mcpServerCreatedResponse = await this.client.mcp.custom.create({
7482
- name,
7483
- toolkits,
7484
- custom_tools: serverConfig.flatMap((config) => config.allowedTools),
7485
- managed_auth_via_composio: options.isChatAuth || false,
7486
- auth_config_ids: serverConfig.map((config) => config.authConfigId)
7487
- });
7488
- } catch (error) {
7489
- throw new ValidationError("Failed to create MCP server", { cause: error });
7490
- }
7491
- const serverResponseResult = ComposioCustomCreateResponseSchema.safeParse(mcpServerCreatedResponse);
7492
- if (serverResponseResult.error) throw new ValidationError("Failed to parse MCP server creation response", { cause: serverResponseResult.error });
7493
- const camelCaseResponse = transformMcpCreateResponse(mcpServerCreatedResponse);
7494
- return {
7495
- ...camelCaseResponse,
7496
- toolkits,
7497
- getServer: async (params) => {
7498
- return this.getServer(camelCaseResponse.id, params.userId || "", { isChatAuth: options.isChatAuth });
7499
- }
7500
- };
7501
- }
7502
- /**
7503
- * Get the connection status of a user for an MCP server
7504
- *
7505
- * Checks whether a user has the necessary connected accounts to use all toolkits
7506
- * configured in the specified MCP server. Returns both overall connection status
7507
- * and individual status for each toolkit.
7508
- *
7509
- * @param {Object} params - Parameters for checking connection status
7510
- * @param {string} params.id - The UUID of the MCP server to check
7511
- * @param {string} params.userId - The ID of the user to check connection status for
7512
- * @returns {Promise<McpUserConnectionStatus>} Complete connection status including:
7513
- * - `type`: Overall status (CONNECTED if all toolkits are connected, DISCONNECTED otherwise)
7514
- * - `connected`: Boolean indicating if user can use the MCP server
7515
- * - `connectedToolkits`: Record mapping each toolkit name to its individual connection status
7516
- *
7517
- * @throws {ValidationError} When MCP server has no toolkits configured
7518
- * @throws {ValidationError} When MCP server retrieval fails
7519
- *
7520
- * @example
7521
- * ```typescript
7522
- * // Check if user can access an MCP server with Gmail and Slack toolkits
7523
- * const connectionStatus = await composio.mcp.getUserConnectionStatus('user123', 'mcp-server-uuid');
7524
- *
7525
- * if (connectionStatus.connected) {
7526
- * console.log('User can access all required toolkits');
7527
- * // connectionStatus.type === ConnectionStatus.CONNECTED
7528
- * } else {
7529
- * console.log('User is missing some toolkit connections');
7530
- * // Check individual toolkit statuses
7531
- * Object.entries(connectionStatus.connectedToolkits).forEach(([toolkit, status]) => {
7532
- * if (!status.connected) {
7533
- * console.log(`Missing connection for toolkit: ${toolkit}`);
7534
- * }
7535
- * });
7536
- * }
7537
- * ```
7538
- *
7539
- * @example
7540
- * ```typescript
7541
- * // Example response when user has Gmail connected but missing Slack
7542
- * {
7543
- * type: ConnectionStatus.DISCONNECTED,
7544
- * connected: false,
7545
- * connectedToolkits: {
7546
- * GMAIL: {
7547
- * type: ConnectionStatus.CONNECTED,
7548
- * connected: true,
7549
- * toolkit: 'GMAIL',
7550
- * connectedAccountId: 'conn_gmail_123'
7551
- * },
7552
- * SLACK: {
7553
- * type: ConnectionStatus.DISCONNECTED,
7554
- * connected: false,
7555
- * toolkit: 'SLACK'
7556
- * }
7557
- * }
7558
- * }
7559
- * ```
7560
- */
7561
- async getUserConnectionStatus(userId, serverId) {
7562
- const serverDetails = await this.get(serverId);
7563
- if (!serverDetails.toolkits || serverDetails.toolkits.length === 0) throw new ValidationError("MCP server has no toolkits configured", { meta: { serverId } });
7564
- const connectedAccounts = await this.client.connectedAccounts.list({
7565
- user_ids: [userId],
7566
- toolkit_slugs: serverDetails.toolkits.map((toolkit) => toolkit.toLowerCase()),
7567
- statuses: ["ACTIVE"]
7568
- });
7569
- const connectedAccountsByToolkit = /* @__PURE__ */ new Map();
7570
- connectedAccounts.items?.forEach((account) => {
7571
- connectedAccountsByToolkit.set(account.toolkit.slug.toLowerCase(), account.id);
7572
- });
7573
- const connectedToolkits = {};
7574
- let allToolkitsConnected = true;
7575
- for (const toolkit of serverDetails.toolkits) {
7576
- const connectedAccountId = connectedAccountsByToolkit.get(toolkit.toLowerCase());
7577
- if (connectedAccountId) connectedToolkits[toolkit] = {
7578
- type: ConnectionStatus.CONNECTED,
7579
- connected: true,
7580
- toolkit,
7581
- connectedAccountId
7582
- };
7583
- else {
7584
- connectedToolkits[toolkit] = {
7585
- type: ConnectionStatus.DISCONNECTED,
7586
- connected: false,
7587
- toolkit
7588
- };
7589
- allToolkitsConnected = false;
7590
- }
7591
- }
7592
- if (allToolkitsConnected) return {
7593
- type: ConnectionStatus.CONNECTED,
7594
- connected: true,
7595
- connectedToolkits
7596
- };
7597
- else return {
7598
- type: ConnectionStatus.DISCONNECTED,
7599
- connected: false,
7600
- connectedToolkits
7601
- };
7602
- }
7603
- /**
7604
- * Get the connection parameters for a toolkit
7605
- * @param {string} serverId - The UUID of the MCP server
7606
- * @param {string} toolkit - The toolkit to get connection parameters for
7607
- * @returns {Promise<ToolkitAuthFieldsResponse>} Connection parameters for the toolkit
7608
- */
7609
- async getConnectionParams(serverId, toolkit) {
7610
- const mcpServerDetails = await this.get(serverId);
7611
- const authConfig = (mcpServerDetails.authConfigIds ? await Promise.all(mcpServerDetails.authConfigIds.map((id) => this.client.authConfigs.retrieve(id))) : []).find((config) => config.toolkit.slug === toolkit);
7612
- if (!authConfig) throw new ValidationError("Auth config not found", { meta: {
7613
- serverId,
7614
- toolkit
7615
- } });
7616
- return await this.toolkits.getConnectedAccountInitiationFields(toolkit, authConfig.auth_scheme);
7617
- }
7618
- /**
7619
- * Authorize a user for a toolkit
7620
- * @param {string} serverId - The UUID of the MCP server
7621
- * @param {string} userId - The ID of the user to authorize
7622
- * @param {string} toolkit - The toolkit to authorize
7623
- * @returns {Promise<ConnectionRequest>} Connection request for the toolkit
7624
- */
7625
- async authorize(userId, serverId, toolkit) {
7626
- const authConfigId = (await this.get(serverId)).authConfigIds?.[0];
7627
- return this.toolkits.authorize(userId, toolkit, authConfigId);
7628
- }
7629
- /**
7630
- * Get server URLs for an existing MCP server
7631
- * @param {string} serverId - Server UUID
7632
- * @param {string} userId - User ID to get server URLs for
7633
- * @param {Object} [options] - Additional options for server configuration
7634
- * @param {string[]} [options.limitTools] - Subset of tools to limit (from MCP config)
7635
- * @param {boolean} [options.isChatAuth] - Whether to use chat-based authentication
7636
- * @returns {Promise<TMcpResponse>} Transformed server URLs in provider-specific format
7637
- *
7638
- * @example
7639
- * ```typescript
7640
- * // Get URLs for an existing server with basic user ID
7641
- * const urls = await composio.mcp.getServer("mcp_xyz", "hey@example.com");
7642
- *
7643
- * // Get URLs with additional options
7644
- * const urls = await composio.mcp.getServer("mcp_xyz", "hey@example.com", {
7645
- * limitTools: ["GMAIL_FETCH_EMAILS", "SLACK_SEND_MESSAGE"],
7646
- * isChatAuth: true
7647
- * });
7648
- * ```
7649
- *
7650
- */
7651
- async getServer(serverId, userId, options) {
7652
- const serverDetails = await this.get(serverId);
7653
- if (!userId) throw new ValidationError("User ID is required", {});
7654
- const toolkits = serverDetails.toolkits || [];
7655
- const connectedAccountIds = (await Promise.all(toolkits.map((toolkit) => this.client.connectedAccounts.list({
7656
- user_ids: [userId],
7657
- toolkit_slugs: [toolkit],
7658
- statuses: ["ACTIVE"]
7659
- }).then((res) => res.items?.[0]?.id)))).filter(Boolean);
7660
- let data;
7661
- try {
7662
- data = await this.client.mcp.generate.url({
7663
- user_ids: [userId],
7664
- connected_account_ids: [],
7665
- mcp_server_id: serverId,
7666
- managed_auth_by_composio: options?.isChatAuth ?? serverDetails.managedAuthViaComposio ?? false
7667
- });
7668
- } catch (error) {
7669
- throw new ValidationError("Failed to generate MCP server URL", { cause: error });
7670
- }
7671
- const urlResponseResult = ComposioGenerateURLResponseSchema.safeParse(data);
7672
- if (urlResponseResult.error) throw new ValidationError("Failed to parse MCP URL generation response", { cause: urlResponseResult.error });
7673
- const camelCaseData = transformMcpGenerateUrlResponse(data);
7674
- return this.wrapMcpServerResponse(camelCaseData, serverDetails.name, connectedAccountIds, [userId], toolkits);
7675
- }
7676
- /**
7677
- * List MCP server configurations with filtering options
7678
- * @param {Object} options - Filtering and pagination options
7679
- * @param {number} [options.page] - Page number for pagination
7680
- * @param {number} [options.limit] - Number of items per page
7681
- * @param {string[]} [options.toolkits] - Filter servers by toolkit names
7682
- * @param {string[]} [options.authConfigs] - Filter servers by auth config IDs
7683
- * @param {string} [options.name] - Filter servers by name
7684
- * @param {string} [options.user] - Filter servers by user ID
7685
- * @returns {Promise<McpListResponse>} List of MCP servers matching the filters
7686
- *
7687
- * @example
7688
- * ```typescript
7689
- * // List all servers with pagination
7690
- * const servers = await composio.mcp.list({
7691
- * page: 1,
7692
- * limit: 10
7693
- * });
7694
- *
7695
- * // List Gmail and Supabase servers
7696
- * const filteredServers = await composio.mcp.list({
7697
- * toolkits: ['GMAIL', 'SUPABASE'],
7698
- * authConfigIds: ['auth_123', 'auth_456']
7699
- * });
7700
- * ```
7701
- */
7702
- async list(options) {
7703
- let listResponse;
7704
- try {
7705
- listResponse = await this.client.mcp.list({
7706
- page_no: options.page || 1,
7707
- limit: options.limit || 10,
7708
- toolkits: options?.toolkits?.join(",") || void 0,
7709
- auth_config_ids: options?.authConfigs?.join(",") || void 0,
7710
- name: options?.name
7711
- });
7712
- } catch (error) {
7713
- throw new ValidationError("Failed to list MCP servers", { cause: error });
7714
- }
7715
- const listResponseResult = ComposioMcpListResponseSchema.safeParse(listResponse);
7716
- if (listResponseResult.error) throw new ValidationError("Failed to parse MCP server list response", { cause: listResponseResult.error });
7717
- return transformMcpListResponse(listResponse);
7718
- }
7719
- /**
7720
- * Get details of a specific MCP server
7721
- * @param {string} serverId - Server UUID
7722
- * @returns {Promise<McpRetrieveResponse>} Server details
7723
- *
7724
- * @example
7725
- * ```typescript
7726
- * const serverDetails = await composio.mcp.get('server-uuid');
7727
- * ```
7728
- */
7729
- async get(serverId) {
7730
- let retrieveResponse;
7731
- try {
7732
- retrieveResponse = await this.client.mcp.retrieve(serverId);
7733
- } catch (error) {
7734
- throw new ValidationError("Failed to retrieve MCP server", { cause: error });
7735
- }
7736
- const retrieveResponseResult = McpRetrieveResponseSchema.safeParse({
7737
- ...retrieveResponse,
7738
- mcpUrl: retrieveResponse.mcp_url
7739
- });
7740
- if (retrieveResponseResult.error) throw new ValidationError("Failed to parse MCP server retrieve response", { cause: retrieveResponseResult.error });
7741
- return transformMcpRetrieveResponse(retrieveResponse);
7742
- }
7743
- /**
7744
- * Delete an MCP server
7745
- * @param {string} serverId - Server UUID
7746
- * @returns {Promise<McpDeleteResponse>} Deletion response
7747
- *
7748
- * @example
7749
- * ```typescript
7750
- * const result = await composio.mcp.delete('server-uuid');
7751
- * ```
7752
- */
7753
- async delete(serverId) {
7754
- let deleteResponse;
7755
- try {
7756
- deleteResponse = await this.client.mcp.delete(serverId);
7757
- } catch (error) {
7758
- throw new ValidationError("Failed to delete MCP server", { cause: error });
7759
- }
7760
- const deleteResponseResult = ComposioMcpDeleteResponseSchema.safeParse(deleteResponse);
7761
- if (deleteResponseResult.error) throw new ValidationError("Failed to parse MCP server delete response", { cause: deleteResponseResult.error });
7762
- return transformMcpDeleteResponse(deleteResponse);
7763
- }
7764
- /**
7765
- * Update an MCP server configuration
7766
- * @param {string} id - Server UUID
7767
- * @param {string} name - New unique name for the server
7768
- * @param {MCPToolkitConfig[]} toolkitConfigs - Array of toolkit configurations
7769
- * @param {MCPAuthOptions} [authOptions] - Updated authentication options
7770
- * @returns {Promise<McpUpdateResponse>} Updated server details
7771
- *
7772
- * @example
7773
- * ```typescript
7774
- * const updatedServer = await composio.mcp.update(
7775
- * "server-uuid",
7776
- * "my-updated-server",
7777
- * [
7778
- * {
7779
- * toolkit: "GMAIL",
7780
- * authConfigId: "ac_sdhkjfhjksdk",
7781
- * allowedTools: ["GMAIL_FETCH_EMAILS"],
7782
- * },
7783
- * ],
7784
- * {
7785
- * isChatAuth: true,
7786
- * }
7787
- * );
7788
- * ```
7789
- */
7790
- async update(serverId, name, toolkitConfigs, authOptions) {
7791
- this.validateInputs(toolkitConfigs, authOptions);
7792
- const toolkits = toolkitConfigs.map((config) => config.toolkit);
7793
- let updateResponse;
7794
- try {
7795
- updateResponse = await this.client.mcp.update(serverId, {
7796
- name,
7797
- toolkits,
7798
- allowed_tools: toolkitConfigs.flatMap((config) => config.allowedTools),
7799
- managed_auth_via_composio: authOptions?.isChatAuth || false
7800
- });
7801
- } catch (error) {
7802
- throw new ValidationError("Failed to update MCP server", { cause: error });
7803
- }
7804
- const updateResponseResult = ComposioMcpUpdateResponseSchema.safeParse(updateResponse);
7805
- if (updateResponseResult.error) throw new ValidationError("Failed to parse MCP server update response", { cause: updateResponseResult.error });
7806
- return transformMcpUpdateResponse(updateResponse);
7807
- }
7808
- /**
7809
- * Generate URL for an MCP server
7810
- * @param {string} serverId - Server UUID
7811
- * @param {GenerateURLParams} params - Parameters for URL generation
7812
- * @returns {Promise<GenerateURLResponse>} Generated URL response
7813
- *
7814
- * @example
7815
- * ```typescript
7816
- * const urlResponse = await composio.mcp.generateUrl('server-uuid', {
7817
- * userIds: ['user123'],
7818
- * connectedAccountIds: ['account456'],
7819
- * isChatAuth: true
7820
- * });
7821
- * ```
7822
- */
7823
- async generateUrl(serverId, params) {
7824
- const paramsResult = GenerateURLParamsSchema.safeParse(params);
7825
- if (paramsResult.error) throw new ValidationError("Failed to parse generateUrl parameters", { cause: paramsResult.error });
7826
- let urlResponse;
7827
- try {
7828
- urlResponse = await this.client.mcp.generate.url({
7829
- mcp_server_id: serverId,
7830
- user_ids: params.userIds,
7831
- connected_account_ids: params.connectedAccountIds,
7832
- managed_auth_by_composio: params.composioManagedAuth
7833
- });
7834
- } catch (error) {
7835
- throw new ValidationError("Failed to generate MCP URL", { cause: error });
7836
- }
7837
- const responseResult = ComposioGenerateURLResponseSchema.safeParse(urlResponse);
7838
- if (responseResult.error) throw new ValidationError("Failed to parse MCP URL generation response", { cause: responseResult.error });
7839
- return transformMcpGenerateUrlResponse(urlResponse);
7840
- }
7841
- /**
7842
- * Transform MCP URL response into the appropriate format.
7843
- * If the provider has a custom transform method, use it.
7844
- * Otherwise, use the default transformation.
7845
- *
7846
- * @param data - The MCP URL response data (in camelCase)
7847
- * @param serverName - Name of the MCP server
7848
-
7849
- * @returns Transformed response in appropriate format
7850
- * @deprecated
7851
- */
7852
- wrapMcpServerResponse(data, serverName, connectedAccountIds, userIds, toolkits) {
7853
- if (this.provider && typeof this.provider.wrapMcpServerResponse === "function") {
7854
- let snakeCaseData;
7855
- if (data.connectedAccountUrls?.length) snakeCaseData = data.connectedAccountUrls.map((url, index) => ({
7856
- name: serverName + "-" + connectedAccountIds?.[index],
7857
- url
7858
- }));
7859
- else if (data.userIdsUrl?.length) snakeCaseData = data.userIdsUrl.map((url, index) => ({
7860
- name: serverName + "-" + userIds?.[index],
7861
- url
7862
- }));
7863
- else snakeCaseData = [{
7864
- name: serverName,
7865
- url: data.mcpUrl
7866
- }];
7867
- return this.provider.wrapMcpServerResponse(snakeCaseData);
7868
- }
7869
- if (connectedAccountIds?.length && data.connectedAccountUrls) return data.connectedAccountUrls.map((url, index) => ({
7870
- url: new URL(url),
7871
- name: `${serverName}-${connectedAccountIds[index]}`,
7872
- toolkit: toolkits?.[index]
7873
- }));
7874
- else if (userIds?.length && data.userIdsUrl) return data.userIdsUrl.map((url, index) => ({
7875
- url: new URL(url),
7876
- name: `${serverName}-${userIds[index]}`,
7877
- toolkit: toolkits?.[index]
7878
- }));
7879
- return {
7880
- url: new URL(data.mcpUrl),
7881
- name: serverName
7882
- };
7883
- }
7884
- /**
7885
- * Get details of a specific MCP server by name
7886
- * @param {string} name - Server name
7887
- * @returns {Promise<McpRetrieveResponse>} Server details
7888
- * @throws {ValidationError} If no server found with the given name
7889
- * @throws {ValidationError} If multiple servers found with the same name
7890
- *
7891
- * @example
7892
- * ```typescript
7893
- * const serverDetails = await composio.mcp.getByName('my-gmail-server');
7894
- * ```
7895
- */
7896
- async getByName(serverName) {
7897
- if (!serverName) throw new ValidationError("Server name is required", {});
7898
- let listResponse;
7899
- try {
7900
- listResponse = await this.client.mcp.list({
7901
- name: serverName,
7902
- limit: 10
7903
- });
7904
- } catch (error) {
7905
- logger_default.error(error);
7906
- throw new ValidationError("Failed to search MCP servers by name", { cause: error });
7907
- }
7908
- const listResponseResult = ComposioMcpListResponseSchema.safeParse(listResponse);
7909
- if (listResponseResult.error) throw new ValidationError("Failed to parse MCP server list response", { cause: listResponseResult.error });
7910
- const servers = listResponse.items || [];
7911
- if (servers.length === 0) throw new ValidationError(`MCP server with name '${serverName}' not found`, { meta: { serverName } });
7912
- return this.get(servers[0].id);
7913
- }
7914
- };
7915
-
7916
7332
  //#endregion
7917
7333
  export { AuthConfigCreationToolAccessConfigSchema, AuthConfigErrorCodes, AuthConfigListParamsSchema, AuthConfigListResponseSchema, AuthConfigRetrieveResponseSchema, AuthConfigToolAccessConfigSchema, AuthConfigTypes, AuthConfigUpdateParamsSchema, AuthCustomConfigUpdateParamsSchema, AuthDefaultConfigUpdateParamsSchema, AuthScheme, AuthSchemeEnum, AuthSchemeTypes, BaseAgenticProvider, BaseNonAgenticProvider, BillcomAuthConnectionDataSchema, Composio, ComposioAuthConfigNotFoundError, ComposioConnectedAccountNotFoundError, ComposioCustomCreateResponseSchema, ComposioCustomToolsNotInitializedError, ComposioError, ComposioFailedToCreateConnectedAccountLink, ComposioFailedToCreatePusherClientError, ComposioFailedToGetSDKRealtimeCredentialsError, ComposioFailedToSubscribeToPusherChannelError, ComposioFailedToUnsubscribeFromPusherChannelError, ComposioGenerateURLParamsSchema, ComposioGenerateURLResponseSchema, ComposioGlobalExecuteToolFnNotSetError, ComposioInvalidExecuteFunctionError, ComposioInvalidModifierError, ComposioMcpDeleteResponseSchema, ComposioMcpListResponseSchema, ComposioMcpRetrieveResponseSchema, ComposioMcpUpdateResponseSchema, ComposioMultipleConnectedAccountsError, ComposioNoAPIKeyError, ComposioProvider, ComposioProviderNotDefinedError, ComposioToolExecutionError, ComposioToolNotFoundError, ComposioToolVersionRequiredError, ComposioToolkitFetchError, ComposioToolkitNotFoundError, ComposioTriggerTypeNotFoundError, ComposioWebhookPayloadError, ComposioWebhookSignatureVerificationError, ConnectedAccountAuthConfigSchema, ConnectedAccountErrorCodes, ConnectedAccountListParamsSchema, ConnectedAccountListResponseSchema, ConnectedAccountRetrieveResponseSchema, ConnectedAccountStatusSchema, ConnectedAccountStatuses, ConnectionDataSchema, ConnectionRequestErrorCodes, ConnectionRequestFailedError, ConnectionRequestTimeoutError, ConnectionStatus, ConnectionStatuses, CreateAuthConfigParamsSchema, CreateAuthConfigResponseSchema, CreateComposioManagedAuthConfigParamsSchema, CreateConnectedAccountLinkOptionsSchema, CreateConnectedAccountLinkResponseSchema, CreateConnectedAccountOptionsSchema, CreateConnectedAccountParamsSchema, CreateConnectedAccountResponseSchema, CreateCustomAuthConfigParamsSchema, CustomAuthParamsSchema, CustomConnectionDataSchema, CustomCreateResponseSchema, CustomOauth1ConnectionDataSchema, CustomOauth2ConnectionDataSchema, DefaultCreateConnectedAccountParamsSchema, GenerateURLParamsSchema, GenerateURLResponseSchema, IncomingTriggerPayloadSchema, JSONSchemaPropertySchema, JsonSchemaToZodError, MCP, MCPAuthOptionsSchema, MCPGenerateURLParamsSchema, MCPGetServerParamsSchema, MCPMultiAppServerSchema, MCPServerCreateResponseSchema, MCPServerListResponseSchema, MCPServerSchema, MCPServerTypeSchema, MCPServerUpdateParamsSchema, MCPSingleAppServerSchema, MCPToolkitConfigSchema, MCPToolkitConfigsArraySchema, McpDeleteResponseSchema, McpListResponseSchema, McpRetrieveResponseSchema, McpUpdateResponseSchema, Oauth1ActiveConnectionDataSchema, Oauth1ConnectionDataSchema, Oauth1ExpiredConnectionDataSchema, Oauth1FailedConnectionDataSchema, Oauth1InactiveConnectionDataSchema, Oauth1InitiatedConnectionDataSchema, Oauth1InitiatingConnectionDataSchema, Oauth2ActiveConnectionDataSchema, Oauth2ConnectionDataSchema, Oauth2ExpiredConnectionDataSchema, Oauth2FailedConnectionDataSchema, Oauth2InactiveConnectionDataSchema, Oauth2InitiatedConnectionDataSchema, Oauth2InitiatingConnectionDataSchema, OpenAIProvider, RedirectableAuthSchemeSchema, SDKErrorCodes, ToolErrorCodes, ToolExecuteMetaParamsSchema, ToolExecuteParamsSchema, ToolExecuteResponseSchema, ToolKitItemSchema, ToolKitListResponseSchema, ToolKitMetaSchema, ToolListParamsSchema, ToolListResponseSchema, ToolProxyParamsSchema, ToolRouterConfigManageConnectionsSchema, ToolRouterConfigTagsSchema, ToolRouterConfigToolsSchema, ToolRouterCreateSessionConfigSchema, ToolRouterMCPServerConfigSchema, ToolRouterManageConnectionsConfigSchema, ToolRouterTagsEnableDisableSchema, ToolRouterTagsParamSchema, ToolRouterToolkitsDisabledConfigSchema, ToolRouterToolkitsEnabledConfigSchema, ToolRouterToolkitsOptionsSchema, ToolRouterToolkitsParamSchema, ToolRouterToolsParamSchema, ToolSchema, ToolkitAuthConfigDetailsSchema, ToolkitAuthFieldSchema, ToolkitAuthFieldsResponseSchema, ToolkitCategorySchema, ToolkitConnectionStateSchema, ToolkitConnectionsDetailsSchema, ToolkitErrorCodes, ToolkitLatestVersionSchema, ToolkitMangedByEnumSchema, ToolkitRetrieveCategoriesResponseSchema, ToolkitRetrieveResponseSchema, ToolkitSchema, ToolkitSortByEnumSchema, ToolkitVersionParamSchema, ToolkitVersionSchema, ToolkitVersionsSchema, ToolkitsListParamsSchema, TriggerErrorCodes, TriggerInstanceListActiveParamsSchema, TriggerInstanceListActiveResponseItemSchema, TriggerInstanceListActiveResponseSchema, TriggerInstanceManageDeleteResponseSchema, TriggerInstanceManageUpdateParamsSchema, TriggerInstanceManageUpdateResponseSchema, TriggerInstanceUpsertParamsSchema, TriggerInstanceUpsertResponseSchema, TriggerStatusEnum, TriggerStatuses, TriggerSubscribeParamSchema, TriggerTypeSchema, TriggersTypeListParamsSchema, TriggersTypeListResponseSchema, ValidationError, ValidationErrorCodes, VerifyWebhookParamsSchema, constants_exports as constants, createConnectionRequest, handleToolExecutionError, jsonSchemaToZodSchema, logger_default as logger, removeNonRequiredProperties };