> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superglue.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploying a Tool

> Execute tools on-demand, schedule them, or trigger via incoming webhooks

superglue isn't just where you build tools, it's where they run. When you execute a tool, superglue handles the infrastructure: making API calls, resolving credentials server-side, managing retries and rate limiting, and logging every step. You don't need servers, queues, or cron jobs on your side.

Trigger tool runs on-demand, automate them on a schedule, or react to external events via webhooks. All through the same managed runtime.

<CardGroup cols={3}>
  <Card title="REST API & SDK" icon="code" href="/sdk/overview">
    Execute tools programmatically from your codebase using the TypeScript or Python SDK, or call
    the REST API directly.
  </Card>

  <Card title="MCP" icon="robot" href="/mcp/using-the-mcp">
    Give AI agents direct access to execute tools via Model Context Protocol in Cursor, Claude, and
    other MCP clients.
  </Card>

  <Card title="Schedules & Webhooks" icon="clock" href="/enterprise/scheduling">
    Automate execution with cron schedules or trigger runs from external services like Stripe,
    GitHub, or Shopify.
  </Card>
</CardGroup>

<Tabs>
  <Tab title="Via UI">
    Execute tools directly from the tool details page:

    <img src="https://mintcdn.com/superglue/u32I4ezswr71mkrq/resources/run-tool.png?fit=max&auto=format&n=u32I4ezswr71mkrq&q=85&s=60eb50c65c56c7244458135f287ba7bf" alt="Step input" className="w-full rounded-lg mb-4" width="2458" height="690" data-path="resources/run-tool.png" />

    <Steps>
      <Step title="Navigate to your tool">
        Go to Tools in your dashboard and select the tool you want to run
      </Step>

      <Step title="Provide input data">
        Enter any required input parameters in JSON format. If your tool doesn't require input, use `{}`
      </Step>

      <Step title="Execute">
        Click "Run All Steps" to execute immediately. You'll see real-time logs and step-by-step progress
      </Step>

      <Step title="Review results">
        Check the output data and individual step results. All executions are logged for debugging.
      </Step>
    </Steps>
  </Tab>

  <Tab title="Via SDK">
    For programmatic execution, use the REST SDK:

    ```bash theme={null}
    npm install @superglue/client
    ```

    **Run a saved tool:**

    ```typescript theme={null}
    import { configure, runTool, getRun, listRuns } from "@superglue/client";

    // Configure the SDK
    configure({
      baseUrl: "https://api.superglue.cloud", // or your self-hosted URL
      apiKey: "your_api_key"
    });

    // Run a tool with input payload
    const { data: run } = await runTool("sync-customers", {
      inputs: {
        startDate: "2025-01-01",
        userId: "user_123"
      }
    });

    // For synchronous runs, result is available immediately
    if (run.status === "success") {
      console.log(run.data); // Final output
      console.log(run.stepResults); // Step-by-step details
    }
    ```

    **Run asynchronously and poll for results:**

    ```typescript theme={null}
    // Start an async run
    const { data: run } = await runTool("sync-customers", {
      inputs: { startDate: "2025-01-01" },
      options: { async: true }
    });

    // Poll for completion
    let status = run.status;
    while (status === "running") {
      await new Promise(r => setTimeout(r, 1000));
      const { data: updated } = await getRun(run.runId);
      status = updated.status;
      if (status === "success") {
        console.log(updated.data);
      }
    }
    ```

    **List recent runs:**

    ```typescript theme={null}
    const response = await listRuns({
      toolId: "sync-customers",
      limit: 10
    });

    response.data.data.forEach(run => {
      console.log(`${run.runId}: ${run.status}`);
    });
    ```

    **Pass credentials at runtime:**

    ```typescript theme={null}
    const { data: run } = await runTool("sync-customers", {
      inputs: { userId: "user_123" },
      credentials: {
        stripe_api_key: "sk_live_xxx",
        hubspot_access_token: "pat-xxx"
      }
    });
    ```
  </Tab>
</Tabs>

## Enterprise deployment options

superglue Enterprise offers additional deployment capabilities for automated and event-driven execution:

<CardGroup cols={3}>
  <Card title="Scheduled Execution" icon="clock" href="/enterprise/scheduling">
    Automate tool runs with cron-based scheduling. Run tools at specific times or intervals.
  </Card>

  <Card title="Incoming Webhooks" icon="webhook" href="/enterprise/webhooks">
    Trigger tools from external services like Stripe, GitHub, or Shopify via HTTP webhooks.
  </Card>

  <Card title="Tool Chaining" icon="link" href="/enterprise/webhooks#tool-chaining">
    Chain tools together so one tool's output automatically triggers another tool.
  </Card>
</CardGroup>

## Tool chaining

Chain multiple tools together to build multi-step workflows. When one tool completes, it can automatically trigger another tool with its output as input.

```typescript theme={null}
// Run a tool that chains to another tool when complete
const { data: run } = await runTool("fetch-orders", {
  inputs: { since: "2025-01-01" },
  options: {
    async: true,
    webhookUrl: "tool:process-orders", // Triggers process-orders with fetch-orders output
  },
});
```

The chained tool run will have `requestSource: "tool-chain"`. See the [webhooks documentation](/enterprise/webhooks#tool-chaining) for more details.
