Skip to main content
POST
/
v1
/
toolkits
/
{toolkit_id}
/
tools
/
{tool_id}
Invoke Toolkit Tool
curl --request POST \
  --url https://api.xpander.ai/v1/toolkits/{toolkit_id}/tools/{tool_id} \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "parameters": {
    "query_params": {},
    "path_params": {},
    "body_params": {
      "subject": "Weekly Report",
      "body_html": "<h1>Report</h1><p>Summary</p>",
      "to": [
        "user@example.com"
      ]
    }
  }
}
'
{
  "result": "Email sent successfully",
  "status": "ok"
}
Execute a specific tool within a toolkit with provided parameters. This allows direct tool invocation outside of agent execution.

Path Parameters

toolkit_id
string
required
Unique identifier of the toolkit (UUID format)
tool_id
string
required
Identifier of the specific tool to invoke (the tool’s name field)

Request Body

parameters
object
required
Tool-specific parameters matching the tool’s schema from Get Toolkit Tools

Response

result
object
The tool execution result (format varies by tool)
status
string
Execution status: success or error
execution_time
number
Tool execution time in seconds
error
string
Error message if status is error (nullable)

Example Request

curl -X POST -H "x-api-key: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "parameters": {
      "channel": "#announcements",
      "message": "Deployment completed successfully"
    }
  }' \
  https://api.xpander.ai/v1/toolkits/<toolkit-id>/tools/send_message

Example Response (Success)

{
  "result": {
    "message_ts": "1234567890.123456",
    "channel": "C1234567890",
    "text": "Deployment completed successfully"
  },
  "status": "success",
  "execution_time": 0.87
}

Example Response (Error)

{
  "result": null,
  "status": "error",
  "execution_time": 0.23,
  "error": "Channel not found: #invalid-channel"
}

Notes

  • This endpoint requires custom toolkits to be configured
  • Tool parameters must match the schema from Get Toolkit Tools
  • All required parameters must be provided
  • Built-in tools are invoked automatically by agents and don’t require this endpoint
  • Custom toolkits must be configured through the web dashboard
  • Execution time includes network latency and tool processing
  • Returns 404 if the toolkit or tool is not found
  • Returns 400 if required parameters are missing

Authorizations

x-api-key
string
header
required

API Key for authentication

Path Parameters

toolkit_id
string
required
tool_id
string
required

Body

application/json
body_params
Body Params · object
query_params
Query Params · object
path_params
Path Params · object
headers
Headers · object

Response

Successful Response