Example · ships with Charlie
Gmail
Searches, reads and drafts your email, and manages labels. It fills Charlie's email job, so another email extension could take its place without Charlie noticing.
What's in the folder
gmail/
├── manifest.json
├── handlers/
│ ├── search.js read.js draft.js one per tool
│ └── list_labels.js create_label.js apply_labels.js
└── build/
└── Settings.js Connect Gmail / Disconnect
The manifest
{
"name": "gmail",
"description": "Gmail — search, read messages and threads, create drafts, and...",
"version": "0.2.0",
"developer": {
"name": "Andy Dale",
"contact": "(hidden on this page)"
},
"tier": "core",
"role": "email",
"connections": [
{
"name": "gmail",
"authType": "oauth2-static",
"transport": "rest-client"
}
],
"settings": {
"component": "./build/Settings.js"
},
"instructions": "Sending is off-limits, however you'd reach it. Charlie's Gmai...",
"tools": [
{
"name": "email__search",
"description": "Search the connected account using Gmail's own search syntax...",
"input_schema": { ... },
"handler": "./handlers/search.js",
"delivery": "narrated",
"roleScoped": true
},
{ "name": "email__read" },
{ "name": "email__draft" },
{ "name": "email__list_labels" },
... 2 more tools
]
}| Line | What it plugs into |
|---|---|
"tools" | 1 · Tools. Six email tools, each marked roleScoped. |
"connections" | 2 · Connections. The Gmail sign-in. |
"instructions" | 3 · Instructions. Opens with "Sending is off-limits, however you'd reach it." |
"settings" | 4 · Settings. Connect, disconnect, or use your own Google Cloud client. |
"role": "email" | 6 · Roles. Gmail is Charlie's email provider. Only one extension can hold a role at a time. |
Ideas to borrow
- Fill a role when you're one of several possible providers. Charlie's tools stay the same whichever provider is switched on.
- Have no tool for anything you don't want to happen. Gmail has no send tool, and its instructions say so plainly.