matimo-hubspot 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.
- matimo_hubspot-0.1.0/.gitignore +63 -0
- matimo_hubspot-0.1.0/PKG-INFO +156 -0
- matimo_hubspot-0.1.0/README.md +142 -0
- matimo_hubspot-0.1.0/pyproject.toml +27 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/__init__.py +17 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-create-company/definition.yaml +57 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-create-contact/definition.yaml +79 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-create-custom-object/definition.yaml +57 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-create-deal/definition.yaml +69 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-create-invoice/definition.yaml +47 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-create-lead/definition.yaml +73 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-create-line-item/definition.yaml +64 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-create-order/definition.yaml +63 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-create-product/definition.yaml +58 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-create-ticket/definition.yaml +64 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-delete-company/definition.yaml +43 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-delete-contact/definition.yaml +43 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-delete-custom-object/definition.yaml +43 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-delete-deal/definition.yaml +43 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-delete-invoice/definition.yaml +38 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-delete-lead/definition.yaml +38 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-delete-line-item/definition.yaml +38 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-delete-order/definition.yaml +38 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-delete-product/definition.yaml +38 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-delete-ticket/definition.yaml +43 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-get-company/definition.yaml +49 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-get-contact/definition.yaml +56 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-get-custom-object/definition.yaml +54 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-get-deal/definition.yaml +42 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-get-invoice/definition.yaml +49 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-get-lead/definition.yaml +55 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-get-line-item/definition.yaml +49 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-get-order/definition.yaml +49 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-get-product/definition.yaml +49 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-get-ticket/definition.yaml +42 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-list-companies/definition.yaml +49 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-list-contacts/definition.yaml +59 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-list-custom-objects/definition.yaml +60 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-list-deals/definition.yaml +49 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-list-invoices/definition.yaml +55 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-list-leads/definition.yaml +61 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-list-line-items/definition.yaml +55 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-list-orders/definition.yaml +55 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-list-products/definition.yaml +55 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-list-tickets/definition.yaml +49 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-update-company/definition.yaml +54 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-update-contact/definition.yaml +62 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-update-custom-object/definition.yaml +57 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-update-deal/definition.yaml +54 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-update-invoice/definition.yaml +52 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-update-lead/definition.yaml +55 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-update-line-item/definition.yaml +52 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-update-order/definition.yaml +52 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-update-product/definition.yaml +52 -0
- matimo_hubspot-0.1.0/src/matimo_hubspot/tools/hubspot-update-ticket/definition.yaml +54 -0
|
@@ -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,156 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: matimo-hubspot
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Matimo provider — HubSpot CRM tools (contacts, deals, companies, tickets)
|
|
5
|
+
License: MIT
|
|
6
|
+
Keywords: agents,ai,hubspot,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-hubspot
|
|
16
|
+
|
|
17
|
+
> HubSpot CRM tools for [Matimo](https://matimo.dev) — manage contacts, companies, deals, tickets, and more.
|
|
18
|
+
|
|
19
|
+
[](https://pypi.org/project/matimo-hubspot/)
|
|
20
|
+
[](https://matimo.dev/docs)
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pip install matimo matimo-hubspot
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Available Tools (50 Total)
|
|
33
|
+
|
|
34
|
+
Full CRUD coverage across 10 HubSpot object types:
|
|
35
|
+
|
|
36
|
+
| Object | Create | Get | List | Update | Delete |
|
|
37
|
+
|--------|:------:|:---:|:----:|:------:|:------:|
|
|
38
|
+
| Contacts | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
39
|
+
| Companies | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
40
|
+
| Deals | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
41
|
+
| Tickets | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
42
|
+
| Leads | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
43
|
+
| Products | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
44
|
+
| Line Items | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
45
|
+
| Orders | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
46
|
+
| Invoices | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
47
|
+
| Custom Objects | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
48
|
+
|
|
49
|
+
### Tool naming convention: `hubspot-{verb}-{object}`
|
|
50
|
+
|
|
51
|
+
Examples: `hubspot-create-contact`, `hubspot-list-deals`, `hubspot-update-ticket`, `hubspot-delete-company`
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Quick Start
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
import asyncio
|
|
59
|
+
import os
|
|
60
|
+
from matimo import Matimo
|
|
61
|
+
from matimo_hubspot import get_tools_path
|
|
62
|
+
|
|
63
|
+
async def main():
|
|
64
|
+
matimo = await Matimo.init(get_tools_path())
|
|
65
|
+
|
|
66
|
+
# Create a contact
|
|
67
|
+
contact = await matimo.execute('hubspot-create-contact', {
|
|
68
|
+
'firstname': 'Jane',
|
|
69
|
+
'lastname': 'Smith',
|
|
70
|
+
'email': 'jane@example.com',
|
|
71
|
+
'company': 'Acme Corp',
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
# List all deals
|
|
75
|
+
deals = await matimo.execute('hubspot-list-deals', {
|
|
76
|
+
'limit': 20,
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
# Update a ticket
|
|
80
|
+
await matimo.execute('hubspot-update-ticket', {
|
|
81
|
+
'ticket_id': '12345',
|
|
82
|
+
'subject': 'Updated subject',
|
|
83
|
+
'hs_pipeline_stage': '4',
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
asyncio.run(main())
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Authentication
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
export HUBSPOT_ACCESS_TOKEN="pat-na1-your-private-app-token"
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Setting Up a HubSpot Private App
|
|
98
|
+
|
|
99
|
+
1. In HubSpot, go to **Settings** → **Integrations** → **Private Apps**
|
|
100
|
+
2. Click **Create a private app**
|
|
101
|
+
3. Under **Scopes**, select the CRM scopes you need (see table below)
|
|
102
|
+
4. Copy the **Access Token**
|
|
103
|
+
|
|
104
|
+
### Required Scopes by Object
|
|
105
|
+
|
|
106
|
+
| Objects | Scopes |
|
|
107
|
+
|---------|--------|
|
|
108
|
+
| Contacts | `crm.objects.contacts.read`, `crm.objects.contacts.write` |
|
|
109
|
+
| Companies | `crm.objects.companies.read`, `crm.objects.companies.write` |
|
|
110
|
+
| Deals | `crm.objects.deals.read`, `crm.objects.deals.write` |
|
|
111
|
+
| Tickets | `tickets` (read + write) |
|
|
112
|
+
| Custom Objects | `crm.objects.custom.read`, `crm.objects.custom.write` |
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## LangChain CRM Agent Example
|
|
117
|
+
|
|
118
|
+
```python
|
|
119
|
+
from matimo import Matimo
|
|
120
|
+
from matimo_hubspot import get_tools_path
|
|
121
|
+
from matimo.integrations.langchain import convert_tools_to_langchain
|
|
122
|
+
from langchain_openai import ChatOpenAI
|
|
123
|
+
from langchain.agents import AgentExecutor, create_tool_calling_agent
|
|
124
|
+
from langchain_core.prompts import ChatPromptTemplate
|
|
125
|
+
|
|
126
|
+
matimo = await Matimo.init(get_tools_path())
|
|
127
|
+
lc_tools = convert_tools_to_langchain(
|
|
128
|
+
matimo.list_tools(), matimo,
|
|
129
|
+
credentials={'HUBSPOT_ACCESS_TOKEN': os.environ['HUBSPOT_ACCESS_TOKEN']},
|
|
130
|
+
)
|
|
131
|
+
llm = ChatOpenAI(model='gpt-4o-mini')
|
|
132
|
+
prompt = ChatPromptTemplate.from_messages([
|
|
133
|
+
('system', 'You are a CRM assistant.'),
|
|
134
|
+
('human', '{input}'),
|
|
135
|
+
('placeholder', '{agent_scratchpad}'),
|
|
136
|
+
])
|
|
137
|
+
agent = create_tool_calling_agent(llm, lc_tools, prompt)
|
|
138
|
+
executor = AgentExecutor(agent=agent, tools=lc_tools)
|
|
139
|
+
result = await executor.ainvoke({'input': 'Find all open deals and summarize pipeline status'})
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Documentation
|
|
145
|
+
|
|
146
|
+
- [HubSpot CRM API](https://developers.hubspot.com/docs/api/crm/crm-introduction)
|
|
147
|
+
- [Python Examples](https://github.com/tallclub/matimo/tree/main/python/examples/native/hubspot)
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Links
|
|
152
|
+
|
|
153
|
+
- **PyPI:** https://pypi.org/project/matimo-hubspot/
|
|
154
|
+
- **GitHub:** https://github.com/tallclub/matimo
|
|
155
|
+
- **HubSpot Developer Docs:** https://developers.hubspot.com/
|
|
156
|
+
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# matimo-hubspot
|
|
2
|
+
|
|
3
|
+
> HubSpot CRM tools for [Matimo](https://matimo.dev) — manage contacts, companies, deals, tickets, and more.
|
|
4
|
+
|
|
5
|
+
[](https://pypi.org/project/matimo-hubspot/)
|
|
6
|
+
[](https://matimo.dev/docs)
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pip install matimo matimo-hubspot
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Available Tools (50 Total)
|
|
19
|
+
|
|
20
|
+
Full CRUD coverage across 10 HubSpot object types:
|
|
21
|
+
|
|
22
|
+
| Object | Create | Get | List | Update | Delete |
|
|
23
|
+
|--------|:------:|:---:|:----:|:------:|:------:|
|
|
24
|
+
| Contacts | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
25
|
+
| Companies | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
26
|
+
| Deals | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
27
|
+
| Tickets | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
28
|
+
| Leads | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
29
|
+
| Products | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
30
|
+
| Line Items | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
31
|
+
| Orders | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
32
|
+
| Invoices | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
33
|
+
| Custom Objects | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
34
|
+
|
|
35
|
+
### Tool naming convention: `hubspot-{verb}-{object}`
|
|
36
|
+
|
|
37
|
+
Examples: `hubspot-create-contact`, `hubspot-list-deals`, `hubspot-update-ticket`, `hubspot-delete-company`
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Quick Start
|
|
42
|
+
|
|
43
|
+
```python
|
|
44
|
+
import asyncio
|
|
45
|
+
import os
|
|
46
|
+
from matimo import Matimo
|
|
47
|
+
from matimo_hubspot import get_tools_path
|
|
48
|
+
|
|
49
|
+
async def main():
|
|
50
|
+
matimo = await Matimo.init(get_tools_path())
|
|
51
|
+
|
|
52
|
+
# Create a contact
|
|
53
|
+
contact = await matimo.execute('hubspot-create-contact', {
|
|
54
|
+
'firstname': 'Jane',
|
|
55
|
+
'lastname': 'Smith',
|
|
56
|
+
'email': 'jane@example.com',
|
|
57
|
+
'company': 'Acme Corp',
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
# List all deals
|
|
61
|
+
deals = await matimo.execute('hubspot-list-deals', {
|
|
62
|
+
'limit': 20,
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
# Update a ticket
|
|
66
|
+
await matimo.execute('hubspot-update-ticket', {
|
|
67
|
+
'ticket_id': '12345',
|
|
68
|
+
'subject': 'Updated subject',
|
|
69
|
+
'hs_pipeline_stage': '4',
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
asyncio.run(main())
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Authentication
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
export HUBSPOT_ACCESS_TOKEN="pat-na1-your-private-app-token"
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Setting Up a HubSpot Private App
|
|
84
|
+
|
|
85
|
+
1. In HubSpot, go to **Settings** → **Integrations** → **Private Apps**
|
|
86
|
+
2. Click **Create a private app**
|
|
87
|
+
3. Under **Scopes**, select the CRM scopes you need (see table below)
|
|
88
|
+
4. Copy the **Access Token**
|
|
89
|
+
|
|
90
|
+
### Required Scopes by Object
|
|
91
|
+
|
|
92
|
+
| Objects | Scopes |
|
|
93
|
+
|---------|--------|
|
|
94
|
+
| Contacts | `crm.objects.contacts.read`, `crm.objects.contacts.write` |
|
|
95
|
+
| Companies | `crm.objects.companies.read`, `crm.objects.companies.write` |
|
|
96
|
+
| Deals | `crm.objects.deals.read`, `crm.objects.deals.write` |
|
|
97
|
+
| Tickets | `tickets` (read + write) |
|
|
98
|
+
| Custom Objects | `crm.objects.custom.read`, `crm.objects.custom.write` |
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## LangChain CRM Agent Example
|
|
103
|
+
|
|
104
|
+
```python
|
|
105
|
+
from matimo import Matimo
|
|
106
|
+
from matimo_hubspot import get_tools_path
|
|
107
|
+
from matimo.integrations.langchain import convert_tools_to_langchain
|
|
108
|
+
from langchain_openai import ChatOpenAI
|
|
109
|
+
from langchain.agents import AgentExecutor, create_tool_calling_agent
|
|
110
|
+
from langchain_core.prompts import ChatPromptTemplate
|
|
111
|
+
|
|
112
|
+
matimo = await Matimo.init(get_tools_path())
|
|
113
|
+
lc_tools = convert_tools_to_langchain(
|
|
114
|
+
matimo.list_tools(), matimo,
|
|
115
|
+
credentials={'HUBSPOT_ACCESS_TOKEN': os.environ['HUBSPOT_ACCESS_TOKEN']},
|
|
116
|
+
)
|
|
117
|
+
llm = ChatOpenAI(model='gpt-4o-mini')
|
|
118
|
+
prompt = ChatPromptTemplate.from_messages([
|
|
119
|
+
('system', 'You are a CRM assistant.'),
|
|
120
|
+
('human', '{input}'),
|
|
121
|
+
('placeholder', '{agent_scratchpad}'),
|
|
122
|
+
])
|
|
123
|
+
agent = create_tool_calling_agent(llm, lc_tools, prompt)
|
|
124
|
+
executor = AgentExecutor(agent=agent, tools=lc_tools)
|
|
125
|
+
result = await executor.ainvoke({'input': 'Find all open deals and summarize pipeline status'})
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Documentation
|
|
131
|
+
|
|
132
|
+
- [HubSpot CRM API](https://developers.hubspot.com/docs/api/crm/crm-introduction)
|
|
133
|
+
- [Python Examples](https://github.com/tallclub/matimo/tree/main/python/examples/native/hubspot)
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## Links
|
|
138
|
+
|
|
139
|
+
- **PyPI:** https://pypi.org/project/matimo-hubspot/
|
|
140
|
+
- **GitHub:** https://github.com/tallclub/matimo
|
|
141
|
+
- **HubSpot Developer Docs:** https://developers.hubspot.com/
|
|
142
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "matimo-hubspot"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Matimo provider — HubSpot CRM tools (contacts, deals, companies, tickets)"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { text = "MIT" }
|
|
11
|
+
requires-python = ">=3.11"
|
|
12
|
+
keywords = ["ai", "tools", "agents", "matimo", "hubspot"]
|
|
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
|
+
hubspot = "matimo_hubspot:get_tools_path"
|
|
25
|
+
|
|
26
|
+
[tool.hatch.build.targets.wheel]
|
|
27
|
+
packages = ["src/matimo_hubspot"]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""Matimo hubspot 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 hubspot tool definitions."""
|
|
10
|
+
try:
|
|
11
|
+
ref = importlib.resources.files("matimo_hubspot") / "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,57 @@
|
|
|
1
|
+
name: hubspot-create-company
|
|
2
|
+
version: '1.0.0'
|
|
3
|
+
description: Create a new company in HubSpot CRM.
|
|
4
|
+
|
|
5
|
+
parameters:
|
|
6
|
+
name:
|
|
7
|
+
type: string
|
|
8
|
+
required: true
|
|
9
|
+
description: Company name
|
|
10
|
+
domain:
|
|
11
|
+
type: string
|
|
12
|
+
required: false
|
|
13
|
+
description: Company domain
|
|
14
|
+
|
|
15
|
+
execution:
|
|
16
|
+
type: http
|
|
17
|
+
method: POST
|
|
18
|
+
url: 'https://api.hubapi.com/crm/v3/objects/companies'
|
|
19
|
+
headers:
|
|
20
|
+
Authorization: 'Bearer {MATIMO_HUBSPOT_API_KEY}'
|
|
21
|
+
Content-Type: application/json
|
|
22
|
+
body:
|
|
23
|
+
properties:
|
|
24
|
+
name: '{name}'
|
|
25
|
+
domain: '{domain}'
|
|
26
|
+
timeout: 30000
|
|
27
|
+
|
|
28
|
+
authentication:
|
|
29
|
+
type: bearer
|
|
30
|
+
location: header
|
|
31
|
+
name: Authorization
|
|
32
|
+
notes:
|
|
33
|
+
env: MATIMO_HUBSPOT_API_KEY
|
|
34
|
+
|
|
35
|
+
output_schema:
|
|
36
|
+
type: object
|
|
37
|
+
properties:
|
|
38
|
+
id: { type: string }
|
|
39
|
+
properties: { type: object }
|
|
40
|
+
createdAt: { type: string }
|
|
41
|
+
required: [id, properties]
|
|
42
|
+
|
|
43
|
+
error_handling:
|
|
44
|
+
retry: 2
|
|
45
|
+
backoff_type: exponential
|
|
46
|
+
initial_delay_ms: 500
|
|
47
|
+
|
|
48
|
+
examples:
|
|
49
|
+
- name: 'Create company with name'
|
|
50
|
+
params:
|
|
51
|
+
name: 'Acme Corp'
|
|
52
|
+
expected_result: 'Company created with id and properties.'
|
|
53
|
+
- name: 'Create company with name and domain'
|
|
54
|
+
params:
|
|
55
|
+
name: 'Tech Startup Inc'
|
|
56
|
+
domain: 'techstartup.com'
|
|
57
|
+
expected_result: 'Company created with name and domain.'
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
name: hubspot-create-contact
|
|
2
|
+
version: '1.0.0'
|
|
3
|
+
description: Create a new contact in HubSpot CRM.
|
|
4
|
+
|
|
5
|
+
parameters:
|
|
6
|
+
email:
|
|
7
|
+
type: string
|
|
8
|
+
required: true
|
|
9
|
+
description: Email address of the contact
|
|
10
|
+
firstname:
|
|
11
|
+
type: string
|
|
12
|
+
required: false
|
|
13
|
+
description: First name of the contact
|
|
14
|
+
lastname:
|
|
15
|
+
type: string
|
|
16
|
+
required: false
|
|
17
|
+
description: Last name of the contact
|
|
18
|
+
phone:
|
|
19
|
+
type: string
|
|
20
|
+
required: false
|
|
21
|
+
description: Phone number of the contact
|
|
22
|
+
company:
|
|
23
|
+
type: string
|
|
24
|
+
required: false
|
|
25
|
+
description: Company name of the contact
|
|
26
|
+
|
|
27
|
+
execution:
|
|
28
|
+
type: http
|
|
29
|
+
method: POST
|
|
30
|
+
url: 'https://api.hubapi.com/crm/v3/objects/contacts'
|
|
31
|
+
headers:
|
|
32
|
+
Authorization: 'Bearer {MATIMO_HUBSPOT_API_KEY}'
|
|
33
|
+
Content-Type: application/json
|
|
34
|
+
body:
|
|
35
|
+
properties:
|
|
36
|
+
email: '{email}'
|
|
37
|
+
firstname: '{firstname}'
|
|
38
|
+
lastname: '{lastname}'
|
|
39
|
+
phone: '{phone}'
|
|
40
|
+
company: '{company}'
|
|
41
|
+
timeout: 30000
|
|
42
|
+
|
|
43
|
+
authentication:
|
|
44
|
+
type: bearer
|
|
45
|
+
location: header
|
|
46
|
+
name: Authorization
|
|
47
|
+
notes:
|
|
48
|
+
env: MATIMO_HUBSPOT_API_KEY
|
|
49
|
+
|
|
50
|
+
output_schema:
|
|
51
|
+
type: object
|
|
52
|
+
properties:
|
|
53
|
+
id: { type: string }
|
|
54
|
+
properties: { type: object }
|
|
55
|
+
createdAt: { type: string }
|
|
56
|
+
updatedAt: { type: string }
|
|
57
|
+
archived: { type: boolean }
|
|
58
|
+
required: [id, properties, createdAt, updatedAt, archived]
|
|
59
|
+
|
|
60
|
+
error_handling:
|
|
61
|
+
retry: 2
|
|
62
|
+
backoff_type: exponential
|
|
63
|
+
initial_delay_ms: 500
|
|
64
|
+
|
|
65
|
+
examples:
|
|
66
|
+
- name: 'Create contact with email and name'
|
|
67
|
+
params:
|
|
68
|
+
email: 'test@example.com'
|
|
69
|
+
firstname: 'Test'
|
|
70
|
+
lastname: 'User'
|
|
71
|
+
expected_result: 'Contact created with id and properties.'
|
|
72
|
+
- name: 'Create contact with all fields'
|
|
73
|
+
params:
|
|
74
|
+
email: 'custom@example.com'
|
|
75
|
+
firstname: 'John'
|
|
76
|
+
lastname: 'Doe'
|
|
77
|
+
phone: '+1234567890'
|
|
78
|
+
company: 'Acme Corp'
|
|
79
|
+
expected_result: 'Contact created with all properties.'
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
name: hubspot-create-custom-object
|
|
2
|
+
version: '1.0.0'
|
|
3
|
+
description: Create a new custom object in HubSpot CRM.
|
|
4
|
+
|
|
5
|
+
parameters:
|
|
6
|
+
object_type:
|
|
7
|
+
type: string
|
|
8
|
+
required: true
|
|
9
|
+
description: The custom object type ID (e.g., 'my_custom_object')
|
|
10
|
+
name:
|
|
11
|
+
type: string
|
|
12
|
+
required: false
|
|
13
|
+
description: Custom object name
|
|
14
|
+
description:
|
|
15
|
+
type: string
|
|
16
|
+
required: false
|
|
17
|
+
description: Custom object description
|
|
18
|
+
|
|
19
|
+
execution:
|
|
20
|
+
type: http
|
|
21
|
+
method: POST
|
|
22
|
+
url: 'https://api.hubapi.com/crm/v3/objects/{object_type}'
|
|
23
|
+
headers:
|
|
24
|
+
Authorization: 'Bearer {MATIMO_HUBSPOT_API_KEY}'
|
|
25
|
+
Content-Type: application/json
|
|
26
|
+
body:
|
|
27
|
+
properties:
|
|
28
|
+
name: '{name}'
|
|
29
|
+
description: '{description}'
|
|
30
|
+
timeout: 30000
|
|
31
|
+
|
|
32
|
+
authentication:
|
|
33
|
+
type: bearer
|
|
34
|
+
location: header
|
|
35
|
+
name: Authorization
|
|
36
|
+
|
|
37
|
+
output_schema:
|
|
38
|
+
type: object
|
|
39
|
+
properties:
|
|
40
|
+
id:
|
|
41
|
+
type: string
|
|
42
|
+
properties:
|
|
43
|
+
type: object
|
|
44
|
+
|
|
45
|
+
error_handling:
|
|
46
|
+
retry: 2
|
|
47
|
+
backoff_type: exponential
|
|
48
|
+
initial_delay_ms: 500
|
|
49
|
+
|
|
50
|
+
requires_approval: false
|
|
51
|
+
|
|
52
|
+
examples:
|
|
53
|
+
- name: Create a custom object
|
|
54
|
+
params:
|
|
55
|
+
object_type: my_custom_object
|
|
56
|
+
name: Custom Object 1
|
|
57
|
+
expected_result: Custom object created with id and properties.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
name: hubspot-create-deal
|
|
2
|
+
version: '1.0.0'
|
|
3
|
+
description: Create a new deal in HubSpot CRM.
|
|
4
|
+
|
|
5
|
+
parameters:
|
|
6
|
+
dealname:
|
|
7
|
+
type: string
|
|
8
|
+
required: true
|
|
9
|
+
description: Name of the deal
|
|
10
|
+
dealstage:
|
|
11
|
+
type: string
|
|
12
|
+
required: true
|
|
13
|
+
description: Pipeline stage of the deal (e.g., negotiation, contractsent, won)
|
|
14
|
+
pipeline:
|
|
15
|
+
type: string
|
|
16
|
+
required: false
|
|
17
|
+
description: Pipeline ID (uses default if not specified)
|
|
18
|
+
amount:
|
|
19
|
+
type: number
|
|
20
|
+
required: false
|
|
21
|
+
description: Deal amount
|
|
22
|
+
closedate:
|
|
23
|
+
type: string
|
|
24
|
+
required: false
|
|
25
|
+
description: Close date in ISO format (YYYY-MM-DDTHH:mm:ss.sssZ)
|
|
26
|
+
|
|
27
|
+
execution:
|
|
28
|
+
type: http
|
|
29
|
+
method: POST
|
|
30
|
+
url: 'https://api.hubapi.com/crm/v3/objects/deals'
|
|
31
|
+
headers:
|
|
32
|
+
Authorization: 'Bearer {MATIMO_HUBSPOT_API_KEY}'
|
|
33
|
+
Content-Type: application/json
|
|
34
|
+
body:
|
|
35
|
+
properties:
|
|
36
|
+
dealname: '{dealname}'
|
|
37
|
+
dealstage: '{dealstage}'
|
|
38
|
+
pipeline: '{pipeline}'
|
|
39
|
+
amount: '{amount}'
|
|
40
|
+
closedate: '{closedate}'
|
|
41
|
+
timeout: 30000
|
|
42
|
+
|
|
43
|
+
authentication:
|
|
44
|
+
type: bearer
|
|
45
|
+
location: header
|
|
46
|
+
name: Authorization
|
|
47
|
+
notes:
|
|
48
|
+
env: MATIMO_HUBSPOT_API_KEY
|
|
49
|
+
|
|
50
|
+
output_schema:
|
|
51
|
+
type: object
|
|
52
|
+
properties:
|
|
53
|
+
id: { type: string }
|
|
54
|
+
properties: { type: object }
|
|
55
|
+
createdAt: { type: string }
|
|
56
|
+
required: [id, properties]
|
|
57
|
+
|
|
58
|
+
error_handling:
|
|
59
|
+
retry: 2
|
|
60
|
+
backoff_type: exponential
|
|
61
|
+
initial_delay_ms: 500
|
|
62
|
+
|
|
63
|
+
examples:
|
|
64
|
+
- name: 'Create deal with name and stage'
|
|
65
|
+
params:
|
|
66
|
+
dealname: 'Enterprise Sale'
|
|
67
|
+
dealstage: 'negotiation'
|
|
68
|
+
amount: 50000
|
|
69
|
+
expected_result: 'Deal created with id and properties.'
|