Discover Mcp Tools
Discover available tools from an MCP server.
Three callable shapes - see DiscoverMcpToolsRequest docs for full details:
- Saved-id:
{savedConnectionId}-> BE reads the stored row and composes headers server-side; the browser never sees the token.savedConnectionNameis accepted as a deprecated alias for one release cycle. - Inline with masked secret:
{serverUrl, headers: {...: "********"}}-> BE matches the serverUrl against saved settings and substitutes the stored secret for every masked header value. - Inline plaintext:
{serverUrl, headers}- used on first-save “Test” click before the row exists.
URL is validated (SSRF guard) on every path. Per-tenant rate limit:
30 req/min -> 429 with Retry-After. A 300s in-process cache (M10)
keyed by (serverUrl, headers-hash) short-circuits repeat calls;
X-MCP-Cache: hit|miss is emitted on every response. Cache hits
still consume rate-limit budget - the cache is not a bypass.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Request body for POST /agents/mcp/tools.
Two callable shapes:
- Inline - the caller sends
{serverUrl, headers}directly. Used for the "Test" button on a new connection form before the row has been saved. If any header value isMASK_SENTINEL, the BE substitutes the stored secret for that row (matched byserverUrl) server-side so the decrypted value never reaches the browser. - By saved-id - the caller sends
savedConnectionIdand the BE reads the stored row fromagent_connectionsand composes headers viamcp_header_resolver. Used when the tenant triggers a re-discover against an existing saved connection - the browser doesn't need to hold the token at all. For MCP connections (which are keyed bynamein storage), the value sent assavedConnectionIdis the connection's stablename.
savedConnectionName is accepted as a deprecated alias for one
release cycle so an in-flight FE that hasn't shipped the rename yet
keeps working. New callers should send savedConnectionId.
2048If set, BE resolves serverUrl + headers from the tenant's saved connection by id
100Deprecated - prefer savedConnectionId. Accepted for backward compatibility for one release cycle.
100Response
Successful Response
The response is of type Response Discovermcptools · object.