Passthrough credentials
Passthrough lets you call tools with third-party credentials your product already holds. You send the end user’s OAuth token or API key in the X-Tool-Auth header on each tool call, and Agent Handler uses it for that one request. Use it when you build your own connect screen instead of Link, or when your product already stores your users’ credentials and you don’t want a second copy in Agent Handler.
Passthrough is turned on per organization. Contact your Merge account team to enable it.
How passthrough differs from Link
Agent Handler never stores a credential sent in X-Tool-Auth. It removes the header before the request is logged, so the credential doesn’t appear in Tool Call Logs.
Once passthrough is on, tools/list stops returning authenticate_* tools for every Tool Pack in your organization, because the reconnect flow belongs to your product.
Get the fields each Connector needs
Each Connector supports one or more auth options, OAuth2 or Secrets, and each option needs its own fields. Fetch them once per Connector with auth_mode=runtime. The list endpoint, GET /api/v1/connectors/?auth_mode=runtime, returns the same shape for every Connector.
Runtime mode returns one entry per auth type. For OAuth2 it adds access_token as the first required field. When a Connector has more than one option of the same type, the entry lists the fields of all of them together, so send every field marked required.
Build the form
To render a form for your end users, call the same endpoint without auth_mode. Each field comes back with a display label, an input type, and the dropdown values for SELECT fields. prefix and suffix show the text around the value, like https:// and .zendesk.com around a subdomain.
The name of each field is the key you send in X-Tool-Auth. For a SELECT field, send the value of one of its options, not the label.
Find the OAuth scopes
For OAuth2 Connectors, you register your own OAuth app with the provider and run the sign-in yourself. To see which scopes to request, fetch the Connector with include_tool_details=true. Each tool lists the scopes it needs.
Request the scopes of every tool in your Tool Pack. A tool whose scope you didn’t request fails when the provider rejects the call.
Build the X-Tool-Auth header
X-Tool-Auth is a JSON object with auth_type set to the option’s type, plus one key per credential field.
Agent Handler checks that every required field is present. It doesn’t check the values, so limit SELECT fields to their options in your UI. A value the provider doesn’t accept fails at the provider.
Call a tool
Send your Access Key in Authorization and the end user’s credential in X-Tool-Auth on the Tool Pack MCP endpoint. The Registered User in the URL is the person the credential belongs to.
Headers apply to every call in an MCP session, so open one session per Registered User, and a new one after you refresh a token.
Errors
A reauth_required result looks like this, with data also carrying a reauth_reason:
When you get one, refresh the token if it expired, or ask the end user to reconnect in your product, then retry the call. The message is the same for a missing field and a rejected credential, so check your header against the Connector’s credential_fields first when you’re building.