Tool Router

Execute a tool within a tool router session

Changed on

Execute a tool (meta or app) within an existing tool router session.

post/api/v3.1/tool_router/session/{session_id}/execute

Request

  • Base URL
    https://backend.composio.dev
  • URL
    https://backend.composio.dev/api/v3.1/tool_router/session/{session_id}/execute
  • Auth
    API key in header x-api-key

Path parameters

session_idstring toolRouterSessionId

The unique identifier of the tool router session. Required for public API endpoints, optional for internal endpoints where it is injected by middleware.

Example:trs_LX9uJKBinWWr

Tool router session ID (required for public API, optional for internal - injected by middleware)

Request body

tool_slugstring required

The unique slug identifier of the tool to execute. Supports both meta tools and app tools exposed by the session.

argumentsobject

The arguments required by the tool

accountstring

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.

enable_auto_workbench_offloadboolean

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.

input_responsesobject

The user's answers to an input_required response, keyed by the ids in its input_requests. Send them by repeating the same call (same tool and arguments) with this field added, along with the response's request_state if present. An approved call runs; a denied or declined one returns failed.

request_statestring

The request_state from the input_required response, sent back unchanged with input_responses.

Example request

{
  "tool_slug": "GITHUB_CREATE_AN_ISSUE",
  "arguments": {
    "repository": "octocat/Hello-World",
    "workflow_id": "main.yml",
    "ref": "main",
    "inputs": {
      "environment": "production"
    }
  },
  "account": "coup_hurricane_dal_analytical",
  "enable_auto_workbench_offload": true,
  "input_responses": {
    "elicit_3f9a1c2b7d4e5f60": {
      "action": "accept",
      "content": {
        "decision": "approve"
      }
    }
  },
  "experimental": {
    "custom_toolkits": [
      {
        "slug": "ecommerce",
        "name": "E-Commerce API",
        "description": "Internal e-commerce API for order management and fulfillment",
        "tools": [
          {
            "slug": "GET_CUSTOMER_ORDERS",
            "name": "Get Customer Orders",
            "description": "Fetch recent orders for a customer by their email address",
            "input_schema": {
              "type": "object",
              "properties": {
                "email": {
                  "type": "string",
                  "description": "Customer email"
                }
              },
              "required": [
                "email"
              ]
            }
          }
        ]
      }
    ],
    "custom_tools": [
      {
        "slug": "GET_IMPORTANT_EMAILS",
        "name": "Get Important Emails",
        "description": "Fetch emails marked as important from the last 24 hours",
        "input_schema": {
          "type": "object",
          "properties": {
            "limit": {
              "type": "number",
              "description": "Max results to return"
            }
          }
        },
        "extends_toolkit": "gmail"
      }
    ]
  }
}

Response

The tool call completed, failed, or needs the user's input before it can run. The result_type field says which of these happened.

OR
OR
OR

Example response

{
  "data": {
    "message": "Hello, World!",
    "status": "success"
  },
  "log_id": "log_abc123xyz"
}

Changes

    • info

      the endpoint scheme security workbench_access_key was removed from the API

    • breaking

      added to the response body oneOf list for the response status

    • info

      added blocked mapping keys to the response discriminator for the response status

    • info

      added the optional property //// to the response with the status

    • info

      added the optional property //// to the response with the status