arcade-mcp/examples/bareclient/get_gmail_emails.py
Nate Barbettini 9d00295e33
Replace arcade.client with arcadepy (#119)
Closes: https://app.clickup.com/t/86b2k2962

---------

Co-authored-by: sdreyer <sterling@arcade-ai.com>
2024-10-23 15:29:02 -07:00

26 lines
587 B
Python

from arcadepy import Arcade
client = Arcade(
base_url="http://localhost:9099",
)
user_id = "you@example.com"
# Start the authorization process
auth_response = client.tools.authorize(
tool_name="Google.ListEmails",
user_id=user_id,
)
if auth_response.status != "completed":
print(f"Click this link to authorize: {auth_response.authorization_url}")
input("After you have authorized, press Enter to continue...")
inputs = {"n_emails": 5}
response = client.tools.execute(
tool_name="Google.ListEmails",
inputs=inputs,
user_id=user_id,
)
print(response)