You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: "Set up, configure, or use Gmail and Google Calendar. Handles initial setup, authentication, sending/reading/searching emails, and managing calendar events. Use whenever the user mentions setting up Google, email, inbox, sending a message, checking their calendar, scheduling a meeting, or managing events."
2
+
name: google
3
+
description: "Manage Gmail and Google Calendar with capability-backed auth and operations. Use when asked to check inbox, summarize emails, give a day at a glance, send an email, review calendar events, or schedule meetings."
3
4
opt_in: true
4
5
sensitive: true
5
6
access:
@@ -16,7 +17,7 @@ input_schema:
16
17
properties:
17
18
task:
18
19
type: string
19
-
description: The email/calendar task to perform
20
+
description: The Google email/calendar task to perform
20
21
required:
21
22
- task
22
23
---
@@ -27,6 +28,7 @@ Manage Gmail and Google Calendar through host-managed capabilities.
27
28
28
29
- Use `ash-sb capability` for every Gmail/Calendar operation.
29
30
- Never read or request raw OAuth access tokens, refresh tokens, or client secrets.
31
+
- Do not fabricate capability results. Only report data returned by commands.
30
32
31
33
## Workflow
32
34
@@ -38,142 +40,104 @@ On every invocation, follow these steps in order:
38
40
ash-sb capability list
39
41
```
40
42
41
-
Expected output:
43
+
- If a needed capability is missing, tell the user to enable `[skills.google]` and stop.
44
+
- If a needed capability is not authenticated, run auth (step 2).
45
+
- If already authenticated, continue to operations (step 3).
- If a needed capability is missing entirely, tell the user the google skill needs to be enabled in their Ash config (`[skills.google] enabled = true`) and stop.
57
-
- If `Authenticated: no` for any needed capability, go to step 2.
58
-
- If `Authenticated: yes` for all needed capabilities, skip to step 3.
59
-
60
-
### 2. Authenticate
61
-
62
-
Run this step for each capability where `Authenticated: no`. If the user's request is setup-only (e.g. "set up my email"), stop after authentication is complete — do not invoke any operations.
63
-
64
-
Before prompting the user again, check whether the current task already contains a pasted Google callback URL (`http://localhost/?...code=...`) or a raw auth code. If yes:
65
-
66
-
1. Run `ash-sb capability auth begin -c <capability>` first.
3. Re-run `ash-sb capability list` and continue to operations if authenticated.
69
-
70
-
Do not ask the user for another URL/code when one is already present in the task.
71
-
72
-
If `auth complete` fails with an invalid/expired flow error, explicitly tell the user
73
-
their previous auth link/code expired (or no longer matches the active flow), then
74
-
start a fresh auth flow and ask them to paste the new callback URL promptly.
47
+
### 2. Authenticate (when needed)
75
48
76
-
**2a. Begin auth flow**
77
-
78
-
Use `--account work` or `--account personal` if the user specifies an account preference:
49
+
For each unauthenticated capability (`gog.email`, `gog.calendar`):
79
50
80
51
```bash
81
52
ash-sb capability auth begin -c gog.email
82
53
```
83
54
84
-
Expected output:
85
-
86
-
```
87
-
Started capability auth flow (flow_id=abc123)
88
-
Capability: gog.email
89
-
Auth URL: https://www.google.com/device
90
-
Flow type: device_code
91
-
User code: ABCD-EFGH
92
-
Poll interval: 5s
93
-
Expires: 2026-03-01T12:30:00Z
94
-
```
95
-
96
-
**2b. Present URL and code to user**
97
-
98
-
Check the `Flow type` in the output:
55
+
Then:
99
56
100
-
- If `device_code`: show the `Auth URL` and `User code` from the output. Tell the user to open the URL and enter the code. Then proceed to step 2c to poll for completion.
101
-
- If `authorization_code`: show the `Auth URL` from the output and ask the user to complete the Google consent screen and provide either the authorization code or the callback URL. Then use `ash-sb capability auth complete --flow-id <id> --code '<CODE>'` (or `--callback-url '<URL>'` when the user pastes the full callback URL). Do **not** pass `-c/--capability` to `auth complete`; that option is only valid for `auth begin`.
57
+
- If flow type is `device_code`: show URL + user code, then poll.
58
+
- If flow type is `authorization_code`: show URLand ask user for callback URL or code, then complete.
102
59
103
-
**2c. Poll for completion (device code flow)**
104
-
105
-
After showing the user the URL and code, poll for completion:
If multiple capabilities need auth (e.g. both `gog.email`and `gog.calendar`), repeat steps 2a–2c for each one. Each capability requires its own auth flow.
72
+
Use only capability operations and explicit JSON input.
120
73
121
-
### 3. Perform operation
122
-
123
-
Run capability operations with explicit capability IDs and JSON input:
0 commit comments