# Respond to Event Invitation — Google Calendar

> Accept, decline, or tentatively accept a Google Calendar event invitation on behalf of the authenticated user. Use this when you need to RSVP to an event. You can identify the event by its exact eventId or by eventName (searches upcoming…

- Key: `google_calendar-respond-to-event`
- Type: Action (Write)
- Version: 0.0.2
- App: Google Calendar (`google_calendar`) — https://pipedream.com/apps/google-calendar.md
- This page (HTML): https://pipedream.com/apps/google-calendar/actions/respond-to-event
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/google_calendar/actions/respond-to-event/respond-to-event.mjs

## Description

Accept, decline, or tentatively accept a Google Calendar event invitation on behalf of the authenticated user. Use this when you need to RSVP to an event. You can identify the event by its exact `eventId` or by `eventName` (searches upcoming events by title). If both are provided, `eventId` takes precedence. The `calendarId` defaults to `primary` (the user's main calendar). [See the documentation](https://developers.google.com/calendar/api/v3/reference/events/patch)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `calendarId` | `string` | No | Optionally select the calendar, defaults to the primary calendar for the logged-in user Options are loaded from the connected account. |
| `eventId` | `string` | No | The ID of the event to respond to. Use this when you have the exact event ID. If you only have the event title, use eventName instead. |
| `eventName` | `string` | No | The title (summary) of the event to respond to. Used to search for the event when you don't have the event ID. A case-insensitive search is performed and the first matching upcoming event is used. |
| `responseStatus` | `string` | Yes | Your RSVP response to the event invitation. |
| `sendUpdates` | `string` | No | Whether to send notification emails to the organizer and other attendees. Defaults to all (notify everyone). |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "google_calendar",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "google_calendar-respond-to-event",
  arguments: {
    calendarId: "Calendar",
    eventId: "Event ID",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "google_calendar-respond-to-event",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    google_calendar: { authProvisionId: "apn_xxxxxxx" },
    calendarId: "Calendar",
    eventId: "Event ID",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "google_calendar-respond-to-event",
    "configured_props": {
      "google_calendar": { "authProvisionId": "apn_xxxxxxx" },
      "calendarId": "Calendar",
      "eventId": "Event ID"
    }
  }'
```

---

- App: https://pipedream.com/apps/google-calendar.md · All apps: https://pipedream.com/apps
