matimo-gmail 0.1.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.
@@ -0,0 +1,63 @@
1
+ # Dependencies
2
+ **/node_modules/
3
+ package-lock.json
4
+ yarn.lock
5
+
6
+ # Build output
7
+ **/dist/
8
+ *.tsbuildinfo
9
+
10
+ # Python compiled / build
11
+ **/__pycache__/
12
+ *.py[cod]
13
+ *$py.class
14
+ *.egg-info/
15
+ *.egg
16
+ **/build/
17
+ **/.eggs/
18
+ **/.venv/
19
+ **/.mypy_cache/
20
+ **/.ruff_cache/
21
+ **/.pytest_cache/
22
+
23
+ # Test coverage
24
+ **/coverage/
25
+ **/.nyc_output/
26
+
27
+ # IDE
28
+ .vscode/
29
+ .idea/
30
+ *.swp
31
+ *.swo
32
+ *~
33
+ .DS_Store
34
+
35
+ # Environment
36
+ .env
37
+ .env.local
38
+ .env.*.local
39
+
40
+ # Logs
41
+ *.log
42
+ npm-debug.log*
43
+ yarn-debug.log*
44
+ yarn-error.log*
45
+
46
+ # OS
47
+ .DS_Store
48
+ Thumbs.db
49
+
50
+ # Temporary files
51
+ tmp/
52
+ temp/
53
+ *.tmp
54
+ typescript/examples/mcp/matimo-tools/.matimo-approvals.json
55
+ typescript/examples/mcp/matimo-tools/fetch-weather/definition.yaml
56
+ typescript/examples/mcp/matimo-tools/npm_downloads/definition.yaml
57
+ typescript/examples/mcp/matimo-tools/skills/ecosystem-health/SKILL.md
58
+ typescript/examples/mcp/matimo-tools/skills/matimo-health-check/SKILL.md
59
+ typescript/examples/mcp/matimo-tools/skills/moltbook-identity/SKILL.md
60
+ typescript/packages/cli/.matimo/certs/server.crt
61
+ typescript/packages/cli/.matimo/certs/server.key
62
+ typescript/examples/mcp/.matimo/certs/server.crt
63
+ typescript/examples/mcp/.matimo/certs/server.key
@@ -0,0 +1,103 @@
1
+ Metadata-Version: 2.4
2
+ Name: matimo-gmail
3
+ Version: 0.1.0
4
+ Summary: Matimo provider — Gmail tools (send, list, read, delete emails)
5
+ License: MIT
6
+ Keywords: agents,ai,gmail,matimo,tools
7
+ Classifier: Development Status :: 4 - Beta
8
+ Classifier: Intended Audience :: Developers
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Programming Language :: Python :: 3.11
11
+ Requires-Python: >=3.11
12
+ Requires-Dist: matimo-core<0.2.0,>=0.1.0
13
+ Description-Content-Type: text/markdown
14
+
15
+ # matimo-gmail
16
+
17
+ > Gmail tools for [Matimo](https://matimo.dev) — send, list, read, and delete emails.
18
+
19
+ [![PyPI](https://img.shields.io/pypi/v/matimo-gmail)](https://pypi.org/project/matimo-gmail/)
20
+ [![Docs](https://img.shields.io/badge/docs-matimo.dev-blue)](https://matimo.dev/docs)
21
+
22
+ ---
23
+
24
+ ## Installation
25
+
26
+ ```bash
27
+ pip install matimo matimo-gmail
28
+ ```
29
+
30
+ ---
31
+
32
+ ## Available Tools (6 Total)
33
+
34
+ | Tool | Description |
35
+ |------|-------------|
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
+ | `create-draft` | Create a draft email |
40
+ | `delete-message` | Move message to trash |
41
+
42
+ ---
43
+
44
+ ## Quick Start
45
+
46
+ ```python
47
+ import asyncio
48
+ from matimo import Matimo
49
+ from matimo_gmail import get_tools_path
50
+
51
+ async def main():
52
+ matimo = await Matimo.init(get_tools_path())
53
+
54
+ # Send an email
55
+ await matimo.execute('send-email', {
56
+ 'to': 'user@example.com',
57
+ 'subject': 'Hello from Matimo',
58
+ 'body': 'This message was sent by an AI agent.',
59
+ })
60
+
61
+ # List recent messages
62
+ result = await matimo.execute('list-messages', {
63
+ 'query': 'is:unread',
64
+ 'max_results': 10,
65
+ })
66
+
67
+ asyncio.run(main())
68
+ ```
69
+
70
+ ---
71
+
72
+ ## Authentication
73
+
74
+ Gmail tools use OAuth2. Set your credentials via environment variables:
75
+
76
+ ```bash
77
+ export GMAIL_ACCESS_TOKEN="ya29.your-oauth2-access-token"
78
+ # Or use a service account
79
+ export GMAIL_SERVICE_ACCOUNT_JSON="/path/to/service-account.json"
80
+ ```
81
+
82
+ ### Getting an Access Token (OAuth2)
83
+
84
+ 1. Create a project in [Google Cloud Console](https://console.cloud.google.com/)
85
+ 2. Enable the **Gmail API**
86
+ 3. Create OAuth 2.0 credentials (Desktop app)
87
+ 4. Run the OAuth flow to get an access token
88
+
89
+ ---
90
+
91
+ ## Documentation
92
+
93
+ - [Gmail API Reference](https://developers.google.com/gmail/api/reference/rest)
94
+ - [Python Examples](https://github.com/tallclub/matimo/tree/main/python/examples/native/gmail)
95
+
96
+ ---
97
+
98
+ ## Links
99
+
100
+ - **PyPI:** https://pypi.org/project/matimo-gmail/
101
+ - **GitHub:** https://github.com/tallclub/matimo
102
+ - **Gmail API Docs:** https://developers.google.com/gmail/api
103
+
@@ -0,0 +1,89 @@
1
+ # matimo-gmail
2
+
3
+ > Gmail tools for [Matimo](https://matimo.dev) — send, list, read, and delete emails.
4
+
5
+ [![PyPI](https://img.shields.io/pypi/v/matimo-gmail)](https://pypi.org/project/matimo-gmail/)
6
+ [![Docs](https://img.shields.io/badge/docs-matimo.dev-blue)](https://matimo.dev/docs)
7
+
8
+ ---
9
+
10
+ ## Installation
11
+
12
+ ```bash
13
+ pip install matimo matimo-gmail
14
+ ```
15
+
16
+ ---
17
+
18
+ ## Available Tools (6 Total)
19
+
20
+ | Tool | Description |
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
+ | `create-draft` | Create a draft email |
26
+ | `delete-message` | Move message to trash |
27
+
28
+ ---
29
+
30
+ ## Quick Start
31
+
32
+ ```python
33
+ import asyncio
34
+ from matimo import Matimo
35
+ from matimo_gmail import get_tools_path
36
+
37
+ async def main():
38
+ matimo = await Matimo.init(get_tools_path())
39
+
40
+ # Send an email
41
+ await matimo.execute('send-email', {
42
+ 'to': 'user@example.com',
43
+ 'subject': 'Hello from Matimo',
44
+ 'body': 'This message was sent by an AI agent.',
45
+ })
46
+
47
+ # List recent messages
48
+ result = await matimo.execute('list-messages', {
49
+ 'query': 'is:unread',
50
+ 'max_results': 10,
51
+ })
52
+
53
+ asyncio.run(main())
54
+ ```
55
+
56
+ ---
57
+
58
+ ## Authentication
59
+
60
+ Gmail tools use OAuth2. Set your credentials via environment variables:
61
+
62
+ ```bash
63
+ export GMAIL_ACCESS_TOKEN="ya29.your-oauth2-access-token"
64
+ # Or use a service account
65
+ export GMAIL_SERVICE_ACCOUNT_JSON="/path/to/service-account.json"
66
+ ```
67
+
68
+ ### Getting an Access Token (OAuth2)
69
+
70
+ 1. Create a project in [Google Cloud Console](https://console.cloud.google.com/)
71
+ 2. Enable the **Gmail API**
72
+ 3. Create OAuth 2.0 credentials (Desktop app)
73
+ 4. Run the OAuth flow to get an access token
74
+
75
+ ---
76
+
77
+ ## Documentation
78
+
79
+ - [Gmail API Reference](https://developers.google.com/gmail/api/reference/rest)
80
+ - [Python Examples](https://github.com/tallclub/matimo/tree/main/python/examples/native/gmail)
81
+
82
+ ---
83
+
84
+ ## Links
85
+
86
+ - **PyPI:** https://pypi.org/project/matimo-gmail/
87
+ - **GitHub:** https://github.com/tallclub/matimo
88
+ - **Gmail API Docs:** https://developers.google.com/gmail/api
89
+
@@ -0,0 +1,27 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "matimo-gmail"
7
+ version = "0.1.0"
8
+ description = "Matimo provider — Gmail tools (send, list, read, delete emails)"
9
+ readme = "README.md"
10
+ license = { text = "MIT" }
11
+ requires-python = ">=3.11"
12
+ keywords = ["ai", "tools", "agents", "matimo", "gmail"]
13
+ classifiers = [
14
+ "Development Status :: 4 - Beta",
15
+ "Intended Audience :: Developers",
16
+ "License :: OSI Approved :: MIT License",
17
+ "Programming Language :: Python :: 3.11",
18
+ ]
19
+ dependencies = [
20
+ "matimo-core>=0.1.0,<0.2.0",
21
+ ]
22
+
23
+ [project.entry-points."matimo.providers"]
24
+ gmail = "matimo_gmail:get_tools_path"
25
+
26
+ [tool.hatch.build.targets.wheel]
27
+ packages = ["src/matimo_gmail"]
@@ -0,0 +1,17 @@
1
+ """Matimo gmail provider — exposes the path to YAML tool definitions."""
2
+ from __future__ import annotations
3
+
4
+ import importlib.resources
5
+ from pathlib import Path
6
+
7
+
8
+ def get_tools_path() -> str:
9
+ """Return the absolute path to the bundled gmail tool definitions."""
10
+ try:
11
+ ref = importlib.resources.files("matimo_gmail") / "tools"
12
+ return str(ref)
13
+ except Exception:
14
+ return str(Path(__file__).parent / "tools")
15
+
16
+
17
+ __all__ = ["get_tools_path"]
@@ -0,0 +1,99 @@
1
+ name: gmail-create-draft
2
+ description: Create a draft email in Gmail without sending it
3
+ version: '1.0.0'
4
+
5
+ parameters:
6
+ to:
7
+ type: string
8
+ description: Email address of the recipient(s), comma-separated for multiple recipients
9
+ required: true
10
+ example: 'user@example.com'
11
+
12
+ subject:
13
+ type: string
14
+ description: Subject line of the draft email
15
+ required: true
16
+ example: 'Draft Email'
17
+
18
+ body:
19
+ type: string
20
+ description: Email body content (plain text or HTML)
21
+ required: true
22
+ example: 'This is a draft email'
23
+
24
+ cc:
25
+ type: string
26
+ description: CC email addresses, comma-separated
27
+ required: false
28
+ example: 'cc@example.com'
29
+
30
+ bcc:
31
+ type: string
32
+ description: BCC email addresses, comma-separated
33
+ required: false
34
+ example: 'bcc@example.com'
35
+
36
+ isHtml:
37
+ type: boolean
38
+ description: Whether the body content is HTML (default is plain text)
39
+ required: false
40
+ default: false
41
+
42
+ raw:
43
+ type: string
44
+ description: 'Base64url-encoded MIME message (RFC 2822 format). If provided, overrides to/subject/body/cc/bcc parameters.'
45
+ required: false
46
+ example: 'VG8...'
47
+
48
+ execution:
49
+ type: http
50
+ method: POST
51
+ url: 'https://www.googleapis.com/gmail/v1/users/me/drafts'
52
+ headers:
53
+ Content-Type: 'application/json'
54
+ Authorization: 'Bearer {GMAIL_ACCESS_TOKEN}'
55
+
56
+ # Parameter encoding: automatically convert to/subject/body to MIME format
57
+ parameter_encoding:
58
+ - source: [to, subject, body, cc, bcc, isHtml]
59
+ target: raw
60
+ encoding: mime_rfc2822_base64url
61
+
62
+ body:
63
+ message:
64
+ raw: '{raw}'
65
+
66
+ authentication:
67
+ type: oauth2
68
+ provider: google
69
+ scopes:
70
+ - 'https://www.googleapis.com/auth/gmail.compose'
71
+
72
+ output_schema:
73
+ type: object
74
+ properties:
75
+ id:
76
+ type: string
77
+ description: Draft ID
78
+ message:
79
+ type: object
80
+ description: The created message object
81
+ properties:
82
+ id:
83
+ type: string
84
+ threadId:
85
+ type: string
86
+ labelIds:
87
+ type: array
88
+ items:
89
+ type: string
90
+
91
+ error_handling:
92
+ retry: 3
93
+ backoff_type: exponential
94
+ initial_delay_ms: 1000
95
+ retryable_status_codes:
96
+ - 429
97
+ - 500
98
+ - 502
99
+ - 503
@@ -0,0 +1,38 @@
1
+ name: gmail-delete-message
2
+ description: Permanently delete a message from Gmail (cannot be undone)
3
+ version: '1.0.0'
4
+
5
+ parameters:
6
+ messageId:
7
+ type: string
8
+ description: ID of the message to delete
9
+ required: true
10
+ example: '187a65b7f3f2f11e'
11
+
12
+ execution:
13
+ type: http
14
+ method: DELETE
15
+ url: 'https://www.googleapis.com/gmail/v1/users/me/messages/{messageId}'
16
+ headers:
17
+ Authorization: 'Bearer {GMAIL_ACCESS_TOKEN}'
18
+ note: 'Immediately and permanently deletes the message. This operation cannot be undone. Use trash instead if you want to allow recovery.'
19
+
20
+ authentication:
21
+ type: oauth2
22
+ provider: google
23
+ scopes:
24
+ - 'https://www.googleapis.com/auth/gmail.modify'
25
+
26
+ output_schema:
27
+ type: object
28
+ description: Empty response on successful deletion (204 No Content). The executor may return an empty body for 204 responses.
29
+
30
+ error_handling:
31
+ retry: 3
32
+ backoff_type: exponential
33
+ initial_delay_ms: 1000
34
+ retryable_status_codes:
35
+ - 429
36
+ - 500
37
+ - 502
38
+ - 503
@@ -0,0 +1,90 @@
1
+ name: gmail-get-message
2
+ description: Get full details of a specific Gmail message including headers and body
3
+ version: '1.0.0'
4
+
5
+ parameters:
6
+ messageId:
7
+ type: string
8
+ description: ID of the message to retrieve
9
+ required: true
10
+ example: '187a65b7f3f2f11e'
11
+
12
+ format:
13
+ type: string
14
+ enum:
15
+ - minimal
16
+ - full
17
+ - raw
18
+ description: Format of the message to return
19
+ required: false
20
+ default: full
21
+ example: full
22
+
23
+ metadataHeaders:
24
+ type: string
25
+ description: Comma-separated headers to include in metadata (when format=minimal)
26
+ required: false
27
+ example: 'From,Subject,Date'
28
+
29
+ execution:
30
+ type: http
31
+ method: GET
32
+ url: 'https://www.googleapis.com/gmail/v1/users/me/messages/{messageId}'
33
+ query_params:
34
+ format: '{format}'
35
+ metadataHeaders: '{metadataHeaders}'
36
+ headers:
37
+ Authorization: 'Bearer {GMAIL_ACCESS_TOKEN}'
38
+ Accept: 'application/json'
39
+
40
+ authentication:
41
+ type: oauth2
42
+ provider: google
43
+ scopes:
44
+ - 'https://www.googleapis.com/auth/gmail.readonly'
45
+
46
+ output_schema:
47
+ type: object
48
+ properties:
49
+ id:
50
+ type: string
51
+ description: Message ID
52
+ threadId:
53
+ type: string
54
+ description: Thread ID
55
+ labelIds:
56
+ type: array
57
+ items:
58
+ type: string
59
+ description: Array of label IDs applied to this message
60
+ snippet:
61
+ type: string
62
+ description: Short snippet of the message text
63
+ sizeEstimate:
64
+ type: number
65
+ description: Estimated size of the message in bytes
66
+ headers:
67
+ type: object
68
+ description: Message headers (From, To, Subject, Date, etc.)
69
+ body:
70
+ type: object
71
+ description: Message body with data and mimeType
72
+ properties:
73
+ mimeType:
74
+ type: string
75
+ data:
76
+ type: string
77
+ description: Message body data (base64 encoded if raw format)
78
+ error:
79
+ type: string
80
+ description: Error message if request failed
81
+
82
+ error_handling:
83
+ retry: 3
84
+ backoff_type: exponential
85
+ initial_delay_ms: 1000
86
+ retryable_status_codes:
87
+ - 429
88
+ - 500
89
+ - 502
90
+ - 503
@@ -0,0 +1,84 @@
1
+ name: gmail-list-messages
2
+ description: List messages from Gmail mailbox with filtering and pagination
3
+ version: '1.0.0'
4
+
5
+ parameters:
6
+ query:
7
+ type: string
8
+ description: Gmail search query (e.g., 'from:user@example.com', 'subject:hello', 'is:unread')
9
+ required: false
10
+ example: 'is:unread'
11
+
12
+ maxResults:
13
+ type: number
14
+ description: Maximum number of messages to return (1-500, defaults to 100)
15
+ required: false
16
+ default: 100
17
+ example: 20
18
+
19
+ pageToken:
20
+ type: string
21
+ description: Page token for pagination
22
+ required: false
23
+ example: 'NEXT_PAGE_TOKEN'
24
+
25
+ includeSpamTrash:
26
+ type: boolean
27
+ description: Include spam and trash in results (defaults to false)
28
+ required: false
29
+ default: false
30
+
31
+ labelIds:
32
+ type: string
33
+ description: Comma-separated label IDs to filter by
34
+ required: false
35
+ example: 'INBOX,IMPORTANT'
36
+
37
+ execution:
38
+ type: http
39
+ method: GET
40
+ url: 'https://www.googleapis.com/gmail/v1/users/me/messages'
41
+ query_params:
42
+ q: '{query}'
43
+ maxResults: '{maxResults}'
44
+ pageToken: '{pageToken}'
45
+ includeSpamTrash: '{includeSpamTrash}'
46
+ labelIds: '{labelIds}'
47
+ headers:
48
+ Authorization: 'Bearer {GMAIL_ACCESS_TOKEN}'
49
+
50
+ authentication:
51
+ type: oauth2
52
+ provider: google
53
+ scopes:
54
+ - 'https://www.googleapis.com/auth/gmail.readonly'
55
+
56
+ output_schema:
57
+ type: object
58
+ properties:
59
+ messages:
60
+ type: array
61
+ description: List of message objects (contains only id and threadId)
62
+ items:
63
+ type: object
64
+ properties:
65
+ id:
66
+ type: string
67
+ threadId:
68
+ type: string
69
+ nextPageToken:
70
+ type: string
71
+ description: Token for fetching next page of results
72
+ resultSizeEstimate:
73
+ type: number
74
+ description: Estimated total number of results
75
+
76
+ error_handling:
77
+ retry: 3
78
+ backoff_type: exponential
79
+ initial_delay_ms: 1000
80
+ retryable_status_codes:
81
+ - 429
82
+ - 500
83
+ - 502
84
+ - 503
@@ -0,0 +1,95 @@
1
+ name: gmail-send-email
2
+ description: Send an email using Gmail API with MIME format encoding
3
+ version: '1.0.0'
4
+
5
+ parameters:
6
+ to:
7
+ type: string
8
+ description: Email address of the recipient(s), comma-separated for multiple recipients
9
+ required: true
10
+ example: 'user@example.com'
11
+
12
+ subject:
13
+ type: string
14
+ description: Subject line of the email
15
+ required: true
16
+ example: 'Hello from Matimo'
17
+
18
+ body:
19
+ type: string
20
+ description: Email body content (plain text or HTML)
21
+ required: true
22
+ example: 'This is a test email from Matimo'
23
+
24
+ cc:
25
+ type: string
26
+ description: CC email addresses, comma-separated
27
+ required: false
28
+ example: 'cc@example.com'
29
+
30
+ bcc:
31
+ type: string
32
+ description: BCC email addresses, comma-separated
33
+ required: false
34
+ example: 'bcc@example.com'
35
+
36
+ isHtml:
37
+ type: boolean
38
+ description: Whether the body content is HTML (default is plain text)
39
+ required: false
40
+ default: false
41
+
42
+ raw:
43
+ type: string
44
+ description: 'Base64url-encoded MIME message (RFC 2822 format). If provided, overrides to/subject/body/cc/bcc parameters.'
45
+ required: false
46
+ example: 'VG8...'
47
+
48
+ execution:
49
+ type: http
50
+ method: POST
51
+ url: 'https://www.googleapis.com/gmail/v1/users/me/messages/send'
52
+ headers:
53
+ Content-Type: 'application/json'
54
+ Authorization: 'Bearer {GMAIL_ACCESS_TOKEN}'
55
+
56
+ # Parameter encoding: automatically convert to/subject/body to MIME format
57
+ parameter_encoding:
58
+ - source: [to, subject, body, cc, bcc, isHtml]
59
+ target: raw
60
+ encoding: mime_rfc2822_base64url
61
+
62
+ body:
63
+ raw: '{raw}'
64
+
65
+ authentication:
66
+ type: oauth2
67
+ provider: google
68
+ scopes:
69
+ - 'https://www.googleapis.com/auth/gmail.send'
70
+
71
+ output_schema:
72
+ type: object
73
+ properties:
74
+ id:
75
+ type: string
76
+ description: Message ID of the sent email
77
+ threadId:
78
+ type: string
79
+ description: Thread ID of the sent email
80
+ labelIds:
81
+ type: array
82
+ items:
83
+ type: string
84
+ description: Label IDs applied to the message
85
+
86
+ error_handling:
87
+ retry: 3
88
+ backoff_type: exponential
89
+ initial_delay_ms: 1000
90
+ max_delay_ms: 10000
91
+ retryable_status_codes:
92
+ - 429
93
+ - 500
94
+ - 502
95
+ - 503