# Gmail Draft

> >-

- **Type:** Skill
- **Install:** `agentstack add skill-opendatahub-io-ai-helpers-gmail-draft`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [opendatahub-io](https://agentstack.voostack.com/s/opendatahub-io)
- **Installs:** 0
- **Category:** [Communication](https://agentstack.voostack.com/c/communication)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [opendatahub-io](https://github.com/opendatahub-io)
- **Source:** https://github.com/opendatahub-io/ai-helpers/tree/main/helpers/skills/gmail-draft
- **Website:** https://opendatahub-io.github.io/ai-helpers/

## Install

```sh
agentstack add skill-opendatahub-io-ai-helpers-gmail-draft
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Gmail Draft

Compose a Gmail draft from text content provided in the conversation.

## Prerequisites

- `gws` binary must be on `$PATH`
- Authenticated with Gmail compose scope: run `gws auth login` (not `--readonly`)

If `gws` is not installed or authentication fails, tell the user to follow the
setup instructions in the `google-workspace` skill.

Helper scripts are located in `${CLAUDE_SKILL_DIR}` and require Python 3.10+.

---

## Step 1: Gather Recipients, Subject, and Body

Collect the three required inputs. Sources depend on how the skill was invoked:

- **From another skill** (e.g. `email-meeting-summary`): recipients, subject,
  and body are passed in context — use them directly.
- **Standalone invocation**: use `AskUserQuestion` to collect any that are
  missing:
  - Recipients: "Who should receive this email? (comma-separated addresses)"
  - Subject: "What should the subject line be?"
  - Body: "Paste or describe the content you want in the email body."

---

## Step 2: Present for Review

Show the user the draft details before creating:

```text
To: 
Subject: 

```

Ask:

> "Does this look right? Reply with any edits, or say 'send' to create the
> draft."

Incorporate edits and re-present until the user approves.

---

## Step 3: Create the Draft

Write the body to a temp file, then call `create_draft.py`:

```bash
BODY_FILE=$(mktemp /tmp/gmail_draft_body.XXXXXX)
cat > "$BODY_FILE" 
BODY_EOF

python3 "${CLAUDE_SKILL_DIR}/scripts/create_draft.py" \
  --to "" \
  --subject "" \
  --body-file "$BODY_FILE"
```

---

## Step 4: Confirm

On success, tell the user:

> "Draft created. You can find it in the Drafts folder in Gmail at
> https://mail.google.com/mail/#drafts. Review it before sending."

If the script exits with an error, show the error message and suggest the user
check `gws auth login` permissions (the Gmail scope must include draft
creation).

---

## Error Reference

| Situation | Action |
|---|---|
| `gws` not found | Tell user to install `gws` and add it to PATH |
| Auth error (401/403) | Tell user to run `gws auth login` (without `--readonly`) |
| `create_draft.py` fails | Show error; check Gmail scope in `gws auth login` |

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [opendatahub-io](https://github.com/opendatahub-io)
- **Source:** [opendatahub-io/ai-helpers](https://github.com/opendatahub-io/ai-helpers)
- **License:** Apache-2.0
- **Homepage:** https://opendatahub-io.github.io/ai-helpers/

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-opendatahub-io-ai-helpers-gmail-draft
- Seller: https://agentstack.voostack.com/s/opendatahub-io
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
