> This page is for Workforce.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.merge.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.merge.dev/_mcp/server.

# Update Tool Pack

PATCH https://ah-api.merge.dev/api/v1/tool-packs/{id}/
Content-Type: application/json

Updates a Tool Pack by ID

Reference: https://docs.merge.dev/merge-workforce/agent-handler/tool-packs/tool-packs-partial-update

## Authentication

- `Authorization` header (bearer token, required) — Token-based authentication with required prefix "Bearer"

## Request

### Path parameters

- `id` (string, required) — Agent Handler ID of the Tool Pack

### Body (application/json)

This endpoint expects a PatchedToolPackPublicWrite.

- `name` (string, optional)
- `description` (string, optional)
- `connectors` (list of ToolPackConnectorInput, optional) — Full-replace list of connectors. Any connector not in this array is detached from the tool pack. For incremental add/remove, use the `/tool-packs/{id}/connectors/` sub-resource endpoints.

## Response

### 200

- `id` (string, required) — ID of the Tool Pack
- `name` (string, required) — Name of the Tool Pack
- `description` (string, required) — Description of the Tool Pack
- `connectors` (list of ConnectorPublic, required) — Connectors enabled with the Tool Pack

## Types

### ToolPackConnectorInput

Shared validation for connector identifier inputs. At least one identifier must be provided. When both are set, `slug` wins and the deprecated `connector_id` is discarded.

- `slug` (string, optional) — Connector slug — primary identifier.
- `connector_id` (string, optional) — DEPRECATED — prefer `slug`. Retained for backward compatibility.
- `auth_scope` (enum, optional, default: INDIVIDUAL) — How credentials are shared for this connector. - `INDIVIDUAL`: each registered user authenticates with their own credential - `SHARED`: users in the same registered_company share one credential - `ORGANIZATION`: one credential is used for the whole organization
  - Allowed values: `INDIVIDUAL`, `SHARED`, `ORGANIZATION`
- `tool_names` (list of string, optional) — Tool names to enable for this connector. Omit to enable all tools.

### ConnectorPublic

Public tool-pack-scoped connector shape. Used across public endpoints that return a connector attached to a tool pack: both the nested `connectors[]` in `GET /api/v1/tool-packs/{id}/` and the items in `/api/v1/tool-packs/{id}/connectors/` (GET/PATCH/PUT). See the "Consolidating connector response" tech-debt spec (column E).

- `slug` (string, required)
- `name` (string, required)
- `source_url` (string, required, nullable)
- `logo_url` (string, required)
- `categories` (list of any, required)
- `auth_scope` (enum, required) — How credentials are shared for this connector. - `INDIVIDUAL`: each registered user authenticates with their own credential - `SHARED`: users in the same registered_company share one credential - `ORGANIZATION`: one credential is used for the whole organization
  - Allowed values: `INDIVIDUAL`, `SHARED`, `ORGANIZATION`
- `tools` (list of ConnectorTool, required)
- `connector_id` (string, required) — DEPRECATED — alias for the connector UUID. Prefer `slug` as the primary identifier. Retained for backward compatibility.

### ConnectorTool

Full version of ConnectorTool serializer with schemas and annotations.

- `name` (string, required) — Name of the tool
- `description` (string, required, nullable) — Description of what the tool does
- `credit_type` (string, required) — Credit type consumed by the tool
- `input_schema` (map from string to any, optional) — JSON Schema describing the tool's input parameters. Only returned when include_tool_details=true.
- `output_schema` (map from string to any, optional, nullable) — JSON Schema describing the tool's output. Omitted when the tool does not declare one. Only returned when include_tool_details=true.
- `annotations` (map from string to boolean, optional, nullable) — MCP annotation hints (e.g. read_only, destructive). Only returned when include_tool_details=true.
- `scopes` (list of string, optional, default: []) — Third-party API scopes required by the tool. Only returned when include_tool_details=true.
- `endpoints` (list of string, optional, default: []) — Third-party API endpoints the tool calls. Only returned when include_tool_details=true.

## Examples

**Request**

```json
{
  "name": "Updated Tool Pack Name",
  "description": "Updated description",
  "connectors": [
    {
      "slug": "linear",
      "auth_scope": "INDIVIDUAL",
      "tool_names": [
        "create_issue",
        "update_issue"
      ]
    }
  ]
}
```

**SDK Code**

```python Request Example (application/json)
import requests

url = "https://ah-api.merge.dev/api/v1/tool-packs/:id/"

payload = {
    "name": "Updated Tool Pack Name",
    "description": "Updated description",
    "connectors": [
        {
            "slug": "linear",
            "auth_scope": "INDIVIDUAL",
            "tool_names": ["create_issue", "update_issue"]
        }
    ]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript Request Example (application/json)
const url = 'https://ah-api.merge.dev/api/v1/tool-packs/:id/';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"Updated Tool Pack Name","description":"Updated description","connectors":[{"slug":"linear","auth_scope":"INDIVIDUAL","tool_names":["create_issue","update_issue"]}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Request Example (application/json)
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://ah-api.merge.dev/api/v1/tool-packs/:id/"

	payload := strings.NewReader("{\n  \"name\": \"Updated Tool Pack Name\",\n  \"description\": \"Updated description\",\n  \"connectors\": [\n    {\n      \"slug\": \"linear\",\n      \"auth_scope\": \"INDIVIDUAL\",\n      \"tool_names\": [\n        \"create_issue\",\n        \"update_issue\"\n      ]\n    }\n  ]\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Request Example (application/json)
require 'uri'
require 'net/http'

url = URI("https://ah-api.merge.dev/api/v1/tool-packs/:id/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Updated Tool Pack Name\",\n  \"description\": \"Updated description\",\n  \"connectors\": [\n    {\n      \"slug\": \"linear\",\n      \"auth_scope\": \"INDIVIDUAL\",\n      \"tool_names\": [\n        \"create_issue\",\n        \"update_issue\"\n      ]\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Request Example (application/json)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://ah-api.merge.dev/api/v1/tool-packs/:id/")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Updated Tool Pack Name\",\n  \"description\": \"Updated description\",\n  \"connectors\": [\n    {\n      \"slug\": \"linear\",\n      \"auth_scope\": \"INDIVIDUAL\",\n      \"tool_names\": [\n        \"create_issue\",\n        \"update_issue\"\n      ]\n    }\n  ]\n}")
  .asString();
```

```php Request Example (application/json)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://ah-api.merge.dev/api/v1/tool-packs/:id/', [
  'body' => '{
  "name": "Updated Tool Pack Name",
  "description": "Updated description",
  "connectors": [
    {
      "slug": "linear",
      "auth_scope": "INDIVIDUAL",
      "tool_names": [
        "create_issue",
        "update_issue"
      ]
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Request Example (application/json)
using RestSharp;

var client = new RestClient("https://ah-api.merge.dev/api/v1/tool-packs/:id/");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Updated Tool Pack Name\",\n  \"description\": \"Updated description\",\n  \"connectors\": [\n    {\n      \"slug\": \"linear\",\n      \"auth_scope\": \"INDIVIDUAL\",\n      \"tool_names\": [\n        \"create_issue\",\n        \"update_issue\"\n      ]\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Request Example (application/json)
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Updated Tool Pack Name",
  "description": "Updated description",
  "connectors": [
    [
      "slug": "linear",
      "auth_scope": "INDIVIDUAL",
      "tool_names": ["create_issue", "update_issue"]
    ]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://ah-api.merge.dev/api/v1/tool-packs/:id/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```