
Google calendar Cancel Appointment (MCP Tool)
Pricing
Pay per event

Google calendar Cancel Appointment (MCP Tool)
Pairs with the Apify "Actors MCP server" to give your AI Agent access to "cancel event" on Google Calendar. The user provides the booking email, and the appointment gets automatically cancelled. Use with "sambehnke/google-calendar-create-event" to SUPERCHARGE your agent!
0.0 (0)
Pricing
Pay per event
0
1
1
Last modified
11 hours ago
๐๏ธ Google Calendar Cancel Event Actor
A powerful Apify Actor that cancels Google Calendar events with user-friendly credential management. Perfect for voice agents, AI assistants, and MCP (Model Context Protocol) integration.
๐ Features
- ๐ Secure Credential Storage: Save Google OAuth credentials once, use across multiple actors
- ๐ Smart Event Search: Find events by customer info, date range, or specific event ID
- ๐ซ Silent Cancellation: Cancel events without sending notifications to attendees
- ๐ Auto Token Refresh: Automatically handles expired access tokens
- ๐ค AI Agent Ready: Designed for seamless integration with voice agents and MCP servers
- โ๏ธ Flexible Confirmation: Choose to cancel first match, all matches, or get interactive confirmation
๐ Table of Contents
- Prerequisites
- Getting Google Calendar Credentials
- Actor Setup
- Usage Examples
- MCP Integration
- Configuration Options
- Troubleshooting
๐ Prerequisites
- Apify Account: Sign up for free
- Google Cloud Project: Create a project
- Google Calendar: Access to the calendar you want to manage
๐ Getting Google Calendar Credentials
Step 1: Set Up Google Cloud Project
- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the Calendar API:
- Navigate to "APIs & Services" โ "Library"
- Search for "Google Calendar API"
- Click "Enable"
Step 2: Create OAuth 2.0 Credentials
- Go to "APIs & Services" โ "Credentials"
- Click "Create Credentials" โ "OAuth 2.0 Client IDs"
- Configure OAuth consent screen (if prompted):
- Choose "External" for testing
- Fill in required fields (App name, User support email, etc.)
- Add your email in "Test users" section
- Create OAuth Client:
- Application type: "Web application"
- Name: "Google Calendar Actor"
- Authorized redirect URIs:
https://developers.google.com/oauthplayground
- Save the Client ID and Client Secret
Step 3: Generate Access and Refresh Tokens
- Go to Google OAuth 2.0 Playground
- Click the gear icon (โ๏ธ) in the top right
- Check "Use your own OAuth credentials"
- Enter your Client ID and Client Secret from Step 2
- In "Select & authorize APIs" section:
- Find "Calendar API v3"
- Select:
https://www.googleapis.com/auth/calendar
- Click "Authorize APIs"
- Complete the authorization:
- Sign in with your Google account
- Grant calendar permissions
- Exchange authorization code for tokens:
- Click "Exchange authorization code for tokens"
- Copy the
access_token
andrefresh_token
๐ฏ You should now have all 4 credentials:
โ Client ID (ends with .googleusercontent.com)โ Client Secret (starts with GOCSPX-)โ Access Token (starts with ya29.)โ Refresh Token (starts with 1//)
๐ Actor Setup
Step 1: Deploy the Actor
- Clone this repository
- Install Apify CLI:
npm install -g apify-cli
- Login to Apify:
apify login
- Deploy the actor:
apify push
Step 2: Configure Credentials (One-Time Setup)
- Go to your Apify Console
- Find the "Google Calendar Cancel Event" actor
- Run with ALL credential fields filled:
{"googleAccessToken": "ya29.your_access_token_here","googleRefreshToken": "1//your_refresh_token_here","googleClientId": "your_client_id.googleusercontent.com","googleClientSecret": "GOCSPX-your_client_secret_here","eventId": "test_event_id_optional"}
- Verify you see:
โ Credentials saved for future use
- Your credentials are now stored securely!
๐ก Usage Examples
Cancel by Event ID (Recommended)
{"eventId": "abc123def456ghi789","calendarId": "primary"}
Cancel by Customer Search
{"customerName": "John Doe","customerEmail": "john@example.com","serviceType": "Consultation","searchCriteria": {"timeMin": "2025-08-20T00:00:00Z","timeMax": "2025-08-27T23:59:59Z","maxResults": 10},"confirmationMode": "first"}
Cancel with Interactive Confirmation
{"customerName": "Jane Smith","searchCriteria": {"q": "Meeting with Jane Smith","timeMin": "2025-08-20T00:00:00Z","timeMax": "2025-08-30T23:59:59Z"},"confirmationMode": "interactive"}
๐ค MCP Integration
Using with Apify MCP Server
- Install the Apify MCP Server:
$npm install @anthropic/mcp-server-apify
- Configure in your MCP client (e.g., Claude Desktop):
{"mcpServers": {"apify": {"command": "npx","args": ["@anthropic/mcp-server-apify"],"env": {"APIFY_API_TOKEN": "your_apify_token"}}}}
- Call the actor via MCP:
{"actor": "google-calendar-cancel-event-user-friendly","input": {"customerName": "John Doe","searchCriteria": { ... }}}
Voice Agent Integration
Since credentials are stored once, your voice agent only needs to send:
{"customerName": "Customer from call","customerPhone": "555-1234","searchCriteria": {"timeMin": "2025-08-25T09:00:00Z","timeMax": "2025-08-25T17:00:00Z"}}
โ๏ธ Configuration Options
Input Parameters
Field | Type | Required | Description |
---|---|---|---|
googleAccessToken | String | yes* | OAuth access token (setup only) |
googleRefreshToken | String | yes* | OAuth refresh token (setup only) |
googleClientId | String | yes* | OAuth client ID (setup only) |
googleClientSecret | String | yes* | OAuth client secret (setup only) |
customerName | String | No | Customer's name for search |
customerPhone | String | No | Customer's phone for search |
customerEmail | String | No | Customer's email for search |
serviceType | String | No | Service type for search |
eventId | String | No | Specific event ID to cancel |
searchCriteria | Object | No | Advanced search parameters |
calendarId | String | No | Calendar ID (default: "primary") |
confirmationMode | String | No | "first", "all", or "interactive" |
*Required only for initial credential setup
Search Criteria Object
{"q": "search query text","timeMin": "2025-08-20T00:00:00Z","timeMax": "2025-08-27T23:59:59Z","maxResults": 10,"singleEvents": true,"orderBy": "startTime"}
Confirmation Modes
first
(default): Cancel the first matching eventall
: Cancel all matching eventsinteractive
: Return list of events for user confirmation
๐ ๏ธ Troubleshooting
Common Issues
1. "No stored Google credentials found"
Solution: Run the actor once with all 4 Google credential fields filled.
2. "Token refresh failed: invalid_client"
Cause: Client ID/Secret don't match the refresh token. Solution:
- If you regenerated Client Secret, get fresh tokens from OAuth Playground
- Ensure all 4 credentials come from the same OAuth flow
3. "Access token may be expired"
Solution: The actor should auto-refresh, but if it fails:
- Check that your refresh token is valid
- Regenerate all credentials if needed
4. "No events found matching criteria"
Solutions:
- Verify the date range includes the event
- Check spelling of customer name/service type
- Try broader search criteria
- Use direct event ID if known
5. Events found but cancellation fails
Check:
- You have "edit" permissions on the calendar
- The event isn't already cancelled
- The event exists in the specified calendar
Debug Mode
Add this to your input for detailed logging:
{"debugMode": true,...}
Credential Validation
To test if your stored credentials work:
{"eventId": "nonexistent_id_test","calendarId": "primary"}
You should get "event not found" rather than authentication errors.
๐ Security Notes
- Credentials are encrypted in Apify's Key-Value storage
- User isolation: Each Apify user has separate credential storage
- No credential exposure: AI agents never see sensitive tokens
- Automatic token refresh: Reduces need for manual credential updates
๐ Related Actors
- link-to-create-actor: Create new calendar events
- link-to-reschedule-actor: Reschedule existing events
๐ Support
- Issues: GitHub Issues
- Documentation: Apify Actor Documentation
- Community: Apify Discord
๐ License
Apache-2.0 License - see LICENSE file for details.
Made with โค๏ธ for voice agents and AI automation