Create or update a native custom-agent MCP connection
Creates or updates an agent-scoped MCP connection for a native custom agent. Credentials are stored separately per agent even when multiple agents use the same MCP server URL.
/agents/{id}/native/mcp-connectionsAuthorizationOAuth2 access token · headerrequiredapi:writeAuthorizationBearer token (JWT) · headerrequiredidstringrequiredfieldsToReturnstringComma-separated list of top-level response fields to return. Overrides the endpoint compact default unless responseShape=full is used.
responseShapestringAdvanced override. Omit for the endpoint compact default. Use full only when you need the complete endpoint response, including nested fields that are not selectable with fieldsToReturn.
compactfullLT-Response-ShapestringAdvanced override. Set to full only when you need the complete endpoint response, including nested fields that are not selectable with fieldsToReturn.
fullapplication/jsonauthModestringAuth mode: none, bearer, or oauth.
bearerTokenobjectBearer token for bearer auth. Write-only.
idobjectExisting MCP connection id to update.
namestringMCP server name.
oauthClientIdobjectOAuth client id for advanced OAuth setup.
oauthClientSecretobjectOAuth client secret for advanced OAuth setup. Write-only.
urlstringMCP server URL.
Unauthorized - Invalid or missing authentication token
Forbidden - Insufficient API scopes or permissions