@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.
@@ -1,53 +1,111 @@
1
- # Matimo Gmail Tools Ecosystem
1
+ # @matimo/gmail - Gmail Tools for Matimo
2
2
 
3
- Complete guide to Gmail tools in Matimo: OAuth2 setup, YAML architecture, tool ecosystem, and integration patterns.
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
- ## 📋 Table of Contents
5
+ ## 📦 Installation
6
6
 
7
- - [Ecosystem Overview](#ecosystem-overview)
8
- - [YAML-Based Tool Architecture](#yaml-based-tool-architecture)
9
- - [Quick Start](#quick-start)
10
- - [Available Tools](#available-tools)
11
- - [Integration Patterns](#integration-patterns)
12
- - [Advanced Usage](#advanced-usage)
13
- - [Security & Best Practices](#security--best-practices)
7
+ ```bash
8
+ npm install @matimo/gmail
9
+ # or
10
+ pnpm add @matimo/gmail
11
+ ```
12
+
13
+ ## 🛠️ Available Tools
14
14
 
15
- ## Ecosystem Overview
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
- ### What is the Gmail Tool Ecosystem?
26
+ const matimo = await MatimoInstance.init({ autoDiscover: true });
18
27
 
19
- The Gmail tools are part of Matimo's universal AI tools ecosystem. Unlike traditional libraries where each tool requires custom code, **Gmail tools are defined once in YAML and work everywhere**:
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
- │ YAML Tool Definition │
24
- │ (tools/gmail/send-email/definition.yaml) │
25
- │ - What the tool does │
26
- │ - Input parameters & validation │
27
- │ - Authentication requirements │
28
- │ - Output schema │
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
- **Key Principle: Define Once, Use Everywhere**
49
+ Or use environment variables in your application.
44
50
 
45
- - One YAML file per tool
46
- - ✅ Works with any framework (LangChain, CrewAI, custom code)
47
- - No code changes needed to add/modify tools
48
- - ✅ Scales to 1000s of tools
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
- ### Why YAML?
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.4",
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": "^0.1.0-alpha.4"
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.4"
16
+ "@matimo/core": "0.1.0-alpha.5"
17
17
  }
18
18
  }