@@ -29,7 +29,8 @@ def fetch_access_token(client_id: str, client_secret: str, token_url: str) -> st
2929 response = requests .post (
3030 token_url ,
3131 data = f"grant_type=client_credentials&client_id={ client_id } &client_secret={ client_secret } " ,
32- headers = {'Content-Type' : 'application/x-www-form-urlencoded' }
32+ headers = {'Content-Type' : 'application/x-www-form-urlencoded' },
33+ timeout = 30
3334 )
3435
3536 if response .status_code != 200 :
@@ -52,7 +53,7 @@ def list_tools(gateway_url: str, access_token: str) -> dict:
5253 "method" : "tools/list"
5354 }
5455
55- response = requests .post (gateway_url , headers = headers , json = payload )
56+ response = requests .post (gateway_url , headers = headers , json = payload , timeout = 30 )
5657
5758 if response .status_code != 200 :
5859 print_msg (f"Gateway request failed: { response .status_code } - { response .text } " , "error" )
@@ -78,7 +79,7 @@ def call_tool(gateway_url: str, access_token: str, tool_name: str, arguments: di
7879 }
7980 }
8081
81- response = requests .post (gateway_url , headers = headers , json = payload )
82+ response = requests .post (gateway_url , headers = headers , json = payload , timeout = 30 )
8283
8384 if response .status_code != 200 :
8485 print_msg (f"Gateway request failed: { response .status_code } - { response .text } " , "error" )
0 commit comments