POST/v2/action-gateway/mcp-servers/{server_ref}/resync

Discover an MCP Server's Tools

Connects to the server, lists its tools, and records them. Discovered tools are not callable until you enable them.

When discovery finishes in time, returns 200 with the server and its tools; a discovery failure is reported in syncStatus and syncError rather than as an error. Otherwise returns 202 with pending set while discovery continues: poll GET .../mcp-servers/{server_ref} until lastSyncedAt or syncError changes (syncStatus is not reset while discovery runs).

For a server registered with credentialRefSource connection, user_id is required; if that user has not authorized the server yet, the response carries authorization with the URL to send them to. Resyncs are rate limited per team, and a team can run only a few discoveries at once; either limit returns 429.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 parameter · 1 body field
server_refstringrequired
Server identifier (`serverRef`) of one of your team's MCP servers.
user_idstringoptional
Required for a server registered with `credentialRefSource` connection: discovery reaches the server as this user, through their connection, because such a server has no team-wide credential. Ignored otherwise.

8 status codes
200Discovery finished.
mcpServerobjectoptional
The server, including `syncStatus` and `syncError`.
toolsarray<object>optional
Every tool discovered on the server when discovery finished in time; empty when pending is true.
pendingbooleanoptional
True when discovery is still running (HTTP 202). Poll the server to see the outcome.
authorizationobjectoptional
Set when discovery could not run because `user_id` has no authorized connection to this server yet. It carries the remedy — send the user to `connect_url` — so the caller acts on this response rather than parsing the server's `syncError`.
202Discovery is still running. Poll the MCP server for its `syncStatus`.
mcpServerobjectoptional
The server, including `syncStatus` and `syncError`.
toolsarray<object>optional
Every tool discovered on the server when discovery finished in time; empty when pending is true.
pendingbooleanoptional
True when discovery is still running (HTTP 202). Poll the server to see the outcome.
authorizationobjectoptional
Set when discovery could not run because `user_id` has no authorized connection to this server yet. It carries the remedy — send the user to `connect_url` — so the caller acts on this response rather than parsing the server's `syncError`.
400There was an error parsing the request body.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
401Authentication failed due to invalid credentials.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404The resource was not found.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429The API rate limit has been exceeded.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500There was a server error.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
defaultThere was an unexpected error.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.

Error handling

A 400 is returned: There was an error parsing the request body. A 401 is returned: Authentication failed due to invalid credentials. A 404 is returned: The resource was not found. A 429 is returned: The API rate limit has been exceeded. A 500 is returned: There was a server error. Any other status is an error: There was an unexpected error.