> This page is for Agent Handler.

> 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 connectors in a Tool Pack (partial)

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

Partially update a tool pack's connectors. Connectors not listed in the request body are left untouched.

`tool_names` behavior per item:
- Omitted (new connector): all tools are enabled.
- Omitted (existing connector): the connector's tools are left unchanged.
- `[]` (empty list): the connector is removed from the tool pack.
- Otherwise: exactly these tools are enabled.

Returns the updated list of connectors on the tool pack.

Reference: https://docs.merge.dev/merge-agent-handler/agent-handler/tool-packs/bulk-upsert-delete-connectors

## Authentication

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

## Request

### Path parameters

- `tool_pack_id` (string, required)

### Body (application/json)

This endpoint expects a list of ToolPackConnectorBulkInput.

- `list of ToolPackConnectorBulkInput`

## Response

### 200

- `list of ConnectorPublic`

## Types

### ToolPackConnectorBulkInput

One item in a tool pack connector update request.

- `slug` (string, optional) — Connector slug — primary identifier.
- `connector_id` (string, optional) — DEPRECATED — prefer `slug`. Retained for backward compatibility.
- `auth_scope` (enum, optional) — Authentication scope. INDIVIDUAL: each user authenticates separately. SHARED: users in the same registered_company share one credential. Defaults to INDIVIDUAL when creating a new connector.
  - Allowed values: `INDIVIDUAL`, `SHARED`, `ORGANIZATION`
- `tool_names` (list of string, optional) — Tool names to enable on this connector. - Omitted (new connector): all tools are enabled. - Omitted (existing connector, PATCH): the connector's tools are left unchanged. - `[]` (empty list): the connector is removed from the tool pack. - Otherwise: exactly these tools are enabled.

### 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

### Add connector with all tools (application/json)

**Request**

```json
[
  {
    "slug": "github"
  }
]
```

**Response**

```json
[
  {
    "slug": "github",
    "name": "GitHub",
    "source_url": "https://github.com",
    "logo_url": "https://github.com/favicon.ico",
    "categories": [
      "Developer Tools"
    ],
    "auth_scope": "INDIVIDUAL",
    "tools": [
      {
        "name": "create_issue",
        "description": "Create a new issue",
        "credit_type": "default",
        "input_schema": {
          "properties": {
            "title": {
              "type": "string"
            }
          },
          "required": [
            "title"
          ],
          "type": "object"
        }
      },
      {
        "name": "list_issues",
        "description": "List issues",
        "credit_type": "default",
        "input_schema": {
          "properties": {},
          "type": "object"
        }
      }
    ],
    "connector_id": "3c90c3c0-6d46-4b50-8888-8dd25736052f"
  }
]
```

**SDK Code**

```python Add connector with all tools (application/json)
import requests

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

payload = [{ "slug": "github" }]
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Add connector with all tools (application/json)
const url = 'https://ah-api.merge.dev/api/v1/tool-packs/:tool_pack_id/connectors/';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '[{"slug":"github"}]'
};

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

```go Add connector with all tools (application/json)
package main

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

func main() {

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

	payload := strings.NewReader("[\n  {\n    \"slug\": \"github\"\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 Add connector with all tools (application/json)
require 'uri'
require 'net/http'

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

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  {\n    \"slug\": \"github\"\n  }\n]"

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

```java Add connector with all tools (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/:tool_pack_id/connectors/")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("[\n  {\n    \"slug\": \"github\"\n  }\n]")
  .asString();
```

```php Add connector with all tools (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/:tool_pack_id/connectors/', [
  'body' => '[
  {
    "slug": "github"
  }
]',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Add connector with all tools (application/json)
using RestSharp;

var client = new RestClient("https://ah-api.merge.dev/api/v1/tool-packs/:tool_pack_id/connectors/");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "[\n  {\n    \"slug\": \"github\"\n  }\n]", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Add connector with all tools (application/json)
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [["slug": "github"]] 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/:tool_pack_id/connectors/")! 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()
```

### Add connector with specific tools (application/json)

**Request**

```json
[
  {
    "slug": "github",
    "auth_scope": "SHARED",
    "tool_names": [
      "create_issue"
    ]
  }
]
```

**Response**

```json
[
  {
    "slug": "github",
    "name": "GitHub",
    "source_url": "https://github.com",
    "logo_url": "https://github.com/favicon.ico",
    "categories": [
      "Developer Tools"
    ],
    "auth_scope": "INDIVIDUAL",
    "tools": [
      {
        "name": "create_issue",
        "description": "Create a new issue",
        "credit_type": "default",
        "input_schema": {
          "properties": {
            "title": {
              "type": "string"
            }
          },
          "required": [
            "title"
          ],
          "type": "object"
        }
      },
      {
        "name": "list_issues",
        "description": "List issues",
        "credit_type": "default",
        "input_schema": {
          "properties": {},
          "type": "object"
        }
      }
    ],
    "connector_id": "3c90c3c0-6d46-4b50-8888-8dd25736052f"
  }
]
```

**SDK Code**

```python Add connector with specific tools (application/json)
import requests

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

payload = [
    {
        "slug": "github",
        "auth_scope": "SHARED",
        "tool_names": ["create_issue"]
    }
]
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Add connector with specific tools (application/json)
const url = 'https://ah-api.merge.dev/api/v1/tool-packs/:tool_pack_id/connectors/';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '[{"slug":"github","auth_scope":"SHARED","tool_names":["create_issue"]}]'
};

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

```go Add connector with specific tools (application/json)
package main

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

func main() {

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

	payload := strings.NewReader("[\n  {\n    \"slug\": \"github\",\n    \"auth_scope\": \"SHARED\",\n    \"tool_names\": [\n      \"create_issue\"\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 Add connector with specific tools (application/json)
require 'uri'
require 'net/http'

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

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  {\n    \"slug\": \"github\",\n    \"auth_scope\": \"SHARED\",\n    \"tool_names\": [\n      \"create_issue\"\n    ]\n  }\n]"

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

```java Add connector with specific tools (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/:tool_pack_id/connectors/")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("[\n  {\n    \"slug\": \"github\",\n    \"auth_scope\": \"SHARED\",\n    \"tool_names\": [\n      \"create_issue\"\n    ]\n  }\n]")
  .asString();
```

```php Add connector with specific tools (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/:tool_pack_id/connectors/', [
  'body' => '[
  {
    "slug": "github",
    "auth_scope": "SHARED",
    "tool_names": [
      "create_issue"
    ]
  }
]',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Add connector with specific tools (application/json)
using RestSharp;

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

```swift Add connector with specific tools (application/json)
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  [
    "slug": "github",
    "auth_scope": "SHARED",
    "tool_names": ["create_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/:tool_pack_id/connectors/")! 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()
```

### Remove connector (application/json)

**Request**

```json
[
  {
    "slug": "github",
    "tool_names": []
  }
]
```

**Response**

```json
[
  {
    "slug": "github",
    "name": "GitHub",
    "source_url": "https://github.com",
    "logo_url": "https://github.com/favicon.ico",
    "categories": [
      "Developer Tools"
    ],
    "auth_scope": "INDIVIDUAL",
    "tools": [
      {
        "name": "create_issue",
        "description": "Create a new issue",
        "credit_type": "default",
        "input_schema": {
          "properties": {
            "title": {
              "type": "string"
            }
          },
          "required": [
            "title"
          ],
          "type": "object"
        }
      },
      {
        "name": "list_issues",
        "description": "List issues",
        "credit_type": "default",
        "input_schema": {
          "properties": {},
          "type": "object"
        }
      }
    ],
    "connector_id": "3c90c3c0-6d46-4b50-8888-8dd25736052f"
  }
]
```

**SDK Code**

```python Remove connector (application/json)
import requests

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

payload = [
    {
        "slug": "github",
        "tool_names": []
    }
]
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Remove connector (application/json)
const url = 'https://ah-api.merge.dev/api/v1/tool-packs/:tool_pack_id/connectors/';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '[{"slug":"github","tool_names":[]}]'
};

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

```go Remove connector (application/json)
package main

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

func main() {

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

	payload := strings.NewReader("[\n  {\n    \"slug\": \"github\",\n    \"tool_names\": []\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 Remove connector (application/json)
require 'uri'
require 'net/http'

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

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  {\n    \"slug\": \"github\",\n    \"tool_names\": []\n  }\n]"

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

```java Remove connector (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/:tool_pack_id/connectors/")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("[\n  {\n    \"slug\": \"github\",\n    \"tool_names\": []\n  }\n]")
  .asString();
```

```php Remove connector (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/:tool_pack_id/connectors/', [
  'body' => '[
  {
    "slug": "github",
    "tool_names": []
  }
]',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Remove connector (application/json)
using RestSharp;

var client = new RestClient("https://ah-api.merge.dev/api/v1/tool-packs/:tool_pack_id/connectors/");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "[\n  {\n    \"slug\": \"github\",\n    \"tool_names\": []\n  }\n]", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Remove connector (application/json)
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  [
    "slug": "github",
    "tool_names": []
  ]
] 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/:tool_pack_id/connectors/")! 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()
```