@wilnertech/halopsa-mcp-server 1.0.0 → 1.0.2
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/.env.example +18 -19
- package/LICENSE +21 -21
- package/README.md +205 -270
- package/dist/api/client.js +2 -2
- package/dist/api/client.js.map +1 -1
- package/dist/api/errors.js +1 -1
- package/dist/api/errors.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/schemas/common.d.ts +1 -1
- package/dist/schemas/common.js +1 -1
- package/dist/tools/assets.d.ts +4 -1
- package/dist/tools/assets.d.ts.map +1 -1
- package/dist/tools/assets.js +15 -7
- package/dist/tools/assets.js.map +1 -1
- package/dist/tools/reference-data.d.ts.map +1 -1
- package/dist/tools/reference-data.js +10 -4
- package/dist/tools/reference-data.js.map +1 -1
- package/dist/tools/sites.d.ts +2 -2
- package/dist/tools/sites.js +3 -3
- package/dist/tools/sites.js.map +1 -1
- package/dist/tools/users.d.ts +10 -1
- package/dist/tools/users.d.ts.map +1 -1
- package/dist/tools/users.js +25 -7
- package/dist/tools/users.js.map +1 -1
- package/dist/types/halopsa.d.ts +1 -1
- package/dist/types/halopsa.js +1 -1
- package/package.json +61 -61
package/.env.example
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
# HaloPSA MCP Server Environment Configuration
|
|
2
|
-
# Copy this file to .env and fill in your actual values
|
|
3
|
-
# NEVER commit the .env file to git
|
|
4
|
-
|
|
5
|
-
# HaloPSA OAuth2 Client ID (required)
|
|
6
|
-
# Get from: HaloPSA > Configuration > Integrations > API Applications
|
|
7
|
-
HALOPSA_CLIENT_ID=your-client-id-here
|
|
8
|
-
|
|
9
|
-
# HaloPSA OAuth2 Client Secret (required)
|
|
10
|
-
HALOPSA_CLIENT_SECRET=your-client-secret-here
|
|
11
|
-
|
|
12
|
-
# HaloPSA Base URL (
|
|
13
|
-
#
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
#
|
|
18
|
-
#
|
|
19
|
-
# HALOPSA_TEST_CLIENT_ID=123
|
|
1
|
+
# HaloPSA MCP Server Environment Configuration
|
|
2
|
+
# Copy this file to .env and fill in your actual values
|
|
3
|
+
# NEVER commit the .env file to git
|
|
4
|
+
|
|
5
|
+
# HaloPSA OAuth2 Client ID (required)
|
|
6
|
+
# Get from: HaloPSA > Configuration > Integrations > API Applications
|
|
7
|
+
HALOPSA_CLIENT_ID=your-client-id-here
|
|
8
|
+
|
|
9
|
+
# HaloPSA OAuth2 Client Secret (required)
|
|
10
|
+
HALOPSA_CLIENT_SECRET=your-client-secret-here
|
|
11
|
+
|
|
12
|
+
# HaloPSA Base URL (required)
|
|
13
|
+
# Your HaloPSA instance URL (e.g., https://your-instance.halopsa.com)
|
|
14
|
+
HALOPSA_BASE_URL=https://your-instance.halopsa.com
|
|
15
|
+
|
|
16
|
+
# Test Client ID (required for smoke tests only)
|
|
17
|
+
# A client ID to scope test resource creation/cleanup
|
|
18
|
+
# HALOPSA_TEST_CLIENT_ID=123
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026
|
|
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
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 halopsa-mcp-server contributors
|
|
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.
|
package/README.md
CHANGED
|
@@ -1,270 +1,205 @@
|
|
|
1
|
-
# HaloPSA MCP Server
|
|
2
|
-
|
|
3
|
-
Model Context Protocol server for HaloPSA API integration
|
|
4
|
-
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
**
|
|
8
|
-
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
- `
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
|
119
|
-
|
|
120
|
-
| `
|
|
121
|
-
| `
|
|
122
|
-
| `
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
|
135
|
-
|
|
136
|
-
| `
|
|
137
|
-
| `
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
|
145
|
-
|
|
146
|
-
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
|
153
|
-
|
|
154
|
-
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
| Sites | 5 min | Moderate change rate |
|
|
207
|
-
| Clients | 5 min | Moderate change rate |
|
|
208
|
-
| Reference data | 1 hour | Rarely changes |
|
|
209
|
-
|
|
210
|
-
## Token Optimization
|
|
211
|
-
|
|
212
|
-
All tools support `format_options` for reducing response size:
|
|
213
|
-
|
|
214
|
-
```json
|
|
215
|
-
{
|
|
216
|
-
"format_options": {
|
|
217
|
-
"format": "compact",
|
|
218
|
-
"fields": ["id", "name", "status_id"],
|
|
219
|
-
"omit_empty": true
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
**Formats:**
|
|
225
|
-
- `compact`: Minimal fields (id, name, status)
|
|
226
|
-
- `standard`: Default fields (no pretty-printing)
|
|
227
|
-
- `detailed`: All fields with pretty-printing
|
|
228
|
-
|
|
229
|
-
## Rate Limiting
|
|
230
|
-
|
|
231
|
-
- **Limit:** 60 requests/minute per client_id
|
|
232
|
-
- **Auto-throttling:** 1 second minimum between requests
|
|
233
|
-
- **Retry:** Exponential backoff on 429 errors (1s, 2s, 4s)
|
|
234
|
-
- **Token refresh:** 5 minutes before expiration
|
|
235
|
-
|
|
236
|
-
## Error Handling
|
|
237
|
-
|
|
238
|
-
The server provides detailed error responses:
|
|
239
|
-
|
|
240
|
-
```json
|
|
241
|
-
{
|
|
242
|
-
"error": true,
|
|
243
|
-
"error_type": "RateLimitExceeded",
|
|
244
|
-
"message": "HaloPSA API rate limit exceeded",
|
|
245
|
-
"details": {
|
|
246
|
-
"retry_after_seconds": 30
|
|
247
|
-
},
|
|
248
|
-
"suggestion": "Wait 30 seconds before retrying."
|
|
249
|
-
}
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
## Development
|
|
253
|
-
|
|
254
|
-
```bash
|
|
255
|
-
# Build
|
|
256
|
-
npm run build
|
|
257
|
-
|
|
258
|
-
# Watch mode
|
|
259
|
-
npm run dev
|
|
260
|
-
|
|
261
|
-
# Start server
|
|
262
|
-
npm start
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
## Related Documentation
|
|
266
|
-
|
|
267
|
-
- [HaloPSA API Documentation](/.claude/api-docs/halopsa.md)
|
|
268
|
-
- [HaloPSA API Agent](/.claude/agents/halopsa-api-agent.md)
|
|
269
|
-
- [ITGlue MCP Server](/.claude/mcp-servers/itglue/) (reference implementation)
|
|
270
|
-
- [Official HaloPSA API Docs](https://halo.haloservicedesk.com/apidoc/index.html)
|
|
1
|
+
# HaloPSA MCP Server
|
|
2
|
+
|
|
3
|
+
Model Context Protocol server for HaloPSA API integration with asset, user, and site management.
|
|
4
|
+
|
|
5
|
+
## Key Features
|
|
6
|
+
|
|
7
|
+
- **31 tools** for managing HaloPSA assets, users, sites, clients, and reference data
|
|
8
|
+
- **Deduplication** with confidence scoring to prevent duplicate billing entities
|
|
9
|
+
- **OAuth2 Client Credentials** authentication with automatic token refresh
|
|
10
|
+
- **Rate limiting** with exponential backoff (60 requests/minute)
|
|
11
|
+
- **In-memory caching** with configurable TTLs and cache prewarm on startup
|
|
12
|
+
- **Inflight request dedup** prevents concurrent duplicate API calls
|
|
13
|
+
- **Token optimization** via format_options (compact/standard/detailed modes)
|
|
14
|
+
|
|
15
|
+
## Important: Billing Context
|
|
16
|
+
|
|
17
|
+
HaloPSA asset and user counts are commonly used for billing calculations in MSP environments.
|
|
18
|
+
|
|
19
|
+
- **Only ACTIVE assets (status_id=1) count toward billing**
|
|
20
|
+
- **Only ACTIVE users (inactive=false) count toward billing**
|
|
21
|
+
- **Duplicates = Billing errors** — use the deduplication tools before creating new records
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install halopsa-mcp-server
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Or from source:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
git clone https://github.com/SuperGaco/halopsa-mcp-server.git
|
|
33
|
+
cd halopsa-mcp-server
|
|
34
|
+
npm install
|
|
35
|
+
npm run build
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Configuration
|
|
39
|
+
|
|
40
|
+
### Environment Variables
|
|
41
|
+
|
|
42
|
+
| Variable | Required | Description |
|
|
43
|
+
|----------|----------|-------------|
|
|
44
|
+
| `HALOPSA_CLIENT_ID` | Yes | OAuth2 Client ID |
|
|
45
|
+
| `HALOPSA_CLIENT_SECRET` | Yes | OAuth2 Client Secret |
|
|
46
|
+
| `HALOPSA_BASE_URL` | Yes | Your HaloPSA instance URL (e.g., `https://your-instance.halopsa.com`) |
|
|
47
|
+
|
|
48
|
+
### HaloPSA API Setup
|
|
49
|
+
|
|
50
|
+
1. In HaloPSA, navigate to **Configuration > Integrations > API Applications**
|
|
51
|
+
2. Create a new application with OAuth2 Client Credentials
|
|
52
|
+
3. Grant appropriate permissions:
|
|
53
|
+
- `read:assets` and `read:customers` for read-only access
|
|
54
|
+
- `edit:assets` and `edit:customers` for write operations
|
|
55
|
+
4. Note the Client ID and Client Secret
|
|
56
|
+
|
|
57
|
+
### Claude Desktop Configuration
|
|
58
|
+
|
|
59
|
+
Add to your Claude Desktop config:
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"mcpServers": {
|
|
64
|
+
"halopsa": {
|
|
65
|
+
"command": "node",
|
|
66
|
+
"args": ["path/to/halopsa-mcp-server/dist/index.js"],
|
|
67
|
+
"env": {
|
|
68
|
+
"HALOPSA_CLIENT_ID": "your_client_id",
|
|
69
|
+
"HALOPSA_CLIENT_SECRET": "your_client_secret",
|
|
70
|
+
"HALOPSA_BASE_URL": "https://your-instance.halopsa.com"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Tools Reference
|
|
78
|
+
|
|
79
|
+
### Asset Tools (11)
|
|
80
|
+
|
|
81
|
+
| Tool | Description |
|
|
82
|
+
|------|-------------|
|
|
83
|
+
| `list_halopsa_assets` | List assets with filtering, caching (1min TTL) |
|
|
84
|
+
| `get_halopsa_asset` | Get single asset with custom fields |
|
|
85
|
+
| `search_halopsa_assets_by_serial` | Search by serial number (key_field) |
|
|
86
|
+
| `search_halopsa_assets_by_hostname` | Search by hostname (key_field2) |
|
|
87
|
+
| `create_halopsa_asset` | Create new asset |
|
|
88
|
+
| `update_halopsa_asset` | Update existing asset |
|
|
89
|
+
| `delete_halopsa_asset` | Delete asset |
|
|
90
|
+
| `list_halopsa_asset_custom_fields` | Inspect custom fields for an asset |
|
|
91
|
+
| `get_halopsa_asset_field_schema` | Analyze custom field definitions |
|
|
92
|
+
| `find_halopsa_asset_match` | Deduplication with confidence scoring |
|
|
93
|
+
| `scan_halopsa_asset_duplicates` | Scan for duplicate assets |
|
|
94
|
+
|
|
95
|
+
### User Tools (7)
|
|
96
|
+
|
|
97
|
+
| Tool | Description |
|
|
98
|
+
|------|-------------|
|
|
99
|
+
| `list_halopsa_users` | List users with filtering, caching (1min TTL) |
|
|
100
|
+
| `get_halopsa_user` | Get single user with custom fields |
|
|
101
|
+
| `search_halopsa_users_by_email` | Search by email address |
|
|
102
|
+
| `create_halopsa_user` | Create new user |
|
|
103
|
+
| `update_halopsa_user` | Update existing user |
|
|
104
|
+
| `find_halopsa_user_match` | Deduplication with confidence scoring |
|
|
105
|
+
| `scan_halopsa_user_duplicates` | Scan for duplicate users |
|
|
106
|
+
|
|
107
|
+
### Site Tools (4)
|
|
108
|
+
|
|
109
|
+
| Tool | Description |
|
|
110
|
+
|------|-------------|
|
|
111
|
+
| `list_halopsa_sites` | List sites with caching (5min TTL) |
|
|
112
|
+
| `get_halopsa_site` | Get single site |
|
|
113
|
+
| `create_halopsa_site` | Create new site |
|
|
114
|
+
| `find_halopsa_site_match` | Deduplication with fuzzy matching |
|
|
115
|
+
|
|
116
|
+
### Client Tools (3)
|
|
117
|
+
|
|
118
|
+
| Tool | Description |
|
|
119
|
+
|------|-------------|
|
|
120
|
+
| `list_halopsa_clients` | List clients with caching (5min TTL) |
|
|
121
|
+
| `get_halopsa_client` | Get single client |
|
|
122
|
+
| `search_halopsa_clients` | Search clients by name |
|
|
123
|
+
|
|
124
|
+
### Reference Data Tools (3)
|
|
125
|
+
|
|
126
|
+
| Tool | Description |
|
|
127
|
+
|------|-------------|
|
|
128
|
+
| `list_halopsa_asset_types` | List asset types (1hr cache) |
|
|
129
|
+
| `list_halopsa_asset_statuses` | List statuses with billing notes |
|
|
130
|
+
| `list_halopsa_contact_types` | List contact types (1hr cache) |
|
|
131
|
+
|
|
132
|
+
### Batch Operations Tools (3)
|
|
133
|
+
|
|
134
|
+
| Tool | Description |
|
|
135
|
+
|------|-------------|
|
|
136
|
+
| `get_halopsa_assets_batch` | Get multiple assets (max 50) |
|
|
137
|
+
| `get_halopsa_users_batch` | Get multiple users (max 50) |
|
|
138
|
+
| `get_halopsa_sites_batch` | Get multiple sites (max 50) |
|
|
139
|
+
|
|
140
|
+
## Deduplication Algorithms
|
|
141
|
+
|
|
142
|
+
### Asset Deduplication
|
|
143
|
+
|
|
144
|
+
| Match Type | Confidence | Action |
|
|
145
|
+
|------------|------------|--------|
|
|
146
|
+
| Exact serial number | 100% | Auto-update |
|
|
147
|
+
| Hostname only (serial mismatch) | 85% | Manual review |
|
|
148
|
+
| No match | 0% | Create new |
|
|
149
|
+
|
|
150
|
+
### User Deduplication
|
|
151
|
+
|
|
152
|
+
| Match Type | Confidence | Action |
|
|
153
|
+
|------------|------------|--------|
|
|
154
|
+
| Exact email | 100% | Auto-update |
|
|
155
|
+
| UPN match (Entra) | 95% | Auto-update |
|
|
156
|
+
| Username only | 70% | Manual review |
|
|
157
|
+
| No match | 0% | Create new |
|
|
158
|
+
|
|
159
|
+
### Site Deduplication
|
|
160
|
+
|
|
161
|
+
| Match Type | Confidence | Action |
|
|
162
|
+
|------------|------------|--------|
|
|
163
|
+
| Exact name | 100% | Auto-update |
|
|
164
|
+
| Fuzzy name + address | 95% | Auto-update |
|
|
165
|
+
| Fuzzy name only | 85% | Manual review |
|
|
166
|
+
| No match | 0% | Create new |
|
|
167
|
+
|
|
168
|
+
## Token Optimization
|
|
169
|
+
|
|
170
|
+
All tools support `format_options` for reducing response size:
|
|
171
|
+
|
|
172
|
+
```json
|
|
173
|
+
{
|
|
174
|
+
"format_options": {
|
|
175
|
+
"format": "compact",
|
|
176
|
+
"fields": ["id", "name", "status_id"],
|
|
177
|
+
"omit_empty": true
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
**Formats:**
|
|
183
|
+
- `compact`: Minimal fields (id, name, status)
|
|
184
|
+
- `standard`: Default fields (no pretty-printing)
|
|
185
|
+
- `detailed`: All fields with pretty-printing
|
|
186
|
+
|
|
187
|
+
## Rate Limiting
|
|
188
|
+
|
|
189
|
+
- **Limit:** 60 requests/minute per client_id
|
|
190
|
+
- **Auto-throttling:** 1 second minimum between requests
|
|
191
|
+
- **Retry:** Exponential backoff on 429 errors (1s, 2s, 4s)
|
|
192
|
+
- **Token refresh:** 5 minutes before expiration
|
|
193
|
+
|
|
194
|
+
## Development
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
npm run build # Build
|
|
198
|
+
npm run dev # Watch mode
|
|
199
|
+
npm start # Start server
|
|
200
|
+
npm run test:smoke # Run smoke tests (requires live API credentials)
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## License
|
|
204
|
+
|
|
205
|
+
MIT
|
package/dist/api/client.js
CHANGED
|
@@ -30,13 +30,13 @@ export class HaloPSAAPIClient {
|
|
|
30
30
|
this.maxRetries = config.maxRetries ?? 3;
|
|
31
31
|
this.retryDelay = config.retryDelay ?? 1000;
|
|
32
32
|
// Create auth client (for token requests)
|
|
33
|
-
// Auth server is at: baseUrl/auth (e.g., https://
|
|
33
|
+
// Auth server is at: baseUrl/auth (e.g., https://your-instance.halopsa.com/auth)
|
|
34
34
|
this.authClient = axios.create({
|
|
35
35
|
baseURL: `${this.baseUrl}/auth`,
|
|
36
36
|
timeout: 30000,
|
|
37
37
|
});
|
|
38
38
|
// Create API client (for data requests)
|
|
39
|
-
// Resource server is at: baseUrl/api (e.g., https://
|
|
39
|
+
// Resource server is at: baseUrl/api (e.g., https://your-instance.halopsa.com/api)
|
|
40
40
|
this.client = axios.create({
|
|
41
41
|
baseURL: `${this.baseUrl}/api`,
|
|
42
42
|
headers: {
|
package/dist/api/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,YAAY,GACb,MAAM,aAAa,CAAC;AAuBrB,MAAM,OAAO,gBAAgB;IACnB,MAAM,CAAgB;IACtB,UAAU,CAAgB;IAC1B,QAAQ,CAAS;IACjB,YAAY,CAAS;IACrB,OAAO,CAAS;IAChB,UAAU,CAAS;IACnB,UAAU,CAAS;IAE3B,mBAAmB;IACX,WAAW,GAAkB,IAAI,CAAC;IAClC,cAAc,GAAW,CAAC,CAAC;IAC3B,kBAAkB,GAAW,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,sCAAsC;IAE1F,gBAAgB;IACR,YAAY,GAAW,CAAC,CAAC;IACzB,eAAe,GAAW,CAAC,CAAC;IACnB,oBAAoB,GAAG,IAAI,CAAC,CAAC,2CAA2C;IAEzF,iCAAiC;IACzB,QAAQ,GAAkC,IAAI,GAAG,EAAE,CAAC;IAE5D,YAAY,MAA2B;QACrC,IAAI,CAA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B,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC;YACtC,gEAAgE;YAChE,OAAO,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,MAAM,IAAI,GAAG,IAAI,MAAM,IAAI,GAAG,CAAC,CAAC;QACpF,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;OAEG;IACH,QAAQ;QAKN,OAAO;YACL,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,cAAc,EAAE,IAAI,CAAC,cAAc;SACpC,CAAC;IACJ,CAAC;CACF"}
|
package/dist/api/errors.js
CHANGED
|
@@ -62,7 +62,7 @@ export function createAuthError(message = 'Authentication failed') {
|
|
|
62
62
|
return new HaloPSAError('AuthError', message, {
|
|
63
63
|
auth_method: 'OAuth2 Client Credentials',
|
|
64
64
|
}, 'Verify your HALOPSA_CLIENT_ID and HALOPSA_CLIENT_SECRET environment variables are correct. ' +
|
|
65
|
-
'
|
|
65
|
+
'Verify your HALOPSA_CLIENT_ID and HALOPSA_CLIENT_SECRET environment variables.', 401);
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
68
68
|
* Create token expired error
|