matimo-gmail 0.1.2__tar.gz → 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {matimo_gmail-0.1.2 → matimo_gmail-0.2.0}/.gitignore +3 -1
- matimo_gmail-0.2.0/LICENSE +21 -0
- {matimo_gmail-0.1.2 → matimo_gmail-0.2.0}/PKG-INFO +14 -15
- {matimo_gmail-0.1.2 → matimo_gmail-0.2.0}/README.md +10 -12
- {matimo_gmail-0.1.2 → matimo_gmail-0.2.0}/pyproject.toml +2 -2
- matimo_gmail-0.2.0/src/matimo_gmail/skills/gmail/SKILL.md +115 -0
- {matimo_gmail-0.1.2 → matimo_gmail-0.2.0}/src/matimo_gmail/tools/delete-message/definition.yaml +1 -0
- {matimo_gmail-0.1.2 → matimo_gmail-0.2.0}/src/matimo_gmail/__init__.py +0 -0
- {matimo_gmail-0.1.2 → matimo_gmail-0.2.0}/src/matimo_gmail/tools/create-draft/definition.yaml +0 -0
- {matimo_gmail-0.1.2 → matimo_gmail-0.2.0}/src/matimo_gmail/tools/get-attachment/definition.yaml +0 -0
- {matimo_gmail-0.1.2 → matimo_gmail-0.2.0}/src/matimo_gmail/tools/get-message/definition.yaml +0 -0
- {matimo_gmail-0.1.2 → matimo_gmail-0.2.0}/src/matimo_gmail/tools/list-messages/definition.yaml +0 -0
- {matimo_gmail-0.1.2 → matimo_gmail-0.2.0}/src/matimo_gmail/tools/send-email/definition.yaml +0 -0
- {matimo_gmail-0.1.2 → matimo_gmail-0.2.0}/tests/unit/test_get_attachment.py +0 -0
|
@@ -58,7 +58,6 @@ temp/
|
|
|
58
58
|
|
|
59
59
|
# Personal scratch notes / working docs — not part of the shipped repo
|
|
60
60
|
.local-notes/
|
|
61
|
-
typescript/examples/mcp/matimo-tools/.matimo-approvals.json
|
|
62
61
|
typescript/examples/mcp/matimo-tools/fetch-weather/definition.yaml
|
|
63
62
|
typescript/examples/mcp/matimo-tools/npm_downloads/definition.yaml
|
|
64
63
|
typescript/examples/mcp/matimo-tools/skills/ecosystem-health/SKILL.md
|
|
@@ -68,3 +67,6 @@ typescript/packages/cli/.matimo/certs/server.crt
|
|
|
68
67
|
typescript/packages/cli/.matimo/certs/server.key
|
|
69
68
|
typescript/examples/mcp/.matimo/certs/server.crt
|
|
70
69
|
typescript/examples/mcp/.matimo/certs/server.key
|
|
70
|
+
|
|
71
|
+
# HITL approval manifests are per-machine state (HMAC-signed approvals); never commit one
|
|
72
|
+
**/.matimo-approvals.json
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ROAIQ TECHNOLOGIES PRIVATE LIMITED
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: matimo-gmail
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Matimo provider — Gmail tools (send, list, read, delete emails)
|
|
5
5
|
License: MIT
|
|
6
|
+
License-File: LICENSE
|
|
6
7
|
Keywords: agents,ai,gmail,matimo,tools
|
|
7
8
|
Classifier: Development Status :: 4 - Beta
|
|
8
9
|
Classifier: Intended Audience :: Developers
|
|
9
10
|
Classifier: License :: OSI Approved :: MIT License
|
|
10
11
|
Classifier: Programming Language :: Python :: 3.11
|
|
11
12
|
Requires-Python: >=3.11
|
|
12
|
-
Requires-Dist: matimo-core<0.
|
|
13
|
+
Requires-Dist: matimo-core<0.3.0,>=0.2.0
|
|
13
14
|
Description-Content-Type: text/markdown
|
|
14
15
|
|
|
15
16
|
# matimo-gmail
|
|
16
17
|
|
|
17
|
-
> Gmail tools for [Matimo](https://matimo.dev)
|
|
18
|
+
> Gmail tools for [Matimo](https://matimo.dev) - send, list, read, and delete emails.
|
|
18
19
|
|
|
19
20
|
[](https://pypi.org/project/matimo-gmail/)
|
|
20
|
-
[](https://matimo.dev
|
|
21
|
+
[](https://docs.matimo.dev)
|
|
21
22
|
|
|
22
23
|
---
|
|
23
24
|
|
|
@@ -33,12 +34,12 @@ pip install matimo matimo-gmail
|
|
|
33
34
|
|
|
34
35
|
| Tool | Description |
|
|
35
36
|
|------|-------------|
|
|
36
|
-
| `send-email` | Send an email (to, subject, body, cc, bcc, html) |
|
|
37
|
-
| `list-messages` | List messages with optional query/label filters |
|
|
38
|
-
| `get-message` | Get full message content by ID |
|
|
39
|
-
| `get-attachment` | Fetch a message attachment by ID (base64url-encoded) |
|
|
40
|
-
| `create-draft` | Create a draft email |
|
|
41
|
-
| `delete-message` | Move message to trash |
|
|
37
|
+
| `gmail-send-email` | Send an email (to, subject, body, cc, bcc, html) |
|
|
38
|
+
| `gmail-list-messages` | List messages with optional query/label filters |
|
|
39
|
+
| `gmail-get-message` | Get full message content by ID |
|
|
40
|
+
| `gmail-get-attachment` | Fetch a message attachment by ID (base64url-encoded) |
|
|
41
|
+
| `gmail-create-draft` | Create a draft email |
|
|
42
|
+
| `gmail-delete-message` | Move message to trash |
|
|
42
43
|
|
|
43
44
|
---
|
|
44
45
|
|
|
@@ -53,14 +54,14 @@ async def main():
|
|
|
53
54
|
matimo = await Matimo.init(get_tools_path())
|
|
54
55
|
|
|
55
56
|
# Send an email
|
|
56
|
-
await matimo.execute('send-email', {
|
|
57
|
+
await matimo.execute('gmail-send-email', {
|
|
57
58
|
'to': 'user@example.com',
|
|
58
59
|
'subject': 'Hello from Matimo',
|
|
59
60
|
'body': 'This message was sent by an AI agent.',
|
|
60
61
|
})
|
|
61
62
|
|
|
62
63
|
# List recent messages
|
|
63
|
-
result = await matimo.execute('list-messages', {
|
|
64
|
+
result = await matimo.execute('gmail-list-messages', {
|
|
64
65
|
'query': 'is:unread',
|
|
65
66
|
'max_results': 10,
|
|
66
67
|
})
|
|
@@ -76,8 +77,6 @@ Gmail tools use OAuth2. Set your credentials via environment variables:
|
|
|
76
77
|
|
|
77
78
|
```bash
|
|
78
79
|
export GMAIL_ACCESS_TOKEN="ya29.your-oauth2-access-token"
|
|
79
|
-
# Or use a service account
|
|
80
|
-
export GMAIL_SERVICE_ACCOUNT_JSON="/path/to/service-account.json"
|
|
81
80
|
```
|
|
82
81
|
|
|
83
82
|
### Getting an Access Token (OAuth2)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# matimo-gmail
|
|
2
2
|
|
|
3
|
-
> Gmail tools for [Matimo](https://matimo.dev)
|
|
3
|
+
> Gmail tools for [Matimo](https://matimo.dev) - send, list, read, and delete emails.
|
|
4
4
|
|
|
5
5
|
[](https://pypi.org/project/matimo-gmail/)
|
|
6
|
-
[](https://matimo.dev
|
|
6
|
+
[](https://docs.matimo.dev)
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
@@ -19,12 +19,12 @@ pip install matimo matimo-gmail
|
|
|
19
19
|
|
|
20
20
|
| Tool | Description |
|
|
21
21
|
|------|-------------|
|
|
22
|
-
| `send-email` | Send an email (to, subject, body, cc, bcc, html) |
|
|
23
|
-
| `list-messages` | List messages with optional query/label filters |
|
|
24
|
-
| `get-message` | Get full message content by ID |
|
|
25
|
-
| `get-attachment` | Fetch a message attachment by ID (base64url-encoded) |
|
|
26
|
-
| `create-draft` | Create a draft email |
|
|
27
|
-
| `delete-message` | Move message to trash |
|
|
22
|
+
| `gmail-send-email` | Send an email (to, subject, body, cc, bcc, html) |
|
|
23
|
+
| `gmail-list-messages` | List messages with optional query/label filters |
|
|
24
|
+
| `gmail-get-message` | Get full message content by ID |
|
|
25
|
+
| `gmail-get-attachment` | Fetch a message attachment by ID (base64url-encoded) |
|
|
26
|
+
| `gmail-create-draft` | Create a draft email |
|
|
27
|
+
| `gmail-delete-message` | Move message to trash |
|
|
28
28
|
|
|
29
29
|
---
|
|
30
30
|
|
|
@@ -39,14 +39,14 @@ async def main():
|
|
|
39
39
|
matimo = await Matimo.init(get_tools_path())
|
|
40
40
|
|
|
41
41
|
# Send an email
|
|
42
|
-
await matimo.execute('send-email', {
|
|
42
|
+
await matimo.execute('gmail-send-email', {
|
|
43
43
|
'to': 'user@example.com',
|
|
44
44
|
'subject': 'Hello from Matimo',
|
|
45
45
|
'body': 'This message was sent by an AI agent.',
|
|
46
46
|
})
|
|
47
47
|
|
|
48
48
|
# List recent messages
|
|
49
|
-
result = await matimo.execute('list-messages', {
|
|
49
|
+
result = await matimo.execute('gmail-list-messages', {
|
|
50
50
|
'query': 'is:unread',
|
|
51
51
|
'max_results': 10,
|
|
52
52
|
})
|
|
@@ -62,8 +62,6 @@ Gmail tools use OAuth2. Set your credentials via environment variables:
|
|
|
62
62
|
|
|
63
63
|
```bash
|
|
64
64
|
export GMAIL_ACCESS_TOKEN="ya29.your-oauth2-access-token"
|
|
65
|
-
# Or use a service account
|
|
66
|
-
export GMAIL_SERVICE_ACCOUNT_JSON="/path/to/service-account.json"
|
|
67
65
|
```
|
|
68
66
|
|
|
69
67
|
### Getting an Access Token (OAuth2)
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "matimo-gmail"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.2.0"
|
|
8
8
|
description = "Matimo provider — Gmail tools (send, list, read, delete emails)"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "MIT" }
|
|
@@ -17,7 +17,7 @@ classifiers = [
|
|
|
17
17
|
"Programming Language :: Python :: 3.11",
|
|
18
18
|
]
|
|
19
19
|
dependencies = [
|
|
20
|
-
"matimo-core>=0.
|
|
20
|
+
"matimo-core>=0.2.0,<0.3.0",
|
|
21
21
|
]
|
|
22
22
|
|
|
23
23
|
[project.entry-points."matimo.providers"]
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gmail
|
|
3
|
+
description: "Complete guide to all Gmail tools — inbox management, search, sending, drafts, and attachments."
|
|
4
|
+
version: "1.1.0"
|
|
5
|
+
license: "MIT"
|
|
6
|
+
metadata:
|
|
7
|
+
category: "Communication"
|
|
8
|
+
difficulty: "beginner"
|
|
9
|
+
apply-to: "gmail-send-email gmail-list-messages gmail-get-message gmail-get-attachment gmail-create-draft gmail-delete-message"
|
|
10
|
+
author: "Matimo"
|
|
11
|
+
tags: "gmail,email,inbox,google"
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Gmail
|
|
15
|
+
|
|
16
|
+
Complete guide to using Matimo's Gmail tools for sending emails, inbox management, search, drafts, and attachments.
|
|
17
|
+
|
|
18
|
+
## All Available Tools
|
|
19
|
+
|
|
20
|
+
| Tool | Purpose |
|
|
21
|
+
|------|---------|
|
|
22
|
+
| `gmail-send-email` | Send a new email |
|
|
23
|
+
| `gmail-list-messages` | List/search messages with Gmail query syntax and label filters |
|
|
24
|
+
| `gmail-get-message` | Get full details of a message (headers, body, attachment metadata) |
|
|
25
|
+
| `gmail-get-attachment` | Fetch a message attachment's raw data by ID |
|
|
26
|
+
| `gmail-create-draft` | Create a draft email without sending it |
|
|
27
|
+
| `gmail-delete-message` | Permanently delete a message |
|
|
28
|
+
|
|
29
|
+
## Authentication
|
|
30
|
+
|
|
31
|
+
Gmail tools use OAuth2. Required scopes:
|
|
32
|
+
- `https://www.googleapis.com/auth/gmail.readonly` — for listing/reading messages and attachments
|
|
33
|
+
- `https://www.googleapis.com/auth/gmail.send` — for sending
|
|
34
|
+
- `https://www.googleapis.com/auth/gmail.compose` — for drafts
|
|
35
|
+
- `https://www.googleapis.com/auth/gmail.modify` — for deleting messages
|
|
36
|
+
|
|
37
|
+
Environment variable: `GMAIL_ACCESS_TOKEN` (or `GMAIL_CLIENT_ID` / `GMAIL_CLIENT_SECRET` / `GMAIL_REFRESH_TOKEN` when using the OAuth2 provider flow).
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Sending Emails
|
|
42
|
+
|
|
43
|
+
Use `gmail-send-email` with:
|
|
44
|
+
- `to` (required) — recipient email or comma-separated list
|
|
45
|
+
- `subject` (required) — email subject
|
|
46
|
+
- `body` (required) — email body (supports HTML via `isHtml`)
|
|
47
|
+
- `cc`, `bcc` — optional recipients
|
|
48
|
+
|
|
49
|
+
**Best practices:**
|
|
50
|
+
- Always include a meaningful subject
|
|
51
|
+
- Keep body concise; use HTML for formatting
|
|
52
|
+
- Handle bounces — validate addresses before sending
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Drafts
|
|
57
|
+
|
|
58
|
+
Use `gmail-create-draft` with the same parameters as `gmail-send-email` (`to`, `subject`, `body`, `cc`, `bcc`, `isHtml`) to stage an email for manual review before sending.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Inbox Management
|
|
63
|
+
|
|
64
|
+
### Listing and Searching Messages
|
|
65
|
+
|
|
66
|
+
`gmail-list-messages` handles both listing and search — pass Gmail's advanced query syntax via `query`, plus `labelIds`, `maxResults`, `pageToken`, and `includeSpamTrash`.
|
|
67
|
+
|
|
68
|
+
| Operator | Example | Purpose |
|
|
69
|
+
|----------|---------|---------|
|
|
70
|
+
| `from:` | `from:alice@acme.com` | From specific sender |
|
|
71
|
+
| `to:` | `to:team@acme.com` | Sent to |
|
|
72
|
+
| `subject:` | `subject:invoice` | In subject line |
|
|
73
|
+
| `has:attachment` | | Has attachments |
|
|
74
|
+
| `is:unread` | | Unread messages |
|
|
75
|
+
| `is:starred` | | Starred messages |
|
|
76
|
+
| `after:` | `after:2024/01/01` | Date filter |
|
|
77
|
+
| `before:` | `before:2024/06/01` | Date filter |
|
|
78
|
+
| `label:` | `label:work` | By label |
|
|
79
|
+
| `filename:` | `filename:pdf` | Attachment type |
|
|
80
|
+
| `-` | `-from:noreply` | Exclude results |
|
|
81
|
+
|
|
82
|
+
Combine operators: `from:alice has:attachment after:2024/01/01`. Common label IDs for `labelIds`: `INBOX`, `SENT`, `TRASH`, `SPAM`, `DRAFT`, `STARRED`, `UNREAD` (system labels) or custom user labels.
|
|
83
|
+
|
|
84
|
+
### Getting Message Details
|
|
85
|
+
|
|
86
|
+
Use `gmail-get-message` with `messageId` to retrieve full headers, body, and attachment metadata (`payload.parts[].body.attachmentId`).
|
|
87
|
+
|
|
88
|
+
### Fetching Attachments
|
|
89
|
+
|
|
90
|
+
Use `gmail-get-attachment` with `messageId` and `attachmentId` (from `gmail-get-message`'s payload parts) to retrieve the attachment's `size` and base64url-encoded `data`.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Common Workflows
|
|
95
|
+
|
|
96
|
+
### Daily Inbox Triage
|
|
97
|
+
1. List unread emails: `gmail-list-messages` with `labelIds: "UNREAD"`
|
|
98
|
+
2. Search for priority: `gmail-list-messages` with `query: "is:important"`
|
|
99
|
+
3. Get details on flagged items: `gmail-get-message` for each
|
|
100
|
+
4. Pull any attachments: `gmail-get-attachment` using `attachmentId` values from step 3
|
|
101
|
+
|
|
102
|
+
### Email Notification
|
|
103
|
+
1. Send email: `gmail-send-email` with formatted body
|
|
104
|
+
2. Verify delivery by searching: `gmail-list-messages` with `query: "in:sent subject:..."`
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Common Errors
|
|
109
|
+
|
|
110
|
+
| Error | Cause | Fix |
|
|
111
|
+
|-------|-------|-----|
|
|
112
|
+
| 401 `Unauthorized` | Invalid or expired token | Refresh OAuth2 token |
|
|
113
|
+
| 403 `Insufficient Permission` | Missing scope | Add required Gmail scope |
|
|
114
|
+
| 400 `Invalid to header` | Bad email address | Validate email format |
|
|
115
|
+
| 429 `Rate limit` | Too many requests | Gmail API: 250 quota units/sec |
|
|
File without changes
|
{matimo_gmail-0.1.2 → matimo_gmail-0.2.0}/src/matimo_gmail/tools/create-draft/definition.yaml
RENAMED
|
File without changes
|
{matimo_gmail-0.1.2 → matimo_gmail-0.2.0}/src/matimo_gmail/tools/get-attachment/definition.yaml
RENAMED
|
File without changes
|
{matimo_gmail-0.1.2 → matimo_gmail-0.2.0}/src/matimo_gmail/tools/get-message/definition.yaml
RENAMED
|
File without changes
|
{matimo_gmail-0.1.2 → matimo_gmail-0.2.0}/src/matimo_gmail/tools/list-messages/definition.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|