import { APIResource } from "../../../core/resource.js"; import * as FilesAPI from "./files.js"; import { FileCreateDownloadURLParams, FileCreateDownloadURLResponse, FileCreateUploadURLParams, FileCreateUploadURLResponse, FileDeleteParams, FileDeleteResponse, FileListParams, FileListResponse, Files } from "./files.js"; import { APIPromise } from "../../../core/api-promise.js"; import { RequestOptions } from "../../../internal/request-options.js"; /** * (Labs) Tool router endpoints */ export declare class Session extends APIResource { files: FilesAPI.Files; /** * Creates a new session for the tool router feature. This endpoint initializes a * new session with specified toolkits and their authentication configurations. The * session provides an isolated environment for testing and managing tool routing * logic with scoped MCP server access. * * @example * ```ts * const session = await client.toolRouter.session.create({ * user_id: 'user_123456789', * }); * ``` */ create(body: SessionCreateParams, options?: RequestOptions): APIPromise; /** * Retrieves an existing tool router session by its ID. Returns the session * configuration, MCP server URL, and available tools. * * @example * ```ts * const session = await client.toolRouter.session.retrieve( * 'trs_1a2b3c4d5e6f', * ); * ``` */ retrieve(sessionID: string, options?: RequestOptions): APIPromise; /** * Fetch an existing tool router session by ID. * * @example * ```ts * const response = await client.toolRouter.session.attach( * 'trs_1a2b3c4d5e6f', * ); * ``` */ attach(sessionID: string, body?: SessionAttachParams | null | undefined, options?: RequestOptions): APIPromise; /** * Returns the session config history ordered by version DESC (newest first). The * live (current) config appears once, on the first page only, with * `is_current: true`; archived versions have `is_current: false`. * * @example * ```ts * const response = * await client.toolRouter.session.configHistory( * 'trs_1a2b3c4d5e6f', * ); * ``` */ configHistory(sessionID: string, query?: SessionConfigHistoryParams | null | undefined, options?: RequestOptions): APIPromise; /** * Execute a tool (meta or app) within an existing tool router session. * * @example * ```ts * const response = await client.toolRouter.session.execute( * 'trs_LX9uJKBinWWr', * { tool_slug: 'GITHUB_CREATE_AN_ISSUE' }, * ); * ``` */ execute(sessionID: string, body: SessionExecuteParams, options?: RequestOptions): APIPromise; /** * Execute a Composio meta tool (COMPOSIO\_\*) within an existing tool router * session. * * @example * ```ts * const response = * await client.toolRouter.session.executeMeta( * 'trs_LX9uJKBinWWr', * { slug: 'COMPOSIO_MANAGE_CONNECTIONS' }, * ); * ``` */ executeMeta(sessionID: string, body: SessionExecuteMetaParams, options?: RequestOptions): APIPromise; /** * Initiates an authentication link session for a specific toolkit within a tool * router session. Returns a link token and redirect URL that users can use to * complete the OAuth flow. * * @example * ```ts * const response = await client.toolRouter.session.link( * 'trs_LX9uJKBinWWr', * { toolkit: 'github' }, * ); * ``` */ link(sessionID: string, body: SessionLinkParams, options?: RequestOptions): APIPromise; /** * Partially updates the configuration of an existing tool router session. Only the * fields provided in the request body will be updated. Uses optimistic concurrency * control to prevent lost updates. The previous config is stored in config * history. * * @example * ```ts * const response = await client.toolRouter.session.patch( * 'trs_1a2b3c4d5e6f', * ); * ``` */ patch(sessionID: string, body?: SessionPatchParams | null | undefined, options?: RequestOptions): APIPromise; /** * Execute any native API call on a toolkit with authentication automatically * injected from Composio. This endpoint proxies HTTP requests to third-party APIs * using connected account credentials resolved from the session context. Provide * the toolkit slug, API endpoint, and HTTP method — Composio handles * authentication injection, abstracting away credential management. Supports all * HTTP methods, custom headers/query parameters, and binary request/response * bodies. * * @example * ```ts * const response = * await client.toolRouter.session.proxyExecute( * 'trs_LX9uJKBinWWr', * { * endpoint: '/api/v1/resources', * method: 'GET', * toolkit_slug: 'gmail', * }, * ); * ``` */ proxyExecute(sessionID: string, body: SessionProxyExecuteParams, options?: RequestOptions): APIPromise; /** * Search for tools matching a use case query within an existing tool router * session. * * @example * ```ts * const response = await client.toolRouter.session.search( * 'trs_LX9uJKBinWWr', * { * queries: [ * { use_case: 'Send a slack message to a channel' }, * ], * }, * ); * ``` */ search(sessionID: string, body: SessionSearchParams, options?: RequestOptions): APIPromise; /** * Retrieves a cursor-paginated list of toolkits available in the tool router * session. Includes toolkit metadata, composio-managed auth schemes, and connected * accounts if available. Optionally filter by specific toolkit slugs. * * @example * ```ts * const response = await client.toolRouter.session.toolkits( * 'trs_1a2b3c4d5e6f', * ); * ``` */ toolkits(sessionID: string, query?: SessionToolkitsParams | null | undefined, options?: RequestOptions): APIPromise; /** * Returns tools available in a tool router session with complete schemas. Results * are paginated; use `next_cursor` to fetch the next page. * * @example * ```ts * const response = await client.toolRouter.session.tools( * 'session_id', * ); * ``` */ tools(sessionID: string, query?: SessionToolsParams | null | undefined, options?: RequestOptions): APIPromise; } export interface SessionCreateResponse { /** * The configuration used to create this session */ config: SessionCreateResponse.Config; /** * Monotonic version of the config. Incremented on each PATCH. Use for optimistic * concurrency control. */ config_version: number; mcp: SessionCreateResponse.Mcp; /** * The identifier of the session */ session_id: string; /** * List of available tools in this session */ tool_router_tools: Array; /** * Experimental features including the generated system prompt. Only returned on * session creation, not on GET. */ experimental?: SessionCreateResponse.Experimental; /** * Advisory list — the session exists and is usable, but the listed issues may * warrant attention. */ warnings?: Array; } export declare namespace SessionCreateResponse { /** * The configuration used to create this session */ interface Config { /** * Execute helper configuration */ execute: Config.Execute; /** * Preload configuration. Explicit slugs are returned as an array; dynamic preload * is returned as "all". */ preload: Config.Preload; /** * Search helper configuration */ search: Config.Search; /** * User identifier for this session */ user_id: string; /** * Auth config overrides per toolkit */ auth_configs?: { [key: string]: string; }; /** * Per-toolkit connected account overrides (array of nano-IDs). Multi-account * sessions can pin more than one account per toolkit; otherwise length is 1. */ connected_accounts?: { [key: string]: Array; }; /** * Manage connections configuration */ manage_connections?: Config.ManageConnections; /** * Multi-account configuration for this session. */ multi_account?: Config.MultiAccount; /** * MCP tool annotation hints for filtering tools with enabled/disabled support. * enabled: tags that the tool must have at least one of. disabled: tags that the * tool must NOT have any of. Both conditions must be satisfied. */ tags?: Config.Tags; /** * Toolkit configuration - either enabled list or disabled list */ toolkits?: Config.Enabled | Config.Disabled; /** * Tool-level configuration per toolkit */ tools?: { [key: string]: Config.Enabled | Config.Disabled | Config.Tags; }; /** * Workbench configuration */ workbench?: Config.Workbench; } namespace Config { /** * Execute helper configuration */ interface Execute { enable_multi_execute?: boolean; } /** * Preload configuration. Explicit slugs are returned as an array; dynamic preload * is returned as "all". */ interface Preload { /** * Explicit preloaded tool slugs, or "all" when the session dynamically exposes all * app tools allowed by its filters. */ tools: Array | 'all'; } /** * Search helper configuration */ interface Search { enable?: boolean; } /** * Manage connections configuration */ interface ManageConnections { /** * Custom callback URL for connected account auth flows */ callback_url?: string; /** * Enable the "remove" action in COMPOSIO_MANAGE_CONNECTIONS. Default true. */ enable_connection_removal?: boolean; /** * Enable the COMPOSIO_WAIT_FOR_CONNECTIONS tool for polling connection status. * Default false. May not work reliably with GPT models. */ enable_wait_for_connections?: boolean; /** * Whether to enable the connection manager for automatic connection handling */ enabled?: boolean; } /** * Multi-account configuration for this session. */ interface MultiAccount { /** * When true, enables multi-account mode for this session. When not set, falls back * to org/project-level configuration. */ enable?: boolean; /** * Maximum number of connected accounts allowed per toolkit. Defaults to 5 when * multi-account is enabled. */ max_accounts_per_toolkit?: number; /** * When true, require explicit account selection when multiple accounts are * connected. When false (default), use the first/default account. */ require_explicit_selection?: boolean; } /** * MCP tool annotation hints for filtering tools with enabled/disabled support. * enabled: tags that the tool must have at least one of. disabled: tags that the * tool must NOT have any of. Both conditions must be satisfied. */ interface Tags { /** * Tags that the tool must NOT have any of */ disabled?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>; /** * Tags that the tool must have at least one of */ enabled?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>; } interface Enabled { enabled: Array; } interface Disabled { disabled: Array; } interface Enabled { enabled: Array; } interface Disabled { disabled: Array; } interface Tags { tags: Tags.Tags; } namespace Tags { interface Tags { /** * Tags that the tool must NOT have any of */ disabled?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>; /** * Tags that the tool must have at least one of */ enabled?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>; } } /** * Workbench configuration */ interface Workbench { /** * Character threshold after which tool execution response are saved to a file in * workbench. Default is 20k. */ auto_offload_threshold?: number; /** * Whether the workbench (code execution sandbox) is enabled. When false, * COMPOSIO_REMOTE_WORKBENCH and COMPOSIO_REMOTE_BASH_TOOL are not exposed. */ enable?: boolean; /** * Whether proxy execution is enabled in the workbench */ proxy_execution_enabled?: boolean; /** * Sandbox compute tier: standard (1 vCPU / 1 GB), medium (2 vCPU / 2 GB), large (4 * vCPU / 4 GB), xlarge (8 vCPU / 8 GB). Defaults to standard. */ sandbox_size?: 'standard' | 'medium' | 'large' | 'xlarge'; } } interface Mcp { /** * The type of the MCP server. Can be http */ type: 'http'; /** * The URL of the MCP server */ url: string; } /** * Experimental features including the generated system prompt. Only returned on * session creation, not on GET. */ interface Experimental { /** * The assistive system prompt for the tool router session */ assistive_prompt?: string; /** * User-defined custom toolkits with grouped tools (no-auth) */ custom_toolkits?: Array; /** * Custom tools — standalone or extending Composio toolkits */ custom_tools?: Array; } namespace Experimental { interface CustomToolkit { description: string; name: string; slug: string; tools: Array; } namespace CustomToolkit { interface Tool { description: string; input_schema: { [key: string]: unknown; }; name: string; /** * Original tool slug as provided by the user */ original_slug: string; /** * Prefixed tool slug (e.g. LOCAL_CRM_FIND_CUSTOMER) */ slug: string; output_schema?: { [key: string]: unknown; }; } } interface CustomTool { description: string; input_schema: { [key: string]: unknown; }; name: string; /** * Original tool slug as provided by the user */ original_slug: string; /** * Prefixed tool slug (e.g. LOCAL_GMAIL_GET_IMPORTANT_EMAILS) */ slug: string; extends_toolkit?: string; output_schema?: { [key: string]: unknown; }; } } interface Warning { /** * Stable machine code identifying the advisory. Safe to switch on in client code. */ code: 'PRELOAD_TOOLS_HIGH_CONTEXT_USAGE'; /** * Human-readable description of the advisory. Suitable for logging or surfacing to * end users. */ message: string; } } export interface SessionRetrieveResponse { /** * The configuration used to create this session */ config: SessionRetrieveResponse.Config; /** * Monotonic version of the config. Incremented on each PATCH. Use for optimistic * concurrency control. */ config_version: number; mcp: SessionRetrieveResponse.Mcp; /** * The identifier of the session */ session_id: string; /** * List of available tools in this session */ tool_router_tools: Array; /** * Experimental features */ experimental?: SessionRetrieveResponse.Experimental; /** * Advisory list — the session exists and is usable, but the listed issues may * warrant attention. */ warnings?: Array; } export declare namespace SessionRetrieveResponse { /** * The configuration used to create this session */ interface Config { /** * Execute helper configuration */ execute: Config.Execute; /** * Preload configuration. Explicit slugs are returned as an array; dynamic preload * is returned as "all". */ preload: Config.Preload; /** * Search helper configuration */ search: Config.Search; /** * User identifier for this session */ user_id: string; /** * Auth config overrides per toolkit */ auth_configs?: { [key: string]: string; }; /** * Per-toolkit connected account overrides (array of nano-IDs). Multi-account * sessions can pin more than one account per toolkit; otherwise length is 1. */ connected_accounts?: { [key: string]: Array; }; /** * Manage connections configuration */ manage_connections?: Config.ManageConnections; /** * Multi-account configuration for this session. */ multi_account?: Config.MultiAccount; /** * MCP tool annotation hints for filtering tools with enabled/disabled support. * enabled: tags that the tool must have at least one of. disabled: tags that the * tool must NOT have any of. Both conditions must be satisfied. */ tags?: Config.Tags; /** * Toolkit configuration - either enabled list or disabled list */ toolkits?: Config.Enabled | Config.Disabled; /** * Tool-level configuration per toolkit */ tools?: { [key: string]: Config.Enabled | Config.Disabled | Config.Tags; }; /** * Workbench configuration */ workbench?: Config.Workbench; } namespace Config { /** * Execute helper configuration */ interface Execute { enable_multi_execute?: boolean; } /** * Preload configuration. Explicit slugs are returned as an array; dynamic preload * is returned as "all". */ interface Preload { /** * Explicit preloaded tool slugs, or "all" when the session dynamically exposes all * app tools allowed by its filters. */ tools: Array | 'all'; } /** * Search helper configuration */ interface Search { enable?: boolean; } /** * Manage connections configuration */ interface ManageConnections { /** * Custom callback URL for connected account auth flows */ callback_url?: string; /** * Enable the "remove" action in COMPOSIO_MANAGE_CONNECTIONS. Default true. */ enable_connection_removal?: boolean; /** * Enable the COMPOSIO_WAIT_FOR_CONNECTIONS tool for polling connection status. * Default false. May not work reliably with GPT models. */ enable_wait_for_connections?: boolean; /** * Whether to enable the connection manager for automatic connection handling */ enabled?: boolean; } /** * Multi-account configuration for this session. */ interface MultiAccount { /** * When true, enables multi-account mode for this session. When not set, falls back * to org/project-level configuration. */ enable?: boolean; /** * Maximum number of connected accounts allowed per toolkit. Defaults to 5 when * multi-account is enabled. */ max_accounts_per_toolkit?: number; /** * When true, require explicit account selection when multiple accounts are * connected. When false (default), use the first/default account. */ require_explicit_selection?: boolean; } /** * MCP tool annotation hints for filtering tools with enabled/disabled support. * enabled: tags that the tool must have at least one of. disabled: tags that the * tool must NOT have any of. Both conditions must be satisfied. */ interface Tags { /** * Tags that the tool must NOT have any of */ disabled?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>; /** * Tags that the tool must have at least one of */ enabled?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>; } interface Enabled { enabled: Array; } interface Disabled { disabled: Array; } interface Enabled { enabled: Array; } interface Disabled { disabled: Array; } interface Tags { tags: Tags.Tags; } namespace Tags { interface Tags { /** * Tags that the tool must NOT have any of */ disabled?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>; /** * Tags that the tool must have at least one of */ enabled?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>; } } /** * Workbench configuration */ interface Workbench { /** * Character threshold after which tool execution response are saved to a file in * workbench. Default is 20k. */ auto_offload_threshold?: number; /** * Whether the workbench (code execution sandbox) is enabled. When false, * COMPOSIO_REMOTE_WORKBENCH and COMPOSIO_REMOTE_BASH_TOOL are not exposed. */ enable?: boolean; /** * Whether proxy execution is enabled in the workbench */ proxy_execution_enabled?: boolean; /** * Sandbox compute tier: standard (1 vCPU / 1 GB), medium (2 vCPU / 2 GB), large (4 * vCPU / 4 GB), xlarge (8 vCPU / 8 GB). Defaults to standard. */ sandbox_size?: 'standard' | 'medium' | 'large' | 'xlarge'; } } interface Mcp { /** * The type of the MCP server. Can be http */ type: 'http'; /** * The URL of the MCP server */ url: string; } /** * Experimental features */ interface Experimental { /** * The assistive system prompt for the tool router session */ assistive_prompt?: string; /** * User-defined custom toolkits with grouped tools (no-auth) */ custom_toolkits?: Array; /** * Custom tools — standalone or extending Composio toolkits */ custom_tools?: Array; } namespace Experimental { interface CustomToolkit { description: string; name: string; slug: string; tools: Array; } namespace CustomToolkit { interface Tool { description: string; input_schema: { [key: string]: unknown; }; name: string; /** * Original tool slug as provided by the user */ original_slug: string; /** * Prefixed tool slug (e.g. LOCAL_CRM_FIND_CUSTOMER) */ slug: string; output_schema?: { [key: string]: unknown; }; } } interface CustomTool { description: string; input_schema: { [key: string]: unknown; }; name: string; /** * Original tool slug as provided by the user */ original_slug: string; /** * Prefixed tool slug (e.g. LOCAL_GMAIL_GET_IMPORTANT_EMAILS) */ slug: string; extends_toolkit?: string; output_schema?: { [key: string]: unknown; }; } } interface Warning { /** * Stable machine code identifying the advisory. Safe to switch on in client code. */ code: 'PRELOAD_TOOLS_HIGH_CONTEXT_USAGE'; /** * Human-readable description of the advisory. Suitable for logging or surfacing to * end users. */ message: string; } } export interface SessionAttachResponse { /** * The configuration used to create this session */ config: SessionAttachResponse.Config; /** * Monotonic version of the config. Incremented on each PATCH. Use for optimistic * concurrency control. */ config_version: number; mcp: SessionAttachResponse.Mcp; /** * The identifier of the session */ session_id: string; /** * List of available tools in this session */ tool_router_tools: Array; /** * Experimental features */ experimental?: SessionAttachResponse.Experimental; /** * Advisory list — the session exists and is usable, but the listed issues may * warrant attention. */ warnings?: Array; } export declare namespace SessionAttachResponse { /** * The configuration used to create this session */ interface Config { /** * Execute helper configuration */ execute: Config.Execute; /** * Preload configuration. Explicit slugs are returned as an array; dynamic preload * is returned as "all". */ preload: Config.Preload; /** * Search helper configuration */ search: Config.Search; /** * User identifier for this session */ user_id: string; /** * Auth config overrides per toolkit */ auth_configs?: { [key: string]: string; }; /** * Per-toolkit connected account overrides (array of nano-IDs). Multi-account * sessions can pin more than one account per toolkit; otherwise length is 1. */ connected_accounts?: { [key: string]: Array; }; /** * Manage connections configuration */ manage_connections?: Config.ManageConnections; /** * Multi-account configuration for this session. */ multi_account?: Config.MultiAccount; /** * MCP tool annotation hints for filtering tools with enabled/disabled support. * enabled: tags that the tool must have at least one of. disabled: tags that the * tool must NOT have any of. Both conditions must be satisfied. */ tags?: Config.Tags; /** * Toolkit configuration - either enabled list or disabled list */ toolkits?: Config.Enabled | Config.Disabled; /** * Tool-level configuration per toolkit */ tools?: { [key: string]: Config.Enabled | Config.Disabled | Config.Tags; }; /** * Workbench configuration */ workbench?: Config.Workbench; } namespace Config { /** * Execute helper configuration */ interface Execute { enable_multi_execute?: boolean; } /** * Preload configuration. Explicit slugs are returned as an array; dynamic preload * is returned as "all". */ interface Preload { /** * Explicit preloaded tool slugs, or "all" when the session dynamically exposes all * app tools allowed by its filters. */ tools: Array | 'all'; } /** * Search helper configuration */ interface Search { enable?: boolean; } /** * Manage connections configuration */ interface ManageConnections { /** * Custom callback URL for connected account auth flows */ callback_url?: string; /** * Enable the "remove" action in COMPOSIO_MANAGE_CONNECTIONS. Default true. */ enable_connection_removal?: boolean; /** * Enable the COMPOSIO_WAIT_FOR_CONNECTIONS tool for polling connection status. * Default false. May not work reliably with GPT models. */ enable_wait_for_connections?: boolean; /** * Whether to enable the connection manager for automatic connection handling */ enabled?: boolean; } /** * Multi-account configuration for this session. */ interface MultiAccount { /** * When true, enables multi-account mode for this session. When not set, falls back * to org/project-level configuration. */ enable?: boolean; /** * Maximum number of connected accounts allowed per toolkit. Defaults to 5 when * multi-account is enabled. */ max_accounts_per_toolkit?: number; /** * When true, require explicit account selection when multiple accounts are * connected. When false (default), use the first/default account. */ require_explicit_selection?: boolean; } /** * MCP tool annotation hints for filtering tools with enabled/disabled support. * enabled: tags that the tool must have at least one of. disabled: tags that the * tool must NOT have any of. Both conditions must be satisfied. */ interface Tags { /** * Tags that the tool must NOT have any of */ disabled?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>; /** * Tags that the tool must have at least one of */ enabled?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>; } interface Enabled { enabled: Array; } interface Disabled { disabled: Array; } interface Enabled { enabled: Array; } interface Disabled { disabled: Array; } interface Tags { tags: Tags.Tags; } namespace Tags { interface Tags { /** * Tags that the tool must NOT have any of */ disabled?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>; /** * Tags that the tool must have at least one of */ enabled?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>; } } /** * Workbench configuration */ interface Workbench { /** * Character threshold after which tool execution response are saved to a file in * workbench. Default is 20k. */ auto_offload_threshold?: number; /** * Whether the workbench (code execution sandbox) is enabled. When false, * COMPOSIO_REMOTE_WORKBENCH and COMPOSIO_REMOTE_BASH_TOOL are not exposed. */ enable?: boolean; /** * Whether proxy execution is enabled in the workbench */ proxy_execution_enabled?: boolean; /** * Sandbox compute tier: standard (1 vCPU / 1 GB), medium (2 vCPU / 2 GB), large (4 * vCPU / 4 GB), xlarge (8 vCPU / 8 GB). Defaults to standard. */ sandbox_size?: 'standard' | 'medium' | 'large' | 'xlarge'; } } interface Mcp { /** * The type of the MCP server. Can be http */ type: 'http'; /** * The URL of the MCP server */ url: string; } /** * Experimental features */ interface Experimental { /** * The assistive system prompt for the tool router session */ assistive_prompt?: string; /** * User-defined custom toolkits with grouped tools (no-auth) */ custom_toolkits?: Array; /** * Custom tools — standalone or extending Composio toolkits */ custom_tools?: Array; } namespace Experimental { interface CustomToolkit { description: string; name: string; slug: string; tools: Array; } namespace CustomToolkit { interface Tool { description: string; input_schema: { [key: string]: unknown; }; name: string; /** * Original tool slug as provided by the user */ original_slug: string; /** * Prefixed tool slug (e.g. LOCAL_CRM_FIND_CUSTOMER) */ slug: string; output_schema?: { [key: string]: unknown; }; } } interface CustomTool { description: string; input_schema: { [key: string]: unknown; }; name: string; /** * Original tool slug as provided by the user */ original_slug: string; /** * Prefixed tool slug (e.g. LOCAL_GMAIL_GET_IMPORTANT_EMAILS) */ slug: string; extends_toolkit?: string; output_schema?: { [key: string]: unknown; }; } } interface Warning { /** * Stable machine code identifying the advisory. Safe to switch on in client code. */ code: 'PRELOAD_TOOLS_HIGH_CONTEXT_USAGE'; /** * Human-readable description of the advisory. Suitable for logging or surfacing to * end users. */ message: string; } } export interface SessionConfigHistoryResponse { current_page: number; items: Array; total_items: number; total_pages: number; next_cursor?: string | null; } export declare namespace SessionConfigHistoryResponse { interface Item { /** * The session configuration at this version */ config: Item.Config; /** * ISO timestamp. For history rows, when the entry was archived (i.e. the moment * the version was superseded by a PATCH). */ created_at: string; /** * True only for the live (current) session config, present on the first page. * False for archived history rows. */ is_current: boolean; /** * The config version this entry represents */ version: number; } namespace Item { /** * The session configuration at this version */ interface Config { /** * Execute helper configuration */ execute: Config.Execute; /** * Preload configuration. Explicit slugs are returned as an array; dynamic preload * is returned as "all". */ preload: Config.Preload; /** * Search helper configuration */ search: Config.Search; /** * User identifier for this session */ user_id: string; /** * Auth config overrides per toolkit */ auth_configs?: { [key: string]: string; }; /** * Per-toolkit connected account overrides (array of nano-IDs). Multi-account * sessions can pin more than one account per toolkit; otherwise length is 1. */ connected_accounts?: { [key: string]: Array; }; /** * Manage connections configuration */ manage_connections?: Config.ManageConnections; /** * Multi-account configuration for this session. */ multi_account?: Config.MultiAccount; /** * MCP tool annotation hints for filtering tools with enabled/disabled support. * enabled: tags that the tool must have at least one of. disabled: tags that the * tool must NOT have any of. Both conditions must be satisfied. */ tags?: Config.Tags; /** * Toolkit configuration - either enabled list or disabled list */ toolkits?: Config.Enabled | Config.Disabled; /** * Tool-level configuration per toolkit */ tools?: { [key: string]: Config.Enabled | Config.Disabled | Config.Tags; }; /** * Workbench configuration */ workbench?: Config.Workbench; } namespace Config { /** * Execute helper configuration */ interface Execute { enable_multi_execute?: boolean; } /** * Preload configuration. Explicit slugs are returned as an array; dynamic preload * is returned as "all". */ interface Preload { /** * Explicit preloaded tool slugs, or "all" when the session dynamically exposes all * app tools allowed by its filters. */ tools: Array | 'all'; } /** * Search helper configuration */ interface Search { enable?: boolean; } /** * Manage connections configuration */ interface ManageConnections { /** * Custom callback URL for connected account auth flows */ callback_url?: string; /** * Enable the "remove" action in COMPOSIO_MANAGE_CONNECTIONS. Default true. */ enable_connection_removal?: boolean; /** * Enable the COMPOSIO_WAIT_FOR_CONNECTIONS tool for polling connection status. * Default false. May not work reliably with GPT models. */ enable_wait_for_connections?: boolean; /** * Whether to enable the connection manager for automatic connection handling */ enabled?: boolean; } /** * Multi-account configuration for this session. */ interface MultiAccount { /** * When true, enables multi-account mode for this session. When not set, falls back * to org/project-level configuration. */ enable?: boolean; /** * Maximum number of connected accounts allowed per toolkit. Defaults to 5 when * multi-account is enabled. */ max_accounts_per_toolkit?: number; /** * When true, require explicit account selection when multiple accounts are * connected. When false (default), use the first/default account. */ require_explicit_selection?: boolean; } /** * MCP tool annotation hints for filtering tools with enabled/disabled support. * enabled: tags that the tool must have at least one of. disabled: tags that the * tool must NOT have any of. Both conditions must be satisfied. */ interface Tags { /** * Tags that the tool must NOT have any of */ disabled?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>; /** * Tags that the tool must have at least one of */ enabled?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>; } interface Enabled { enabled: Array; } interface Disabled { disabled: Array; } interface Enabled { enabled: Array; } interface Disabled { disabled: Array; } interface Tags { tags: Tags.Tags; } namespace Tags { interface Tags { /** * Tags that the tool must NOT have any of */ disabled?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>; /** * Tags that the tool must have at least one of */ enabled?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>; } } /** * Workbench configuration */ interface Workbench { /** * Character threshold after which tool execution response are saved to a file in * workbench. Default is 20k. */ auto_offload_threshold?: number; /** * Whether the workbench (code execution sandbox) is enabled. When false, * COMPOSIO_REMOTE_WORKBENCH and COMPOSIO_REMOTE_BASH_TOOL are not exposed. */ enable?: boolean; /** * Whether proxy execution is enabled in the workbench */ proxy_execution_enabled?: boolean; /** * Sandbox compute tier: standard (1 vCPU / 1 GB), medium (2 vCPU / 2 GB), large (4 * vCPU / 4 GB), xlarge (8 vCPU / 8 GB). Defaults to standard. */ sandbox_size?: 'standard' | 'medium' | 'large' | 'xlarge'; } } } } export interface SessionExecuteResponse { /** * The data returned by the tool execution */ data: { [key: string]: unknown; }; /** * Error message if the execution failed, null otherwise */ error: string | null; /** * Unique identifier for the execution log */ log_id: string; } export interface SessionExecuteMetaResponse { /** * The data returned by the tool execution */ data: { [key: string]: unknown; }; /** * Error message if the execution failed, null otherwise */ error: string | null; /** * Unique identifier for the execution log */ log_id: string; } export interface SessionLinkResponse { /** * The unique identifier for the connected account */ connected_account_id: string; /** * Token used to complete the authentication flow */ link_token: string; /** * The URL where users should be redirected to complete OAuth */ redirect_url: string; /** * Experimental features - not stable, may be modified or removed in future * versions. */ experimental?: SessionLinkResponse.Experimental; } export declare namespace SessionLinkResponse { /** * Experimental features - not stable, may be modified or removed in future * versions. */ interface Experimental { /** * Sharing model for this connected account. PRIVATE is usable only by the owning * user_id. SHARED is reachable from a tool-router session only when explicitly * pinned in the session config. */ account_type: 'PRIVATE' | 'SHARED'; /** * Access control for SHARED connections. Visible only to the connection creator * and project/org API key callers; non-creator cookie callers receive the response * without this block. */ acl_config_for_shared?: Experimental.ACLConfigForShared; } namespace Experimental { /** * Access control for SHARED connections. Visible only to the connection creator * and project/org API key callers; non-creator cookie callers receive the response * without this block. */ interface ACLConfigForShared { allow_all_users: boolean; allowed_user_ids: Array; not_allowed_user_ids: Array; } } } export interface SessionPatchResponse { /** * The configuration used to create this session */ config: SessionPatchResponse.Config; /** * Monotonic version of the config. Incremented on each PATCH. Use for optimistic * concurrency control. */ config_version: number; mcp: SessionPatchResponse.Mcp; /** * The identifier of the session */ session_id: string; /** * List of available tools in this session */ tool_router_tools: Array; /** * Experimental features */ experimental?: SessionPatchResponse.Experimental; /** * Advisory list — the session exists and is usable, but the listed issues may * warrant attention. */ warnings?: Array; } export declare namespace SessionPatchResponse { /** * The configuration used to create this session */ interface Config { /** * Execute helper configuration */ execute: Config.Execute; /** * Preload configuration. Explicit slugs are returned as an array; dynamic preload * is returned as "all". */ preload: Config.Preload; /** * Search helper configuration */ search: Config.Search; /** * User identifier for this session */ user_id: string; /** * Auth config overrides per toolkit */ auth_configs?: { [key: string]: string; }; /** * Per-toolkit connected account overrides (array of nano-IDs). Multi-account * sessions can pin more than one account per toolkit; otherwise length is 1. */ connected_accounts?: { [key: string]: Array; }; /** * Manage connections configuration */ manage_connections?: Config.ManageConnections; /** * Multi-account configuration for this session. */ multi_account?: Config.MultiAccount; /** * MCP tool annotation hints for filtering tools with enabled/disabled support. * enabled: tags that the tool must have at least one of. disabled: tags that the * tool must NOT have any of. Both conditions must be satisfied. */ tags?: Config.Tags; /** * Toolkit configuration - either enabled list or disabled list */ toolkits?: Config.Enabled | Config.Disabled; /** * Tool-level configuration per toolkit */ tools?: { [key: string]: Config.Enabled | Config.Disabled | Config.Tags; }; /** * Workbench configuration */ workbench?: Config.Workbench; } namespace Config { /** * Execute helper configuration */ interface Execute { enable_multi_execute?: boolean; } /** * Preload configuration. Explicit slugs are returned as an array; dynamic preload * is returned as "all". */ interface Preload { /** * Explicit preloaded tool slugs, or "all" when the session dynamically exposes all * app tools allowed by its filters. */ tools: Array | 'all'; } /** * Search helper configuration */ interface Search { enable?: boolean; } /** * Manage connections configuration */ interface ManageConnections { /** * Custom callback URL for connected account auth flows */ callback_url?: string; /** * Enable the "remove" action in COMPOSIO_MANAGE_CONNECTIONS. Default true. */ enable_connection_removal?: boolean; /** * Enable the COMPOSIO_WAIT_FOR_CONNECTIONS tool for polling connection status. * Default false. May not work reliably with GPT models. */ enable_wait_for_connections?: boolean; /** * Whether to enable the connection manager for automatic connection handling */ enabled?: boolean; } /** * Multi-account configuration for this session. */ interface MultiAccount { /** * When true, enables multi-account mode for this session. When not set, falls back * to org/project-level configuration. */ enable?: boolean; /** * Maximum number of connected accounts allowed per toolkit. Defaults to 5 when * multi-account is enabled. */ max_accounts_per_toolkit?: number; /** * When true, require explicit account selection when multiple accounts are * connected. When false (default), use the first/default account. */ require_explicit_selection?: boolean; } /** * MCP tool annotation hints for filtering tools with enabled/disabled support. * enabled: tags that the tool must have at least one of. disabled: tags that the * tool must NOT have any of. Both conditions must be satisfied. */ interface Tags { /** * Tags that the tool must NOT have any of */ disabled?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>; /** * Tags that the tool must have at least one of */ enabled?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>; } interface Enabled { enabled: Array; } interface Disabled { disabled: Array; } interface Enabled { enabled: Array; } interface Disabled { disabled: Array; } interface Tags { tags: Tags.Tags; } namespace Tags { interface Tags { /** * Tags that the tool must NOT have any of */ disabled?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>; /** * Tags that the tool must have at least one of */ enabled?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>; } } /** * Workbench configuration */ interface Workbench { /** * Character threshold after which tool execution response are saved to a file in * workbench. Default is 20k. */ auto_offload_threshold?: number; /** * Whether the workbench (code execution sandbox) is enabled. When false, * COMPOSIO_REMOTE_WORKBENCH and COMPOSIO_REMOTE_BASH_TOOL are not exposed. */ enable?: boolean; /** * Whether proxy execution is enabled in the workbench */ proxy_execution_enabled?: boolean; /** * Sandbox compute tier: standard (1 vCPU / 1 GB), medium (2 vCPU / 2 GB), large (4 * vCPU / 4 GB), xlarge (8 vCPU / 8 GB). Defaults to standard. */ sandbox_size?: 'standard' | 'medium' | 'large' | 'xlarge'; } } interface Mcp { /** * The type of the MCP server. Can be http */ type: 'http'; /** * The URL of the MCP server */ url: string; } /** * Experimental features */ interface Experimental { /** * The assistive system prompt for the tool router session */ assistive_prompt?: string; /** * User-defined custom toolkits with grouped tools (no-auth) */ custom_toolkits?: Array; /** * Custom tools — standalone or extending Composio toolkits */ custom_tools?: Array; } namespace Experimental { interface CustomToolkit { description: string; name: string; slug: string; tools: Array; } namespace CustomToolkit { interface Tool { description: string; input_schema: { [key: string]: unknown; }; name: string; /** * Original tool slug as provided by the user */ original_slug: string; /** * Prefixed tool slug (e.g. LOCAL_CRM_FIND_CUSTOMER) */ slug: string; output_schema?: { [key: string]: unknown; }; } } interface CustomTool { description: string; input_schema: { [key: string]: unknown; }; name: string; /** * Original tool slug as provided by the user */ original_slug: string; /** * Prefixed tool slug (e.g. LOCAL_GMAIL_GET_IMPORTANT_EMAILS) */ slug: string; extends_toolkit?: string; output_schema?: { [key: string]: unknown; }; } } interface Warning { /** * Stable machine code identifying the advisory. Safe to switch on in client code. */ code: 'PRELOAD_TOOLS_HIGH_CONTEXT_USAGE'; /** * Human-readable description of the advisory. Suitable for logging or surfacing to * end users. */ message: string; } } export interface SessionProxyExecuteResponse { /** * The HTTP status code returned from the proxied API */ status: number; /** * Binary body response data. Present when the response is a binary file. */ binary_data?: SessionProxyExecuteResponse.BinaryData; /** * The response data returned from the proxied API */ data?: unknown; /** * The HTTP headers returned from the proxied API */ headers?: { [key: string]: string; }; } export declare namespace SessionProxyExecuteResponse { /** * Binary body response data. Present when the response is a binary file. */ interface BinaryData { /** * Content-Type of the binary data */ content_type: string; /** * File size in bytes */ size: number; /** * URL to download binary content */ url: string; /** * ISO 8601 timestamp when the URL expires */ expires_at?: string; } } export interface SessionSearchResponse { /** * Error message if any searches failed, null if all succeeded. Format: "X out of Y * searches failed, reasons:
" */ error: string | null; /** * Combined workflow guidance covering connections, planner, and memory usage. Each * element is a step instruction. */ next_steps_guidance: Array; /** * Per-query search results with tools, reasoning, and memory. One entry per query * in request order. */ results: Array; /** * Session info for correlating meta tool calls */ session: SessionSearchResponse.Session; /** * Whether all searches completed successfully. False if any query failed. */ success: boolean; /** * Time information for the query */ time_info: SessionSearchResponse.TimeInfo; /** * Deduplicated tool definitions keyed by tool_slug for O(1) lookup. Each tool * appears once even if used in multiple queries. */ tool_schemas: { [key: string]: SessionSearchResponse.ToolSchemas; }; /** * Connection status for all toolkits mentioned across all queries, with * descriptions merged in. */ toolkit_connection_statuses: Array; } export declare namespace SessionSearchResponse { interface Result { /** * 1-based index of the query in the request */ index: number; /** * List of main tool slugs matching the search criteria */ primary_tool_slugs: Array; /** * List of related tool slugs that might be useful */ related_tool_slugs: Array; /** * List of unique toolkit slugs used by tools in this query */ toolkits: Array; /** * The use case that was searched */ use_case: string; /** * Task difficulty assessment (e.g., "easy - Simple single-tool operation with * known parameters") */ difficulty?: string; /** * Error message if the search for this query failed, null otherwise. Always * present for failed queries. */ error?: string | null; /** * Guidance message about the search results, particularly when a cached plan is * available */ execution_guidance?: string; /** * Common pitfalls and considerations (only present when cached plan is available) */ known_pitfalls?: Array; /** * Memory data relevant to this query, grouped by app. Only present for non-cached * search results. */ memory?: { [key: string]: Array; }; /** * ID of cached plan if available */ plan_id?: string; /** * Workflow steps from cached plan (only present when cached plan is available) */ recommended_plan_steps?: Array; /** * Reference Python code snippets for processing tool responses in the workbench * (only present when cached plan is available) */ reference_workbench_snippets?: Array; } namespace Result { interface ReferenceWorkbenchSnippet { /** * Python code snippet for the workbench */ code: string; /** * Description of what the code snippet does */ description: string; } } /** * Session info for correlating meta tool calls */ interface Session { /** * Session identifier to be passed to subsequent meta tool calls as session_id. */ id: string; /** * Whether a fresh session id was generated in this call. */ generate_id: boolean; /** * LLM-facing guidance on how to reuse this session id */ instructions: string; } /** * Time information for the query */ interface TimeInfo { /** * Current time in ISO format (UTC) */ current_time_utc: string; /** * Current time as Unix epoch timestamp in seconds */ current_time_utc_epoch_seconds: number; /** * Important message about time handling and timezone considerations */ message: string; } interface ToolSchemas { /** * The slug of the tool */ tool_slug: string; /** * The slug of the toolkit that provides this tool */ toolkit: string; /** * Description of the tool */ description?: string; /** * Whether the full input_schema is included in this response */ hasFullSchema?: boolean; /** * Input schema for the tool (only present when hasFullSchema is true) */ input_schema?: { [key: string]: unknown; }; /** * Output/response schema for the tool. Only included when include_output_schemas * is true. */ output_schema?: { [key: string]: unknown; }; /** * Reference to fetch full schema when hasFullSchema is false */ schemaRef?: ToolSchemas.SchemaRef; } namespace ToolSchemas { /** * Reference to fetch full schema when hasFullSchema is false */ interface SchemaRef { /** * Arguments to pass to the tool */ args: SchemaRef.Args; /** * Tool to call */ tool: 'COMPOSIO_GET_TOOL_SCHEMAS'; /** * Instruction message for the LLM */ message?: string; } namespace SchemaRef { /** * Arguments to pass to the tool */ interface Args { /** * Tool slugs to fetch schemas for */ tool_slugs: Array; } } } interface ToolkitConnectionStatus { /** * Description of what the toolkit does and its capabilities */ description: string; /** * Whether an active connection exists for this toolkit */ has_active_connection: boolean; /** * Human-readable message about the connection status and next steps */ status_message: string; /** * The toolkit slug identifier (e.g., "gmail", "slack") */ toolkit: string; /** * When "required", the agent must specify which account to use. Present only when * multiple accounts exist. */ account_selection?: 'required'; /** * Sharing model for the connected account when has_active_connection is true. * PRIVATE is owner-only; SHARED is reachable only when explicitly pinned to the * session. */ account_type?: 'PRIVATE' | 'SHARED'; /** * List of connected accounts for this toolkit. Present when multi-account is * enabled. */ accounts?: Array; /** * Connection details including auth config and connected account IDs. Only present * when has_active_connection is true. */ connection_details?: { [key: string]: unknown; }; /** * Information about the currently connected user (email, name, etc.) */ current_user_info?: { [key: string]: unknown; }; } namespace ToolkitConnectionStatus { interface Account { /** * Unique identifier for this account */ id: string; /** * ISO 8601 timestamp of when the account was connected */ created_at: string; /** * Whether this is the default account for the toolkit */ is_default: boolean; /** * Connection status (e.g., "active") */ status: string; /** * Sharing model for this connected account. PRIVATE is owner-only; SHARED is * reachable from a tool-router session only when explicitly pinned. */ account_type?: 'PRIVATE' | 'SHARED'; /** * User-assigned alias for this account */ alias?: string; /** * Information about the connected user (email, name, etc.) */ user_info?: { [key: string]: unknown; }; } } } export interface SessionToolkitsResponse { current_page: number; items: Array; total_items: number; total_pages: number; next_cursor?: string | null; } export declare namespace SessionToolkitsResponse { interface Item { /** * Available Composio-managed auth schemes */ composio_managed_auth_schemes: Array; /** * Connected account if available */ connected_account: Item.ConnectedAccount | null; /** * Whether the toolkit is enabled */ enabled: boolean; /** * Whether the toolkit is no-auth */ is_no_auth: boolean; /** * Toolkit metadata */ meta: Item.Meta; /** * Display name of the toolkit */ name: string; /** * Unique slug identifier */ slug: string; } namespace Item { /** * Connected account if available */ interface ConnectedAccount { /** * Connected account identifier */ id: string; /** * Auth config details */ auth_config: ConnectedAccount.AuthConfig; /** * Creation timestamp */ created_at: string; /** * Connection status */ status: string; /** * User identifier */ user_id: string; } namespace ConnectedAccount { /** * Auth config details */ interface AuthConfig { /** * Auth config identifier */ id: string; /** * Authentication scheme type */ auth_scheme: string; /** * Whether this is a Composio-managed auth config */ is_composio_managed: boolean; } } /** * Toolkit metadata */ interface Meta { /** * Description of the toolkit */ description: string; /** * URL to the toolkit logo */ logo: string; } } } export interface SessionToolsResponse { current_page: number; items: Array; total_items: number; total_pages: number; next_cursor?: string | null; } export declare namespace SessionToolsResponse { interface Item { /** * List of all available versions for this tool */ available_versions: Array; deprecated: Item.Deprecated; /** * Detailed explanation of the tool's functionality and purpose */ description: string; /** * Schema definition of required input parameters for the tool */ input_parameters: { [key: string]: unknown; }; /** * Indicates if this tool is deprecated and may be removed in the future */ is_deprecated: boolean; /** * Human-readable display name of the tool */ name: string; /** * Indicates if the tool can be used without authentication */ no_auth: boolean; /** * Schema definition of return values from the tool */ output_parameters: { [key: string]: unknown; }; /** * Structured scope requirements for the tool. Null means the tool is legacy and * only exposes flat scopes. */ scope_requirements: Item.ScopeRequirements | null; /** * List of scopes associated with the tool */ scopes: Array; /** * Unique identifier for the tool */ slug: string; /** * List of tags associated with the tool for categorization and filtering */ tags: Array; toolkit: Item.Toolkit; /** * Current version of the tool */ version: string; /** * Human-friendly description of the tool, if available */ human_description?: string; } namespace Item { interface Deprecated { /** * List of all available versions for this tool */ available_versions: Array; /** * The display name of the tool */ displayName: string; /** * Indicates if this tool is deprecated and may be removed in the future */ is_deprecated: boolean; toolkit: Deprecated.Toolkit; /** * Current version identifier of the tool */ version: string; } namespace Deprecated { interface Toolkit { /** * URL to the toolkit logo image */ logo: string; } } /** * Structured scope requirements for the tool. Null means the tool is legacy and * only exposes flat scopes. */ interface ScopeRequirements { all_of: Array; } namespace ScopeRequirements { interface AnyOf { any_of: Array; } } interface Toolkit { /** * URL to the toolkit logo image */ logo: string; /** * Human-readable name of the parent toolkit */ name: string; /** * Unique identifier of the parent toolkit */ slug: string; } } } export interface SessionCreateParams { /** * The identifier of the user who is initiating the session, ideally a unique * identifier from your database like a user ID or email address */ user_id: string; /** * The auth configs to use for the session. This will override the default behavior * and use the given auth config when specific toolkits are being executed */ auth_configs?: { [key: string]: string; }; /** * The connected accounts to use for the session, as an array of nano-IDs per * toolkit. This overrides the default behaviour and pins specific connected * accounts when toolkits are executed. Each account must exist (not deleted or * disabled) and belong to the same `user_id` as the session. Multi-account * sessions can pin multiple; non-multi-account sessions are capped at length 1. */ connected_accounts?: { [key: string]: Array; }; execute?: SessionCreateParams.Execute; /** * Experimental features - not stable, may be modified or removed in future * versions. */ experimental?: SessionCreateParams.Experimental; /** * Configuration for connection management settings */ manage_connections?: SessionCreateParams.ManageConnections; /** * Configure multi-account behavior. When enabled, users can connect multiple * accounts per toolkit. */ multi_account?: SessionCreateParams.MultiAccount; /** * Preload configuration. Use an explicit list for frequently used tool slugs, or * "all" to dynamically expose every app tool allowed by positive * toolkits/tools/tags filters. */ preload?: SessionCreateParams.Preload; search?: SessionCreateParams.Search; /** * Global MCP tool annotation hints for filtering. Array format is treated as * enabled list. Object format supports both enabled (tool must have at least one) * and disabled (tool must NOT have any) lists. Toolkit-level tags override this. * Toolkit enabled/disabled lists take precedence over tag filtering. */ tags?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'> | SessionCreateParams.UnionMember1; /** * Toolkit configuration - specify either enable toolkits (allowlist) or disable * toolkits (denylist). Mutually exclusive. */ toolkits?: SessionCreateParams.Enable | SessionCreateParams.Disable; /** * Tool-level configuration per toolkit. Allows you to enable, disable, or filter * by tags for specific tools within each toolkit. Every slug passed in `enable` / * `disable` must be a valid Composio tool slug for that toolkit — invalid or * typo'd slugs fail session creation with a clear error listing which ones didn't * match. */ tools?: { [key: string]: SessionCreateParams.Enable | SessionCreateParams.Disable | SessionCreateParams.Tags; }; /** * Configuration for workbench behavior */ workbench?: SessionCreateParams.Workbench; } export declare namespace SessionCreateParams { interface Execute { enable_multi_execute?: boolean; } /** * Experimental features - not stable, may be modified or removed in future * versions. */ interface Experimental { /** * Customize assistive prompt generation (e.g., timezone). */ assistive_prompt_config?: Experimental.AssistivePromptConfig; /** * Custom toolkits with grouped tools. Toolkit slugs must not conflict with * existing Composio toolkits. All tools are no-auth. */ custom_toolkits?: Array; /** * Custom tools to include in search. Standalone tools need no auth. Tools with * extends_toolkit inherit the Composio toolkit's connection. */ custom_tools?: Array; /** * Experimental base URL override for connection link redirects created from this * tool-router session. When set, link creation returns * `${link_url_overwrite}/link/{link_token}` instead of the default Composio * Connect base URL. Use only when your integration needs links to open through a * custom Connect host. */ link_url_overwrite?: string; /** * Per-tool elicitation permission config. Default behavior + per-tool * always_allow/always_deny overrides. Mutation via PATCH. */ permissions?: Experimental.Permissions; } namespace Experimental { /** * Customize assistive prompt generation (e.g., timezone). */ interface AssistivePromptConfig { /** * IANA timezone identifier (e.g., 'America/New_York', 'Europe/London'). Used to * customize the system prompt with timezone-aware instructions. */ user_timezone?: string; } interface CustomToolkit { /** * Used for BM25 search matching and shown in toolkit connection statuses. */ description: string; /** * Display name shown to the LLM and in search results. */ name: string; /** * Unique slug for the toolkit. Must not conflict with existing Composio toolkit * slugs. Alphanumeric, underscores, and hyphens only. */ slug: string; /** * Tools in this custom toolkit */ tools: Array; /** * SDK hint for direct custom-tool exposure. Not stored in session config; echoed * in create/attach responses for inline custom definitions. */ preload?: boolean; } namespace CustomToolkit { interface Tool { /** * Used for BM25 search matching and shown to the LLM. */ description: string; /** * Must have type: "object" and a properties field. */ input_schema: { [key: string]: unknown; }; /** * Human-readable display name */ name: string; /** * Tool slug. Combined with toolkit slug to form LOCAL** (max 60 * chars total). */ slug: string; /** * Optional output schema for the tool response. */ output_schema?: { [key: string]: unknown; }; /** * SDK hint for direct custom-tool exposure. Not stored in session config; echoed * in create/attach responses for inline custom definitions. */ preload?: boolean; } } interface CustomTool { /** * Used for BM25 search matching and shown to the LLM. */ description: string; /** * Must have type: "object" and a properties field. */ input_schema: { [key: string]: unknown; }; /** * Human-readable display name */ name: string; /** * Tool slug. Forms LOCAL* (standalone) or LOCAL*\_ * (extending). Max 60 chars total. */ slug: string; /** * If set, must be a valid Composio toolkit slug. The tool inherits that toolkit's * auth/connection status. If omitted, the tool is standalone (no-auth). */ extends_toolkit?: string; /** * JSON Schema describing tool output (optional) */ output_schema?: { [key: string]: unknown; }; /** * SDK hint for direct custom-tool exposure. Not stored in session config; echoed * in create/attach responses for inline custom definitions. */ preload?: boolean; } /** * Per-tool elicitation permission config. Default behavior + per-tool * always_allow/always_deny overrides. Mutation via PATCH. */ interface Permissions { /** * Default elicitation behavior when no override matches. `allow_all` runs every * tool without prompting; `ask_every_call` prompts on each invocation; * `ask_once_per_session` prompts once and remembers the answer for the rest of the * session. */ default: 'allow_all' | 'ask_every_call' | 'ask_once_per_session'; /** * Per-tool overrides keyed by `${toolSlug}:${connectedAccountId ?? "__none__"}`, * plus account-wide overrides keyed by `*:${connectedAccountId ?? "__none__"}`. * Exact tool overrides take precedence over account-wide overrides. `always_allow` * skips the prompt and runs the tool; `always_deny` blocks the tool; `ask_once` * prompts once per session (allow/deny) and remembers; `ask_always` prompts on * every call with allow-once/allow-session/deny, ignoring any cached session * allow. Overrides take precedence over `default`. */ overrides?: { [key: string]: 'always_allow' | 'always_deny' | 'ask_once' | 'ask_always'; }; } } /** * Configuration for connection management settings */ interface ManageConnections { /** * The URL to redirect to after a user completes authentication for a connected * account. This allows you to handle the auth callback in your own application. */ callback_url?: string; /** * Whether to enable the connection manager for automatic connection handling. If * true, we will provide a tool your agent can use to initiate connections to * toolkits if it doesnt exist. If set to false, then you have to manage * connections manually. */ enable?: boolean | null; /** * Enable the "remove" action in COMPOSIO_MANAGE_CONNECTIONS to allow deleting * connected accounts. Default true. */ enable_connection_removal?: boolean | null; /** * When true, the COMPOSIO_WAIT_FOR_CONNECTIONS tool is available for agents to * poll connection status after sharing auth URLs. Default is false (disabled). May * not work reliably with GPT models. */ enable_wait_for_connections?: boolean | null; } /** * Configure multi-account behavior. When enabled, users can connect multiple * accounts per toolkit. */ interface MultiAccount { /** * When true, enables multi-account mode for this session. When not set, falls back * to org/project-level configuration. */ enable?: boolean; /** * Maximum number of connected accounts allowed per toolkit. Must be between 2 * and 10. */ max_accounts_per_toolkit?: number; /** * When true, the agent must explicitly select which account to use. When false * (default), the first/default account is used automatically. */ require_explicit_selection?: boolean; } /** * Preload configuration. Use an explicit list for frequently used tool slugs, or * "all" to dynamically expose every app tool allowed by positive * toolkits/tools/tags filters. */ interface Preload { /** * Explicit tool slugs to preload, or "all" to dynamically expose all current and * future app tools allowed by the positive session filters. "all" is capped at * 1000 tools and is not supported without a positive allowlist. */ tools?: Array | string; } interface Search { enable?: boolean; } interface UnionMember1 { disable?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>; enable?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>; } /** * Enable only specific toolkits (allowlist) */ interface Enable { /** * Only these specific toolkits will be enabled */ enable: Array; } /** * Disable specific toolkits (denylist) */ interface Disable { /** * These specific toolkits will be disabled */ disable: Array; } interface Enable { /** * Only these specific tools will be available for this toolkit */ enable: Array; } interface Disable { /** * These specific tools will be disabled for this toolkit */ disable: Array; } interface Tags { /** * MCP tags to filter tools. Array format is treated as enabled list. Object format * supports both enabled and disabled lists. */ tags: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'> | Tags.UnionMember1; } namespace Tags { interface UnionMember1 { disable?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>; enable?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>; } } /** * Configuration for workbench behavior */ interface Workbench { /** * Character threshold for automatic offloading. When workbench response exceeds * this threshold, it will be automatically offloaded. Default is picked * automatically based on the response size. */ auto_offload_threshold?: number; /** * Set to false to disable the workbench entirely. When disabled, no code execution * tools are available in the session. */ enable?: boolean; /** * Whether proxy execution is enabled. When enabled, workbench can call URLs and * APIs directly. */ enable_proxy_execution?: boolean; /** * Sandbox compute tier: standard (1 vCPU / 1 GB), medium (2 vCPU / 2 GB), large (4 * vCPU / 4 GB), xlarge (8 vCPU / 8 GB). Defaults to standard. */ sandbox_size?: 'standard' | 'medium' | 'large' | 'xlarge'; } } export interface SessionAttachParams { /** * Inline custom tools and toolkits for this request. v3.1 sessions do not persist * customs — pass them on every request that needs them. */ experimental?: SessionAttachParams.Experimental; } export declare namespace SessionAttachParams { /** * Inline custom tools and toolkits for this request. v3.1 sessions do not persist * customs — pass them on every request that needs them. */ interface Experimental { /** * Custom toolkits with grouped tools. Toolkit slugs must not conflict with * existing Composio toolkits. All tools are no-auth. */ custom_toolkits?: Array; /** * Custom tools to include in search. Standalone tools need no auth. Tools with * extends_toolkit inherit the Composio toolkit's connection. */ custom_tools?: Array; } namespace Experimental { interface CustomToolkit { /** * Used for BM25 search matching and shown in toolkit connection statuses. */ description: string; /** * Display name shown to the LLM and in search results. */ name: string; /** * Unique slug for the toolkit. Must not conflict with existing Composio toolkit * slugs. Alphanumeric, underscores, and hyphens only. */ slug: string; /** * Tools in this custom toolkit */ tools: Array; /** * SDK hint for direct custom-tool exposure. Not stored in session config; echoed * in create/attach responses for inline custom definitions. */ preload?: boolean; } namespace CustomToolkit { interface Tool { /** * Used for BM25 search matching and shown to the LLM. */ description: string; /** * Must have type: "object" and a properties field. */ input_schema: { [key: string]: unknown; }; /** * Human-readable display name */ name: string; /** * Tool slug. Combined with toolkit slug to form LOCAL** (max 60 * chars total). */ slug: string; /** * Optional output schema for the tool response. */ output_schema?: { [key: string]: unknown; }; /** * SDK hint for direct custom-tool exposure. Not stored in session config; echoed * in create/attach responses for inline custom definitions. */ preload?: boolean; } } interface CustomTool { /** * Used for BM25 search matching and shown to the LLM. */ description: string; /** * Must have type: "object" and a properties field. */ input_schema: { [key: string]: unknown; }; /** * Human-readable display name */ name: string; /** * Tool slug. Forms LOCAL* (standalone) or LOCAL*\_ * (extending). Max 60 chars total. */ slug: string; /** * If set, must be a valid Composio toolkit slug. The tool inherits that toolkit's * auth/connection status. If omitted, the tool is standalone (no-auth). */ extends_toolkit?: string; /** * JSON Schema describing tool output (optional) */ output_schema?: { [key: string]: unknown; }; /** * SDK hint for direct custom-tool exposure. Not stored in session config; echoed * in create/attach responses for inline custom definitions. */ preload?: boolean; } } } export interface SessionConfigHistoryParams { /** * Cursor for pagination. The cursor is a base64 encoded string of the page and * limit. The page is the page number and the limit is the number of items per * page. The cursor is used to paginate through the items. The cursor is not * required for the first page. */ cursor?: string; /** * Number of items per page, max allowed is 100 */ limit?: number; } export interface SessionExecuteParams { /** * The unique slug identifier of the tool to execute. Supports both meta tools and * app tools exposed by the session. */ tool_slug: string; /** * Account identifier to specify which connected account to use for direct tool * execution. Use the account ID (e.g. "coup_hurricane_dal_analytical") or an * alias. When omitted with a single account, the default is used. When omitted * with multiple accounts, an error lists available accounts. Meta/helper tools * either ignore this top-level field or define their own account-selection fields, * for example COMPOSIO_MULTI_EXECUTE_TOOL.tools[].account. */ account?: string; /** * The arguments required by the tool */ arguments?: { [key: string]: unknown; }; /** * When true, direct non-meta tool execution may return a workbench offload preview * if the response exceeds the configured threshold and the session workbench is * enabled. When omitted or false, direct tool execution returns the normal inline * response. Meta/helper tools are unaffected, and COMPOSIO_MULTI_EXECUTE_TOOL uses * session.workbench configuration for its own batch-level offload behavior. */ enable_auto_workbench_offload?: boolean; /** * Inline custom tools and toolkits for this request. v3.1 sessions do not persist * customs — pass them on every request that needs them. */ experimental?: SessionExecuteParams.Experimental; } export declare namespace SessionExecuteParams { /** * Inline custom tools and toolkits for this request. v3.1 sessions do not persist * customs — pass them on every request that needs them. */ interface Experimental { /** * Custom toolkits with grouped tools. Toolkit slugs must not conflict with * existing Composio toolkits. All tools are no-auth. */ custom_toolkits?: Array; /** * Custom tools to include in search. Standalone tools need no auth. Tools with * extends_toolkit inherit the Composio toolkit's connection. */ custom_tools?: Array; } namespace Experimental { interface CustomToolkit { /** * Used for BM25 search matching and shown in toolkit connection statuses. */ description: string; /** * Display name shown to the LLM and in search results. */ name: string; /** * Unique slug for the toolkit. Must not conflict with existing Composio toolkit * slugs. Alphanumeric, underscores, and hyphens only. */ slug: string; /** * Tools in this custom toolkit */ tools: Array; /** * SDK hint for direct custom-tool exposure. Not stored in session config; echoed * in create/attach responses for inline custom definitions. */ preload?: boolean; } namespace CustomToolkit { interface Tool { /** * Used for BM25 search matching and shown to the LLM. */ description: string; /** * Must have type: "object" and a properties field. */ input_schema: { [key: string]: unknown; }; /** * Human-readable display name */ name: string; /** * Tool slug. Combined with toolkit slug to form LOCAL** (max 60 * chars total). */ slug: string; /** * Optional output schema for the tool response. */ output_schema?: { [key: string]: unknown; }; /** * SDK hint for direct custom-tool exposure. Not stored in session config; echoed * in create/attach responses for inline custom definitions. */ preload?: boolean; } } interface CustomTool { /** * Used for BM25 search matching and shown to the LLM. */ description: string; /** * Must have type: "object" and a properties field. */ input_schema: { [key: string]: unknown; }; /** * Human-readable display name */ name: string; /** * Tool slug. Forms LOCAL* (standalone) or LOCAL*\_ * (extending). Max 60 chars total. */ slug: string; /** * If set, must be a valid Composio toolkit slug. The tool inherits that toolkit's * auth/connection status. If omitted, the tool is standalone (no-auth). */ extends_toolkit?: string; /** * JSON Schema describing tool output (optional) */ output_schema?: { [key: string]: unknown; }; /** * SDK hint for direct custom-tool exposure. Not stored in session config; echoed * in create/attach responses for inline custom definitions. */ preload?: boolean; } } } export interface SessionExecuteMetaParams { /** * The unique slug identifier of the meta tool to execute */ slug: 'COMPOSIO_SEARCH_TOOLS' | 'COMPOSIO_MULTI_EXECUTE_TOOL' | 'COMPOSIO_MANAGE_CONNECTIONS' | 'COMPOSIO_WAIT_FOR_CONNECTIONS' | 'COMPOSIO_REMOTE_WORKBENCH' | 'COMPOSIO_REMOTE_BASH_TOOL' | 'COMPOSIO_GET_TOOL_SCHEMAS'; /** * The arguments required by the meta tool */ arguments?: { [key: string]: unknown; }; /** * Inline custom tools and toolkits for this request. v3.1 sessions do not persist * customs — pass them on every request that needs them. */ experimental?: SessionExecuteMetaParams.Experimental; } export declare namespace SessionExecuteMetaParams { /** * Inline custom tools and toolkits for this request. v3.1 sessions do not persist * customs — pass them on every request that needs them. */ interface Experimental { /** * Custom toolkits with grouped tools. Toolkit slugs must not conflict with * existing Composio toolkits. All tools are no-auth. */ custom_toolkits?: Array; /** * Custom tools to include in search. Standalone tools need no auth. Tools with * extends_toolkit inherit the Composio toolkit's connection. */ custom_tools?: Array; } namespace Experimental { interface CustomToolkit { /** * Used for BM25 search matching and shown in toolkit connection statuses. */ description: string; /** * Display name shown to the LLM and in search results. */ name: string; /** * Unique slug for the toolkit. Must not conflict with existing Composio toolkit * slugs. Alphanumeric, underscores, and hyphens only. */ slug: string; /** * Tools in this custom toolkit */ tools: Array; /** * SDK hint for direct custom-tool exposure. Not stored in session config; echoed * in create/attach responses for inline custom definitions. */ preload?: boolean; } namespace CustomToolkit { interface Tool { /** * Used for BM25 search matching and shown to the LLM. */ description: string; /** * Must have type: "object" and a properties field. */ input_schema: { [key: string]: unknown; }; /** * Human-readable display name */ name: string; /** * Tool slug. Combined with toolkit slug to form LOCAL** (max 60 * chars total). */ slug: string; /** * Optional output schema for the tool response. */ output_schema?: { [key: string]: unknown; }; /** * SDK hint for direct custom-tool exposure. Not stored in session config; echoed * in create/attach responses for inline custom definitions. */ preload?: boolean; } } interface CustomTool { /** * Used for BM25 search matching and shown to the LLM. */ description: string; /** * Must have type: "object" and a properties field. */ input_schema: { [key: string]: unknown; }; /** * Human-readable display name */ name: string; /** * Tool slug. Forms LOCAL* (standalone) or LOCAL*\_ * (extending). Max 60 chars total. */ slug: string; /** * If set, must be a valid Composio toolkit slug. The tool inherits that toolkit's * auth/connection status. If omitted, the tool is standalone (no-auth). */ extends_toolkit?: string; /** * JSON Schema describing tool output (optional) */ output_schema?: { [key: string]: unknown; }; /** * SDK hint for direct custom-tool exposure. Not stored in session config; echoed * in create/attach responses for inline custom definitions. */ preload?: boolean; } } } export interface SessionLinkParams { /** * The unique slug identifier of the toolkit to connect */ toolkit: string; /** * A human-readable alias for this connected account. Must be unique per entity and * toolkit within the project. */ alias?: string; /** * URL where users will be redirected after completing auth */ callback_url?: string; /** * Experimental features - not stable, may be modified or removed in future * versions. */ experimental?: SessionLinkParams.Experimental; } export declare namespace SessionLinkParams { /** * Experimental features - not stable, may be modified or removed in future * versions. */ interface Experimental { /** * Sharing model for this connected account. PRIVATE (default) is usable only by * the owning user_id. SHARED is reachable from a tool-router session ONLY when * explicitly pinned in the session config — at most one SHARED connection per * toolkit per session. Sessions never use a SHARED connection implicitly. */ account_type?: 'PRIVATE' | 'SHARED'; /** * Access control for SHARED connections. Resolution rule (only fires when caller * != creator): user in not_allowed_user_ids → DENY; allow_all_users=true → ALLOW; * user in allowed_user_ids → ALLOW; else DENY. Default state (omitted or {}) is * deny-by-default — only the creator can use. */ acl_config_for_shared?: Experimental.ACLConfigForShared; } namespace Experimental { /** * Access control for SHARED connections. Resolution rule (only fires when caller * != creator): user in not_allowed_user_ids → DENY; allow_all_users=true → ALLOW; * user in allowed_user_ids → ALLOW; else DENY. Default state (omitted or {}) is * deny-by-default — only the creator can use. */ interface ACLConfigForShared { /** * Wildcard "any user_id in the project" allow toggle. Only valid on SHARED * connections. */ allow_all_users?: boolean; /** * Explicit allow list of user_ids who can use this SHARED connection. */ allowed_user_ids?: Array; /** * Explicit deny list. Wins on conflict with allow_all_users and allowed_user_ids. */ not_allowed_user_ids?: Array; } } } export interface SessionPatchParams { /** * The auth configs to use for the session. This will override the default behavior * and use the given auth config when specific toolkits are being executed */ auth_configs?: { [key: string]: string; }; /** * The connected accounts to use for the session, as an array of nano-IDs per * toolkit. This overrides the default behaviour and pins specific connected * accounts when toolkits are executed. Each account must exist (not deleted or * disabled) and belong to the same `user_id` as the session. Multi-account * sessions can pin multiple; non-multi-account sessions are capped at length 1. */ connected_accounts?: { [key: string]: Array; } | null; execute?: SessionPatchParams.Execute; experimental?: SessionPatchParams.Experimental | null; manage_connections?: SessionPatchParams.ManageConnections | null; multi_account?: SessionPatchParams.MultiAccount | null; /** * Preload configuration. Use an explicit list for frequently used tool slugs, or * "all" to dynamically expose every app tool allowed by positive * toolkits/tools/tags filters. */ preload?: SessionPatchParams.Preload; search?: SessionPatchParams.Search; /** * Global MCP tool annotation hints for filtering. Array format is treated as * enabled list. Object format supports both enabled (tool must have at least one) * and disabled (tool must NOT have any) lists. Toolkit-level tags override this. * Toolkit enabled/disabled lists take precedence over tag filtering. */ tags?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'> | SessionPatchParams.UnionMember1; /** * Toolkit configuration - specify either enable toolkits (allowlist) or disable * toolkits (denylist). Mutually exclusive. */ toolkits?: SessionPatchParams.Enable | SessionPatchParams.Disable; /** * Tool-level configuration per toolkit. Allows you to enable, disable, or filter * by tags for specific tools within each toolkit. Every slug passed in `enable` / * `disable` must be a valid Composio tool slug for that toolkit — invalid or * typo'd slugs fail session creation with a clear error listing which ones didn't * match. */ tools?: { [key: string]: SessionPatchParams.Enable | SessionPatchParams.Disable | SessionPatchParams.Tags; }; workbench?: SessionPatchParams.Workbench | null; } export declare namespace SessionPatchParams { interface Execute { enable_multi_execute?: boolean; } interface Experimental { /** * Experimental base URL override for connection link redirects created from this * tool-router session. When set, link creation returns * `${link_url_overwrite}/link/{link_token}` instead of the default Composio * Connect base URL. Use only when your integration needs links to open through a * custom Connect host. */ link_url_overwrite?: string; /** * Per-tool elicitation permission config. Replaces the stored block when provided. */ permissions?: Experimental.Permissions; } namespace Experimental { /** * Per-tool elicitation permission config. Replaces the stored block when provided. */ interface Permissions { /** * Default elicitation behavior when no override matches. `allow_all` runs every * tool without prompting; `ask_every_call` prompts on each invocation; * `ask_once_per_session` prompts once and remembers the answer for the rest of the * session. */ default: 'allow_all' | 'ask_every_call' | 'ask_once_per_session'; /** * Per-tool overrides keyed by `${toolSlug}:${connectedAccountId ?? "__none__"}`, * plus account-wide overrides keyed by `*:${connectedAccountId ?? "__none__"}`. * Exact tool overrides take precedence over account-wide overrides. `always_allow` * skips the prompt and runs the tool; `always_deny` blocks the tool; `ask_once` * prompts once per session (allow/deny) and remembers; `ask_always` prompts on * every call with allow-once/allow-session/deny, ignoring any cached session * allow. Overrides take precedence over `default`. */ overrides?: { [key: string]: 'always_allow' | 'always_deny' | 'ask_once' | 'ask_always'; }; } } interface ManageConnections { /** * The URL to redirect to after a user completes authentication for a connected * account. This allows you to handle the auth callback in your own application. */ callback_url?: string; /** * Whether to enable the connection manager for automatic connection handling. If * true, we will provide a tool your agent can use to initiate connections to * toolkits if it doesnt exist. If set to false, then you have to manage * connections manually. */ enable?: boolean | null; /** * Enable the "remove" action in COMPOSIO_MANAGE_CONNECTIONS to allow deleting * connected accounts. Default true. */ enable_connection_removal?: boolean | null; /** * When true, the COMPOSIO_WAIT_FOR_CONNECTIONS tool is available for agents to * poll connection status after sharing auth URLs. Default is false (disabled). May * not work reliably with GPT models. */ enable_wait_for_connections?: boolean | null; } interface MultiAccount { /** * When true, enables multi-account mode for this session. When not set, falls back * to org/project-level configuration. */ enable?: boolean; /** * Maximum number of connected accounts allowed per toolkit. Must be between 2 * and 10. */ max_accounts_per_toolkit?: number; /** * When true, the agent must explicitly select which account to use. When false * (default), the first/default account is used automatically. */ require_explicit_selection?: boolean; } /** * Preload configuration. Use an explicit list for frequently used tool slugs, or * "all" to dynamically expose every app tool allowed by positive * toolkits/tools/tags filters. */ interface Preload { /** * Explicit tool slugs to preload, or "all" to dynamically expose all current and * future app tools allowed by the positive session filters. "all" is capped at * 1000 tools and is not supported without a positive allowlist. */ tools?: Array | string; } interface Search { enable?: boolean; } interface UnionMember1 { disable?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>; enable?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>; } /** * Enable only specific toolkits (allowlist) */ interface Enable { /** * Only these specific toolkits will be enabled */ enable: Array; } /** * Disable specific toolkits (denylist) */ interface Disable { /** * These specific toolkits will be disabled */ disable: Array; } interface Enable { /** * Only these specific tools will be available for this toolkit */ enable: Array; } interface Disable { /** * These specific tools will be disabled for this toolkit */ disable: Array; } interface Tags { /** * MCP tags to filter tools. Array format is treated as enabled list. Object format * supports both enabled and disabled lists. */ tags: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'> | Tags.UnionMember1; } namespace Tags { interface UnionMember1 { disable?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>; enable?: Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>; } } interface Workbench { /** * Character threshold for automatic offloading. When workbench response exceeds * this threshold, it will be automatically offloaded. Default is picked * automatically based on the response size. */ auto_offload_threshold?: number; /** * Set to false to disable the workbench entirely. When disabled, no code execution * tools are available in the session. */ enable?: boolean; /** * Whether proxy execution is enabled. When enabled, workbench can call URLs and * APIs directly. */ enable_proxy_execution?: boolean; /** * Sandbox compute tier: standard (1 vCPU / 1 GB), medium (2 vCPU / 2 GB), large (4 * vCPU / 4 GB), xlarge (8 vCPU / 8 GB). Patching this value recreates the sandbox * on next access — sandbox FS state is lost, but /mnt/files/ R2 mount persists. */ sandbox_size?: 'standard' | 'medium' | 'large' | 'xlarge'; } } export interface SessionProxyExecuteParams { /** * The API endpoint to call (absolute URL or path relative to base URL of the * connected account) */ endpoint: string; /** * The HTTP method to use for the request */ method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD'; /** * The slug of the toolkit to use for the request */ toolkit_slug: string; /** * Binary body to send. For binary upload via URL: use {url: "https://...", * content_type?: "..."}. For binary upload via base64: use {base64: "...", * content_type?: "..."}. */ binary_body?: SessionProxyExecuteParams.BinaryBodyUnionMember0 | SessionProxyExecuteParams.BinaryBodyUnionMember1; /** * The request body (for POST, PUT, and PATCH requests) */ body?: unknown; custom_connection_data?: SessionProxyExecuteParams.UnionMember0 | SessionProxyExecuteParams.UnionMember1 | SessionProxyExecuteParams.UnionMember2 | SessionProxyExecuteParams.UnionMember3 | SessionProxyExecuteParams.UnionMember4 | SessionProxyExecuteParams.UnionMember5 | SessionProxyExecuteParams.UnionMember6 | SessionProxyExecuteParams.UnionMember7 | SessionProxyExecuteParams.UnionMember8 | SessionProxyExecuteParams.UnionMember9 | SessionProxyExecuteParams.UnionMember10; /** * Additional HTTP headers or query parameters to include in the request */ parameters?: Array; } export declare namespace SessionProxyExecuteParams { interface BinaryBodyUnionMember0 { /** * URL to fetch binary content from */ url: string; /** * Content-Type header to use for the request */ content_type?: string; } interface BinaryBodyUnionMember1 { /** * Base64-encoded binary data */ base64: string; /** * Content-Type header to use for the request */ content_type?: string; } interface UnionMember0 { authScheme: 'OAUTH2'; toolkitSlug: string; val: UnionMember0.Val; } namespace UnionMember0 { interface Val { access_token: string; account_id?: string; account_url?: string; api_url?: string; /** * for slack user scopes */ authed_user?: Val.AuthedUser; base_url?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; dc?: string; domain?: string; expires_in?: number | string | null; extension?: string; extra_token_data?: { [key: string]: unknown; }; form_api_base_url?: string; id_token?: string; instanceEndpoint?: string; instanceName?: string; /** * Whether to return the redirect url without shortening */ long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; refresh_token?: string | null; region?: string; scope?: string | Array | null; server_location?: string; shop?: string; site_name?: string; /** * The oauth2 state prefix for the connection */ state_prefix?: string; subdomain?: string; token_type?: string; version?: string; webhook_signature?: string; your_server?: string; 'your-domain'?: string; [k: string]: unknown; } namespace Val { /** * for slack user scopes */ interface AuthedUser { access_token?: string; scope?: string; } } } interface UnionMember1 { authScheme: 'DCR_OAUTH'; toolkitSlug: string; val: UnionMember1.Val; } namespace UnionMember1 { interface Val { access_token: string; /** * Dynamically registered client ID */ client_id: string; account_id?: string; account_url?: string; api_url?: string; base_url?: string; borneo_dashboard_url?: string; client_id_issued_at?: number; /** * Dynamically registered client secret */ client_secret?: string; client_secret_expires_at?: number; COMPANYDOMAIN?: string; dc?: string; domain?: string; expires_in?: number | string | null; extension?: string; form_api_base_url?: string; id_token?: string; instanceEndpoint?: string; instanceName?: string; /** * Whether to return the redirect url without shortening */ long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; refresh_token?: string | null; region?: string; scope?: string | Array | null; server_location?: string; shop?: string; site_name?: string; /** * The oauth2 state prefix for the connection */ state_prefix?: string; subdomain?: string; token_type?: string; version?: string; your_server?: string; 'your-domain'?: string; [k: string]: unknown; } } interface UnionMember2 { authScheme: 'API_KEY'; toolkitSlug: string; val: UnionMember2.Val; } namespace UnionMember2 { interface Val { account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; proxy_password?: string; proxy_username?: string; region?: string; server_location?: string; shop?: string; site_name?: string; subdomain?: string; version?: string; your_server?: string; 'your-domain'?: string; [k: string]: unknown; } } interface UnionMember3 { authScheme: 'BASIC_WITH_JWT'; toolkitSlug: string; val: UnionMember3.Val; } namespace UnionMember3 { interface Val { password: string; username: string; account_id?: string; account_url?: string; api_url?: string; base_url?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; instanceEndpoint?: string; instanceName?: string; proxy_password?: string; proxy_username?: string; region?: string; server_location?: string; shop?: string; site_name?: string; subdomain?: string; version?: string; your_server?: string; 'your-domain'?: string; [k: string]: unknown; } } interface UnionMember4 { authScheme: 'BASIC'; toolkitSlug: string; val: UnionMember4.Val; } namespace UnionMember4 { interface Val { username: string; account_id?: string; account_url?: string; api_url?: string; base_url?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; instanceEndpoint?: string; instanceName?: string; password?: string; proxy_password?: string; proxy_username?: string; region?: string; server_location?: string; shop?: string; site_name?: string; subdomain?: string; version?: string; your_server?: string; 'your-domain'?: string; [k: string]: unknown; } } interface UnionMember5 { authScheme: 'BEARER_TOKEN'; toolkitSlug: string; val: UnionMember5.Val; } namespace UnionMember5 { interface Val { token: string; account_id?: string; account_url?: string; api_url?: string; base_url?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; instanceEndpoint?: string; instanceName?: string; proxy_password?: string; proxy_username?: string; region?: string; server_location?: string; shop?: string; site_name?: string; subdomain?: string; version?: string; your_server?: string; 'your-domain'?: string; [k: string]: unknown; } } interface UnionMember6 { authScheme: 'OAUTH1'; toolkitSlug: string; val: UnionMember6.Val; } namespace UnionMember6 { interface Val { oauth_token: string; oauth_token_secret: string; account_id?: string; account_url?: string; api_url?: string; base_url?: string; borneo_dashboard_url?: string; callback_url?: string; COMPANYDOMAIN?: string; consumer_key?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; instanceEndpoint?: string; instanceName?: string; oauth_verifier?: string; proxy_password?: string; proxy_username?: string; redirectUrl?: string; region?: string; server_location?: string; shop?: string; site_name?: string; subdomain?: string; version?: string; your_server?: string; 'your-domain'?: string; [k: string]: unknown; } } interface UnionMember7 { authScheme: 'NO_AUTH'; toolkitSlug: string; val: UnionMember7.Val; } namespace UnionMember7 { interface Val { account_id?: string; account_url?: string; api_url?: string; base_url?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; instanceEndpoint?: string; instanceName?: string; proxy_password?: string; proxy_username?: string; region?: string; server_location?: string; shop?: string; site_name?: string; subdomain?: string; version?: string; your_server?: string; 'your-domain'?: string; [k: string]: unknown; } } interface UnionMember8 { authScheme: 'SERVICE_ACCOUNT'; toolkitSlug: string; val: UnionMember8.Val; } namespace UnionMember8 { interface Val { application_id: string; installation_id: string; private_key: string; account_id?: string; account_url?: string; api_url?: string; base_url?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; instanceEndpoint?: string; instanceName?: string; proxy_password?: string; proxy_username?: string; region?: string; server_location?: string; shop?: string; site_name?: string; subdomain?: string; version?: string; your_server?: string; 'your-domain'?: string; [k: string]: unknown; } } interface UnionMember9 { authScheme: 'GOOGLE_SERVICE_ACCOUNT'; toolkitSlug: string; val: UnionMember9.Val; } namespace UnionMember9 { interface Val { credentials_json: string; account_id?: string; account_url?: string; api_url?: string; base_url?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; instanceEndpoint?: string; instanceName?: string; proxy_password?: string; proxy_username?: string; region?: string; server_location?: string; shop?: string; site_name?: string; subdomain?: string; version?: string; your_server?: string; 'your-domain'?: string; [k: string]: unknown; } } interface UnionMember10 { authScheme: 'S2S_OAUTH2'; toolkitSlug: string; val: UnionMember10.Val; } namespace UnionMember10 { interface Val { access_token: string; account_id?: string; account_url?: string; api_url?: string; base_url?: string; borneo_dashboard_url?: string; client_id?: string; client_secret?: string; COMPANYDOMAIN?: string; dc?: string; domain?: string; expires_at?: string; expires_in?: number | string | null; extension?: string; form_api_base_url?: string; instanceEndpoint?: string; instanceName?: string; proxy_password?: string; proxy_username?: string; region?: string; scope?: string | Array | null; server_location?: string; shop?: string; site_name?: string; subdomain?: string; token_type?: string; version?: string; your_server?: string; 'your-domain'?: string; [k: string]: unknown; } } interface Parameter { /** * Parameter name */ name: string; /** * Parameter type (header or query) */ type: 'header' | 'query'; /** * Parameter value */ value: string; } } export interface SessionSearchParams { /** * List of search queries to execute in parallel. */ queries: Array; /** * Inline custom tools and toolkits for this request. v3.1 sessions do not persist * customs — pass them on every request that needs them. */ experimental?: SessionSearchParams.Experimental; /** * Optional model hint for search/planning behavior (e.g., "gpt-4o"). */ model?: string; } export declare namespace SessionSearchParams { interface Query { /** * The task or use case to search tools for. Provide a detailed description to get * the best results. Max 1024 characters. */ use_case: string; /** * Known field hints as key:value pairs (e.g., "channel_name:general, * user_email:john@example.com"). Max 500 characters. */ known_fields?: string; } /** * Inline custom tools and toolkits for this request. v3.1 sessions do not persist * customs — pass them on every request that needs them. */ interface Experimental { /** * Custom toolkits with grouped tools. Toolkit slugs must not conflict with * existing Composio toolkits. All tools are no-auth. */ custom_toolkits?: Array; /** * Custom tools to include in search. Standalone tools need no auth. Tools with * extends_toolkit inherit the Composio toolkit's connection. */ custom_tools?: Array; } namespace Experimental { interface CustomToolkit { /** * Used for BM25 search matching and shown in toolkit connection statuses. */ description: string; /** * Display name shown to the LLM and in search results. */ name: string; /** * Unique slug for the toolkit. Must not conflict with existing Composio toolkit * slugs. Alphanumeric, underscores, and hyphens only. */ slug: string; /** * Tools in this custom toolkit */ tools: Array; /** * SDK hint for direct custom-tool exposure. Not stored in session config; echoed * in create/attach responses for inline custom definitions. */ preload?: boolean; } namespace CustomToolkit { interface Tool { /** * Used for BM25 search matching and shown to the LLM. */ description: string; /** * Must have type: "object" and a properties field. */ input_schema: { [key: string]: unknown; }; /** * Human-readable display name */ name: string; /** * Tool slug. Combined with toolkit slug to form LOCAL** (max 60 * chars total). */ slug: string; /** * Optional output schema for the tool response. */ output_schema?: { [key: string]: unknown; }; /** * SDK hint for direct custom-tool exposure. Not stored in session config; echoed * in create/attach responses for inline custom definitions. */ preload?: boolean; } } interface CustomTool { /** * Used for BM25 search matching and shown to the LLM. */ description: string; /** * Must have type: "object" and a properties field. */ input_schema: { [key: string]: unknown; }; /** * Human-readable display name */ name: string; /** * Tool slug. Forms LOCAL* (standalone) or LOCAL*\_ * (extending). Max 60 chars total. */ slug: string; /** * If set, must be a valid Composio toolkit slug. The tool inherits that toolkit's * auth/connection status. If omitted, the tool is standalone (no-auth). */ extends_toolkit?: string; /** * JSON Schema describing tool output (optional) */ output_schema?: { [key: string]: unknown; }; /** * SDK hint for direct custom-tool exposure. Not stored in session config; echoed * in create/attach responses for inline custom definitions. */ preload?: boolean; } } } export interface SessionToolkitsParams { /** * Cursor for pagination. The cursor is a base64 encoded string of the page and * limit. The page is the page number and the limit is the number of items per * page. The cursor is used to paginate through the items. The cursor is not * required for the first page. */ cursor?: string; /** * Whether to filter by connected toolkits. If provided, only connected toolkits * will be returned. */ is_connected?: boolean | null; /** * Number of items per page, max allowed is 50 */ limit?: number; /** * Search query to filter toolkits by name, slug, or description */ search?: string; /** * Optional comma-separated list of toolkit slugs to filter by. If provided, only * these toolkits will be returned, overriding the session configuration. */ toolkits?: Array | null; } export interface SessionToolsParams { /** * Cursor for pagination. The cursor is a base64 encoded string of the page and * limit. The page is the page number and the limit is the number of items per * page. The cursor is used to paginate through the items. The cursor is not * required for the first page. */ cursor?: string; /** * Number of items per page, max allowed is 500 */ limit?: number; } export declare namespace Session { export { type SessionCreateResponse as SessionCreateResponse, type SessionRetrieveResponse as SessionRetrieveResponse, type SessionAttachResponse as SessionAttachResponse, type SessionConfigHistoryResponse as SessionConfigHistoryResponse, type SessionExecuteResponse as SessionExecuteResponse, type SessionExecuteMetaResponse as SessionExecuteMetaResponse, type SessionLinkResponse as SessionLinkResponse, type SessionPatchResponse as SessionPatchResponse, type SessionProxyExecuteResponse as SessionProxyExecuteResponse, type SessionSearchResponse as SessionSearchResponse, type SessionToolkitsResponse as SessionToolkitsResponse, type SessionToolsResponse as SessionToolsResponse, type SessionCreateParams as SessionCreateParams, type SessionAttachParams as SessionAttachParams, type SessionConfigHistoryParams as SessionConfigHistoryParams, type SessionExecuteParams as SessionExecuteParams, type SessionExecuteMetaParams as SessionExecuteMetaParams, type SessionLinkParams as SessionLinkParams, type SessionPatchParams as SessionPatchParams, type SessionProxyExecuteParams as SessionProxyExecuteParams, type SessionSearchParams as SessionSearchParams, type SessionToolkitsParams as SessionToolkitsParams, type SessionToolsParams as SessionToolsParams, }; export { Files as Files, type FileListResponse as FileListResponse, type FileDeleteResponse as FileDeleteResponse, type FileCreateDownloadURLResponse as FileCreateDownloadURLResponse, type FileCreateUploadURLResponse as FileCreateUploadURLResponse, type FileListParams as FileListParams, type FileDeleteParams as FileDeleteParams, type FileCreateDownloadURLParams as FileCreateDownloadURLParams, type FileCreateUploadURLParams as FileCreateUploadURLParams, }; } //# sourceMappingURL=session.d.ts.map