@matimo/gmail 0.1.0-alpha.4 → 0.1.0-alpha.5
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.
- package/{tools/README.md → README.md} +96 -38
- package/package.json +3 -3
|
@@ -1,53 +1,111 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @matimo/gmail - Gmail Tools for Matimo
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Gmail integration tools for Matimo's universal AI tools ecosystem. Send emails, manage drafts, and read messages through YAML-defined tools that work with any AI framework.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 📦 Installation
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
```bash
|
|
8
|
+
npm install @matimo/gmail
|
|
9
|
+
# or
|
|
10
|
+
pnpm add @matimo/gmail
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## 🛠️ Available Tools
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
| Tool | Description | API Method |
|
|
16
|
+
|------|-------------|------------|
|
|
17
|
+
| `gmail-send-email` | Send email to recipients | Gmail API send |
|
|
18
|
+
| `gmail-create-draft` | Create email draft | Gmail API drafts.create |
|
|
19
|
+
| `gmail-list-messages` | List recent messages | Gmail API messages.list |
|
|
20
|
+
|
|
21
|
+
## 🚀 Quick Start
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
import { MatimoInstance } from 'matimo';
|
|
16
25
|
|
|
17
|
-
|
|
26
|
+
const matimo = await MatimoInstance.init({ autoDiscover: true });
|
|
18
27
|
|
|
19
|
-
|
|
28
|
+
// Send an email
|
|
29
|
+
await matimo.execute('gmail-send-email', {
|
|
30
|
+
to: 'recipient@example.com',
|
|
31
|
+
subject: 'Hello from Matimo',
|
|
32
|
+
body: 'This email was sent by AI!'
|
|
33
|
+
});
|
|
20
34
|
|
|
35
|
+
// List recent messages
|
|
36
|
+
const messages = await matimo.execute('gmail-list-messages', {
|
|
37
|
+
maxResults: 10
|
|
38
|
+
});
|
|
21
39
|
```
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
│ - Execution configuration (command/HTTP) │
|
|
30
|
-
└─────────────────────────────────────────────────────────────┘
|
|
31
|
-
↓
|
|
32
|
-
┌───────────────────┴────────────────────┐
|
|
33
|
-
↓ ↓
|
|
34
|
-
SDK API MCP Server (comming soon)
|
|
35
|
-
(JavaScript) (Claude)
|
|
36
|
-
↓ ↓
|
|
37
|
-
- matimo.execute() - Claude can use
|
|
38
|
-
- LangChain tools natively
|
|
39
|
-
- CrewAI agents
|
|
40
|
-
- Custom code
|
|
40
|
+
|
|
41
|
+
## 🔐 Authentication
|
|
42
|
+
|
|
43
|
+
Set your Gmail OAuth2 access token:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
export GMAIL_ACCESS_TOKEN="ya29.a0AfH6SMBx..."
|
|
41
47
|
```
|
|
42
48
|
|
|
43
|
-
|
|
49
|
+
Or use environment variables in your application.
|
|
44
50
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
51
|
+
## 📚 Integration Examples
|
|
52
|
+
|
|
53
|
+
### With LangChain
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
import { MatimoInstance } from 'matimo';
|
|
57
|
+
import { ChatOpenAI } from '@langchain/openai';
|
|
58
|
+
|
|
59
|
+
const matimo = await MatimoInstance.init({ autoDiscover: true });
|
|
60
|
+
const tools = matimo.listTools().filter(t => t.name.startsWith('gmail'));
|
|
61
|
+
|
|
62
|
+
// Use with LangChain agent
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### With Custom Code
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
import { MatimoInstance } from 'matimo';
|
|
69
|
+
|
|
70
|
+
class GmailAgent {
|
|
71
|
+
private matimo: MatimoInstance;
|
|
72
|
+
|
|
73
|
+
constructor() {
|
|
74
|
+
this.matimo = await MatimoInstance.init({ autoDiscover: true });
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
async sendEmail(to: string, subject: string, body: string) {
|
|
78
|
+
return await this.matimo.execute('gmail-send-email', { to, subject, body });
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## 🔗 API Reference
|
|
84
|
+
|
|
85
|
+
All tools are based on the official Gmail REST API. See [Gmail API Documentation](https://developers.google.com/gmail/api).
|
|
86
|
+
|
|
87
|
+
| Tool | Gmail API Method | OAuth Scopes |
|
|
88
|
+
|------|------------------|--------------|
|
|
89
|
+
| gmail-send-email | gmail.send | https://www.googleapis.com/auth/gmail.send |
|
|
90
|
+
| gmail-create-draft | drafts.create | https://www.googleapis.com/auth/gmail.compose |
|
|
91
|
+
| gmail-list-messages | messages.list | https://www.googleapis.com/auth/gmail.readonly |
|
|
92
|
+
|
|
93
|
+
## 📋 Tool Specifications
|
|
94
|
+
|
|
95
|
+
Each tool is defined in YAML with complete parameter validation and error handling. Tools include:
|
|
96
|
+
|
|
97
|
+
- **Parameter validation** with Zod schemas
|
|
98
|
+
- **OAuth2 authentication** with automatic token injection
|
|
99
|
+
- **Error handling** with structured error codes
|
|
100
|
+
- **Output validation** against defined schemas
|
|
101
|
+
|
|
102
|
+
## 🤝 Contributing
|
|
103
|
+
|
|
104
|
+
Found a bug or want to add a Gmail tool? See [Contributing Guide](../../CONTRIBUTING.md) and [Adding Tools Guide](../tool-development/ADDING_TOOLS.md).
|
|
105
|
+
|
|
106
|
+
---
|
|
49
107
|
|
|
50
|
-
|
|
108
|
+
**Part of the Matimo ecosystem** - Define tools once, use them everywhere! 🎯
|
|
51
109
|
|
|
52
110
|
YAML keeps tool definitions **maintainable, readable, and contributor-friendly**:
|
|
53
111
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@matimo/gmail",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.5",
|
|
4
4
|
"description": "Gmail tools for Matimo",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"definition.yaml"
|
|
10
10
|
],
|
|
11
11
|
"peerDependencies": {
|
|
12
|
-
"matimo": "
|
|
12
|
+
"matimo": "0.1.0-alpha.5"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"axios": "^1.13.4",
|
|
16
|
-
"@matimo/core": "0.1.0-alpha.
|
|
16
|
+
"@matimo/core": "0.1.0-alpha.5"
|
|
17
17
|
}
|
|
18
18
|
}
|