Tools: Cal.com getting upcoming bookings not working

Cal.com tool is unable to retrieve upcoming bookings for attendees. The tools get_upcoming_bookings is being called but an error is thrown. All other functionalities like creating a booking, cancelling a bookings and getting available slots are working.

This is the error message: PermissionsGuard - no oAuth client found for access token=…

I can successfully run the upcoming bookings api from another application, like Postman.

Any idea what might be wrong.

Hey @edisonpearce
Thank you for reaching out and using Agno.
Can you pls help me with your agent configuration?

Hi Monali

I am not too sure if this is what you need for the agent config.

Running Agno V1.3.4

Here is the agent code:
booking_agent = Agent(
#model=Gemini(id=“gemini-2.0-flash-exp”),
model=OpenAIChat(id=“gpt-4o-mini”),
show_tool_calls=True,
markdown=True,
instructions=[
f"You can also assist with scheduling bookings or appointments. Today is {datetime.now()}.“,
“You can help users by:”,
" - Finding available time slots”,
" - Creating new bookings",
" - Managing existing bookings (view, reschedule, cancel)“,
" - Getting booking details”,
" - IMPORTANT: In case of rescheduling or cancelling booking, call the get_upcoming_bookings function to get the booking uid. check available slots before making a booking for given time",
“Always confirm important details before making bookings or changes.”,
],
tools=[CalComTools(user_timezone=“America/New_York”)],
storage=SqliteAgentStorage(table_name=“agent_sessions”, db_file=“tmp/agent_storage.db”),
add_history_to_messages=True,
num_history_responses=5,
debug_mode=True,
)

booking_agent.print_response(“What are my upcoming bookings?”)
booking_agent.cli_app(stream=True)

The response I am getting:
" It seems that I am unable to fetch your upcoming bookings due to a permissions issue. Unfortunately, I can’t access your bookings directly at this ┃
moment.

You might want to check your booking account directly or provide an alternate email address if you have one associated with different bookings. ┃
Let me know how you’d like to proceed! "

The debug error:
“DEBUG Failed to fetch bookings:
{“status”:“error”,“timestamp”:“2025-04-25T11:02:05.823Z”,“path”:”/v2/bookings?status=upcoming&attendeeEmail=pearcejaiden%40gmail.com",“error”:{"
code":“ForbiddenException”,“message”:“PermissionsGuard - no oAuth client found for access token="cal_live_…"
#free”,“details”:{“message”:“PermissionsGuard - no oAuth client found for access token="cal_live_…"
#free”,“error”:“Forbidden”,“statusCode”:403}}} "

Thank You
Edison

Hi @Monali

Just confirming if you are happy with my reply regarding the agent configuration.

Thank You

Hi @edisonpearce I tried your running your example and it worked. I believe you need to either pass the api_key to the calcomTools: tools=[CalComTools(user_timezone="America/New_York", api_key="you_key")], or set as your key as environment variable.

Also If you continue facing issues could you try setting agent flag “debug_mode” as True and share the agent logs here. I could take a look and help!

Hi @mustafa

Thank you for your response. I can confirm that after setting the api key in the tools attribute as suggested by you solved the issue. This made me realise that my api key in the environment variable wasn’t correct. I have also fixed it and all is working now as expected.

Thank you for your assistance, I really appreciate it.

1 Like