Create tools to connect your systems and do things
Tools in superglue are reusable workflows that you can execute on-demand, schedule, or trigger via webhooks. Each tool consists of sequential steps with built-in data transformations, loops, and error handling.Learn more about how tools fit into the bigger picture in our core concepts page.
Via Agent
Via UI
Via SDK
The fastest way to create a tool is by talking to our agent. Describe what you want to accomplish and the agent will build the tool for you.Simple example:
Copy
Ask AI
"Create a tool that fetches all active customers from Stripe"
superglue will:
Identify which system to use (or create one if needed)
Find the relevant API endpoint from the documentation
Configure the API call with appropriate parameters
Test it and make it available for execution
Complex example:
Copy
Ask AI
"Create a tool that loops through all contacts in HubSpot,filters those with email domains matching @company.com,and updates their lifecycle stage to 'customer'"
Go to Tools in your superglue dashboard and click “Create Tool”
2
Select systems
Choose which systems this tool will use
3
Add instruction
Describe what the tool should do in natural language. superglue will build the workflow steps automatically.
4
Test and save
Run the tool with sample data to verify it works as expected. See debugging tools for troubleshooting.
Use the REST SDK to run tools you’ve already created:
Copy
Ask AI
npm install @superglue/client
Configure and run a tool:
Copy
Ask AI
import { configure, runTool, getTool, listTools } from "@superglue/client";// Configure the SDK with your API endpoint and tokenconfigure({ baseUrl: "https://api.superglue.cloud", // or your self-hosted URL token: "your_api_token"});// List available toolsconst { data: tools } = await listTools();console.log(tools);// Get a specific toolconst { data: tool } = await getTool("my-tool-id");// Run a tool with input payloadconst { data: run } = await runTool("my-tool-id", { inputs: { userId: "user_123", startDate: "2024-01-01" }, credentials: { stripe_api_key: "sk_live_xxx" }});console.log(run.data); // Tool execution result
The REST SDK is for executing existing tools. To build new tools, use the agent interface or the UI. See the SDK documentation for more details.
{ id: "stepId", // Unique identifier for this step instruction: "Fetch customer data from Stripe", // Human-readable description dataSelector: "(sourceData) => { return [\"one\", \"two\"]}", // The data selector for the current step config: { systemId: "stripe", // Which system to use method: "POST", // HTTP method url: "https://api.stripe.com/v1/customers", // Full API endpoint URL queryParams: {}, // URL query parameters headers: { "Authorization": "Bearer <<stripe_apiKey>>" }, // Custom headers body: "" // Request body }}
JavaScript expressions must use the arrow function syntax (sourceData) => .... Direct property access like <<userId>> works for simple variables, but not for nested properties or transformations.
Whether a step loops through more than one request is determined by the data selector. If the data selector returns an Array, the request will execute once for each item in that array. The item of the current iteration is available in the config as <<currentItem>> or accessible in code via sourceData.currentItem.
{ id: "queryDatabase", config: { systemId: "postgres_db", url: "postgres://<<postgres_db_username>>:<<postgres_db_password>>@<<postgres_db_hostname>>:5432/<<postgres_db_database>>", body: { query: "SELECT * FROM users WHERE status = $1 AND created_at > $2", params: ["active", "<<(sourceData) => sourceData.startDate>>"] } }}
Always use parameterized queries with $1, $2, etc. placeholders to prevent SQL injection. Provide values in the params array, which can include static values or <<>> expressions.
Failed steps can be automatically retried with exponential backoff
Validation
Response data is validated against response schemas if specified
Graceful degradation
Handle missing data with optional chaining and defaults in transformations
Keep steps focused - Each step should make a single API call. Use transformations to prepare data, not as additional steps.Use descriptive IDs - Step IDs are used to reference data in later steps. Use clear names like getCustomers, updateOrder, sendEmail.Avoid unnecessary loops - Don’t loop over thousands of items if the API supports batch operations. Check the documentation first.Test with real data - Test each step incrementally with production-like data before deploying.