---
title: "Update a tool"
method: PUT
path: "/tools/{toolId}"
tags: ["Tools"]
---

# Update a tool

`PUT /tools/{toolId}`

## Request

- Base URL: `https://api.superglue.cloud/v1`
- URL: `https://api.superglue.cloud/v1/tools/{toolId}`
- Auth: HTTP bearer

## Path parameters

- `toolId` string, required

## Request body

- UpdateToolRequest: Request body for updating an existing tool. All fields are optional — only provided fields are updated.
  - `name` string: Human-readable name for the tool
  - `steps` ToolStep[]: Ordered execution steps (replaces all existing steps)
    - `id` string, required: Unique identifier for this step
    - `config` union, required
      - RequestStepConfig: Configuration for a request step. Protocol is detected from URL scheme: - HTTP/HTTPS: Standard REST API calls with query params, headers, body - Postgres: postgres:// or postgresql:// URLs, body contains SQL query - FTP/SFTP: ftp://, ftps://, or sftp:// URLs, body contains operation details
        - `type` 'request': Optional type discriminator (defaults to request)
        - `url` string, required: Full URL including protocol. Examples: - HTTP: https://api.example.com/search - Postgres: postgres://user:pass@host:5432/database - FTP: ftp://user:pass@host:21/path - SFTP: sftp://user:pass@host:22/path
        - `method` 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS': HTTP method. Defaults to GET. For non-HTTP protocols, use POST.
        - `queryParams` object: URL query parameters (HTTP only). Supports template expressions with <<(sourceData) => ...>> syntax.
        - `headers` object: HTTP headers (HTTP only). Supports template expressions with <<(sourceData) => ...>> syntax.
        - `body` string: Request body (protocol-specific). Supports template expressions with <<(sourceData) => ...>> syntax. HTTP: Any content (JSON, XML, form data, etc.) Example: '{"query": "<<(sourceData) => sourceData.query>>"}' Postgres: JSON with query and optional params Example: '{"query": "SELECT * FROM users WHERE id = $1", "params": ["<<(sourceData) => sourceData.userId>>"]}' FTP/SFTP: JSON with operation, path, and optional content Example: '{"operation": "get", "path": "/data/file.csv"}' Example: '{"operation": "list", "path": "/data"}' Example: '{"operation": "put", "path": "/data/file.txt", "content": "<<(sourceData) => sourceData.fileContent>>"}'
        - `pagination` Pagination: Pagination configuration (HTTP/HTTPS only, not applicable to Postgres/FTP)
          - `type` 'offsetBased' | 'pageBased' | 'cursorBased' | 'disabled', required
          - `pageSize` string: Number of items per page. Becomes available as <<(sourceData) => sourceData.limit>> in request templates.
          - `cursorPath` string: JSONPath to extract next page cursor from response body (e.g. "meta.next_cursor" for {meta:{next_cursor:"abc"}})
          - `stopCondition` string: JavaScript function to determine when to stop pagination. Format: (response, pageInfo, sourceData) => boolean - response: Object with {data: ..., headers: ...} - access response body via response.data - pageInfo: Object with {page: number, offset: number, cursor: any, totalFetched: number, mergedResult: any} - pageInfo.totalFetched counts the merged paginated result including the current page - pageInfo.mergedResult contains the accumulated paginated result including the current page - sourceData: Current step input data with payload fields at the root plus previous step results - Return true to STOP pagination, false to continue
        - `systemId` string: Connection namespace used to resolve credentials
        - `captureHttpResponse` boolean: HTTP only. When true, the step envelope and step result include `http` with the response status code and lowercase headers. Defaults to false.
      - TransformStepConfig: Configuration for a transform step. Transform steps execute JavaScript code to reshape data between request steps without making external API calls.
        - `type` 'transform', required: Type discriminator for transform steps
        - `transformCode` string, required: JavaScript function that transforms sourceData. Format: (sourceData) => transformedData The function receives all previous step results and payload data.
    - `instruction` string: Human-readable instruction describing what this step does
    - `modify` boolean: Whether this step modifies data on the system it operates on
    - `dataSelector` string: JavaScript function to select data for loop execution. Format: (sourceData) => expression
    - `failureBehavior` 'fail' | 'continue': How to handle step failures (fail stops execution, continue proceeds to next step)
    - `outputFile` boolean: Promote files produced by this step as downloadable run artifacts.
  - `instruction` string: Human-readable instruction describing what the tool does
  - `inputSchema` object: JSON Schema for tool inputs
  - `outputSchema` object: JSON Schema for tool outputs
  - `outputTransform` string: JavaScript function for final output transformation. Format: (sourceData) => expression
  - `folder` string: Folder path for organizing tools
  - `archived` boolean: Set to true to archive the tool (prevents execution and hides from default listing)

## Response `200`

Tool updated successfully

- Tool: A saved integration tool containing request and transformation steps.
  - `id` string, required
  - `name` string
  - `version` string: Semantic version string (major.minor.patch)
  - `instruction` string: Human-readable instruction describing what the tool does
  - `inputSchema` object: JSON Schema for tool inputs
  - `outputSchema` object: JSON Schema for tool outputs (after transformations applied)
  - `steps` ToolStep[], required: Ordered execution steps. May be empty when `outputTransform` is present.
    - `id` string, required: Unique identifier for this step
    - `config` union, required
      - RequestStepConfig: Configuration for a request step. Protocol is detected from URL scheme: - HTTP/HTTPS: Standard REST API calls with query params, headers, body - Postgres: postgres:// or postgresql:// URLs, body contains SQL query - FTP/SFTP: ftp://, ftps://, or sftp:// URLs, body contains operation details
        - `type` 'request': Optional type discriminator (defaults to request)
        - `url` string, required: Full URL including protocol. Examples: - HTTP: https://api.example.com/search - Postgres: postgres://user:pass@host:5432/database - FTP: ftp://user:pass@host:21/path - SFTP: sftp://user:pass@host:22/path
        - `method` 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS': HTTP method. Defaults to GET. For non-HTTP protocols, use POST.
        - `queryParams` object: URL query parameters (HTTP only). Supports template expressions with <<(sourceData) => ...>> syntax.
        - `headers` object: HTTP headers (HTTP only). Supports template expressions with <<(sourceData) => ...>> syntax.
        - `body` string: Request body (protocol-specific). Supports template expressions with <<(sourceData) => ...>> syntax. HTTP: Any content (JSON, XML, form data, etc.) Example: '{"query": "<<(sourceData) => sourceData.query>>"}' Postgres: JSON with query and optional params Example: '{"query": "SELECT * FROM users WHERE id = $1", "params": ["<<(sourceData) => sourceData.userId>>"]}' FTP/SFTP: JSON with operation, path, and optional content Example: '{"operation": "get", "path": "/data/file.csv"}' Example: '{"operation": "list", "path": "/data"}' Example: '{"operation": "put", "path": "/data/file.txt", "content": "<<(sourceData) => sourceData.fileContent>>"}'
        - `pagination` Pagination: Pagination configuration (HTTP/HTTPS only, not applicable to Postgres/FTP)
          - `type` 'offsetBased' | 'pageBased' | 'cursorBased' | 'disabled', required
          - `pageSize` string: Number of items per page. Becomes available as <<(sourceData) => sourceData.limit>> in request templates.
          - `cursorPath` string: JSONPath to extract next page cursor from response body (e.g. "meta.next_cursor" for {meta:{next_cursor:"abc"}})
          - `stopCondition` string: JavaScript function to determine when to stop pagination. Format: (response, pageInfo, sourceData) => boolean - response: Object with {data: ..., headers: ...} - access response body via response.data - pageInfo: Object with {page: number, offset: number, cursor: any, totalFetched: number, mergedResult: any} - pageInfo.totalFetched counts the merged paginated result including the current page - pageInfo.mergedResult contains the accumulated paginated result including the current page - sourceData: Current step input data with payload fields at the root plus previous step results - Return true to STOP pagination, false to continue
        - `systemId` string: Connection namespace used to resolve credentials
        - `captureHttpResponse` boolean: HTTP only. When true, the step envelope and step result include `http` with the response status code and lowercase headers. Defaults to false.
      - TransformStepConfig: Configuration for a transform step. Transform steps execute JavaScript code to reshape data between request steps without making external API calls.
        - `type` 'transform', required: Type discriminator for transform steps
        - `transformCode` string, required: JavaScript function that transforms sourceData. Format: (sourceData) => transformedData The function receives all previous step results and payload data.
    - `instruction` string: Human-readable instruction describing what this step does
    - `modify` boolean: Whether this step modifies data on the system it operates on
    - `dataSelector` string: JavaScript function to select data for loop execution. Format: (sourceData) => expression
    - `failureBehavior` 'fail' | 'continue': How to handle step failures (fail stops execution, continue proceeds to next step)
    - `outputFile` boolean: Promote files produced by this step as downloadable run artifacts.
  - `outputTransform` string: JavaScript function for final output transformation. Format: (sourceData) => expression
  - `folder` string: Folder path for organizing tools
  - `archived` boolean: Whether this tool is archived (if so, it will not be listed in the UI and cannot be run)
  - `createdByUserId` string: ID of the user who created the tool.
  - `createdAt` string, date-time
  - `updatedAt` string, date-time
  - `lastUsedAt` string, date-time

## Other responses

- `400`: Validation error. The update would result in an invalid tool configuration (e.g., removing all steps without providing an outputTransform).
- `403`: Not authorized to edit this tool
- `404`: Tool not found

---

[API](https://skmtc.dev/superglue/apis/superglue-api.md) - [All operations](https://skmtc.dev/superglue/apis/superglue-api/llms.txt) - [OpenAPI document](https://skmtc.dev/superglue/apis/superglue-api/revisions/2d412a94bf09?raw)
