@promptpartner/bexio-mcp-server 2.0.0
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/LICENSE +21 -0
- package/README.md +161 -0
- package/dist/bexio-client.d.ts +350 -0
- package/dist/bexio-client.js +1045 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +80 -0
- package/dist/logger.d.ts +17 -0
- package/dist/logger.js +28 -0
- package/dist/server.d.ts +18 -0
- package/dist/server.js +81 -0
- package/dist/shared/errors.d.ts +21 -0
- package/dist/shared/errors.js +54 -0
- package/dist/shared/index.d.ts +5 -0
- package/dist/shared/index.js +5 -0
- package/dist/shared/response.d.ts +24 -0
- package/dist/shared/response.js +92 -0
- package/dist/tools/accounting/definitions.d.ts +9 -0
- package/dist/tools/accounting/definitions.js +345 -0
- package/dist/tools/accounting/handlers.d.ts +10 -0
- package/dist/tools/accounting/handlers.js +121 -0
- package/dist/tools/accounting/index.d.ts +16 -0
- package/dist/tools/accounting/index.js +16 -0
- package/dist/tools/banking/definitions.d.ts +11 -0
- package/dist/tools/banking/definitions.js +349 -0
- package/dist/tools/banking/handlers.d.ts +9 -0
- package/dist/tools/banking/handlers.js +123 -0
- package/dist/tools/banking/index.d.ts +6 -0
- package/dist/tools/banking/index.js +6 -0
- package/dist/tools/company/definitions.d.ts +7 -0
- package/dist/tools/company/definitions.js +87 -0
- package/dist/tools/company/handlers.d.ts +7 -0
- package/dist/tools/company/handlers.js +31 -0
- package/dist/tools/company/index.d.ts +6 -0
- package/dist/tools/company/index.js +6 -0
- package/dist/tools/contacts/definitions.d.ts +6 -0
- package/dist/tools/contacts/definitions.js +150 -0
- package/dist/tools/contacts/handlers.d.ts +7 -0
- package/dist/tools/contacts/handlers.js +40 -0
- package/dist/tools/contacts/index.d.ts +6 -0
- package/dist/tools/contacts/index.js +5 -0
- package/dist/tools/deliveries/definitions.d.ts +6 -0
- package/dist/tools/deliveries/definitions.js +67 -0
- package/dist/tools/deliveries/handlers.d.ts +7 -0
- package/dist/tools/deliveries/handlers.js +28 -0
- package/dist/tools/deliveries/index.d.ts +6 -0
- package/dist/tools/deliveries/index.js +5 -0
- package/dist/tools/files/definitions.d.ts +6 -0
- package/dist/tools/files/definitions.js +217 -0
- package/dist/tools/files/handlers.d.ts +7 -0
- package/dist/tools/files/handlers.js +63 -0
- package/dist/tools/files/index.d.ts +6 -0
- package/dist/tools/files/index.js +5 -0
- package/dist/tools/index.d.ts +19 -0
- package/dist/tools/index.js +93 -0
- package/dist/tools/invoices/definitions.d.ts +6 -0
- package/dist/tools/invoices/definitions.js +147 -0
- package/dist/tools/invoices/handlers.d.ts +7 -0
- package/dist/tools/invoices/handlers.js +119 -0
- package/dist/tools/invoices/index.d.ts +6 -0
- package/dist/tools/invoices/index.js +5 -0
- package/dist/tools/items/definitions.d.ts +6 -0
- package/dist/tools/items/definitions.js +100 -0
- package/dist/tools/items/handlers.d.ts +7 -0
- package/dist/tools/items/handlers.js +36 -0
- package/dist/tools/items/index.d.ts +6 -0
- package/dist/tools/items/index.js +5 -0
- package/dist/tools/misc/definitions.d.ts +6 -0
- package/dist/tools/misc/definitions.js +126 -0
- package/dist/tools/misc/handlers.d.ts +7 -0
- package/dist/tools/misc/handlers.js +52 -0
- package/dist/tools/misc/index.d.ts +6 -0
- package/dist/tools/misc/index.js +5 -0
- package/dist/tools/orders/definitions.d.ts +6 -0
- package/dist/tools/orders/definitions.js +114 -0
- package/dist/tools/orders/handlers.d.ts +7 -0
- package/dist/tools/orders/handlers.js +62 -0
- package/dist/tools/orders/index.d.ts +6 -0
- package/dist/tools/orders/index.js +5 -0
- package/dist/tools/payments/definitions.d.ts +6 -0
- package/dist/tools/payments/definitions.js +74 -0
- package/dist/tools/payments/handlers.d.ts +7 -0
- package/dist/tools/payments/handlers.js +28 -0
- package/dist/tools/payments/index.d.ts +6 -0
- package/dist/tools/payments/index.js +5 -0
- package/dist/tools/payroll/definitions.d.ts +15 -0
- package/dist/tools/payroll/definitions.js +239 -0
- package/dist/tools/payroll/handlers.d.ts +14 -0
- package/dist/tools/payroll/handlers.js +152 -0
- package/dist/tools/payroll/index.d.ts +16 -0
- package/dist/tools/payroll/index.js +16 -0
- package/dist/tools/projects/definitions.d.ts +7 -0
- package/dist/tools/projects/definitions.js +430 -0
- package/dist/tools/projects/handlers.d.ts +7 -0
- package/dist/tools/projects/handlers.js +127 -0
- package/dist/tools/projects/index.d.ts +6 -0
- package/dist/tools/projects/index.js +6 -0
- package/dist/tools/purchase/definitions.d.ts +6 -0
- package/dist/tools/purchase/definitions.js +381 -0
- package/dist/tools/purchase/handlers.d.ts +7 -0
- package/dist/tools/purchase/handlers.js +120 -0
- package/dist/tools/purchase/index.d.ts +7 -0
- package/dist/tools/purchase/index.js +6 -0
- package/dist/tools/quotes/definitions.d.ts +6 -0
- package/dist/tools/quotes/definitions.js +174 -0
- package/dist/tools/quotes/handlers.d.ts +7 -0
- package/dist/tools/quotes/handlers.js +79 -0
- package/dist/tools/quotes/index.d.ts +6 -0
- package/dist/tools/quotes/index.js +5 -0
- package/dist/tools/reference/definitions.d.ts +7 -0
- package/dist/tools/reference/definitions.js +421 -0
- package/dist/tools/reference/handlers.d.ts +7 -0
- package/dist/tools/reference/handlers.js +161 -0
- package/dist/tools/reference/index.d.ts +6 -0
- package/dist/tools/reference/index.js +6 -0
- package/dist/tools/reminders/definitions.d.ts +6 -0
- package/dist/tools/reminders/definitions.js +132 -0
- package/dist/tools/reminders/handlers.d.ts +7 -0
- package/dist/tools/reminders/handlers.js +43 -0
- package/dist/tools/reminders/index.d.ts +6 -0
- package/dist/tools/reminders/index.js +5 -0
- package/dist/tools/reports/definitions.d.ts +6 -0
- package/dist/tools/reports/definitions.js +133 -0
- package/dist/tools/reports/handlers.d.ts +7 -0
- package/dist/tools/reports/handlers.js +33 -0
- package/dist/tools/reports/index.d.ts +6 -0
- package/dist/tools/reports/index.js +5 -0
- package/dist/tools/timetracking/definitions.d.ts +9 -0
- package/dist/tools/timetracking/definitions.js +226 -0
- package/dist/tools/timetracking/handlers.d.ts +9 -0
- package/dist/tools/timetracking/handlers.js +88 -0
- package/dist/tools/timetracking/index.d.ts +6 -0
- package/dist/tools/timetracking/index.js +6 -0
- package/dist/tools/users/definitions.d.ts +6 -0
- package/dist/tools/users/definitions.js +93 -0
- package/dist/tools/users/handlers.d.ts +7 -0
- package/dist/tools/users/handlers.js +35 -0
- package/dist/tools/users/index.d.ts +6 -0
- package/dist/tools/users/index.js +5 -0
- package/dist/transports/http.d.ts +17 -0
- package/dist/transports/http.js +203 -0
- package/dist/transports/index.d.ts +4 -0
- package/dist/transports/index.js +4 -0
- package/dist/types/common.d.ts +32 -0
- package/dist/types/common.js +11 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/index.js +11 -0
- package/dist/types/schemas/accounting.d.ts +225 -0
- package/dist/types/schemas/accounting.js +96 -0
- package/dist/types/schemas/banking.d.ts +207 -0
- package/dist/types/schemas/banking.js +86 -0
- package/dist/types/schemas/company.d.ts +44 -0
- package/dist/types/schemas/company.js +23 -0
- package/dist/types/schemas/contacts.d.ts +104 -0
- package/dist/types/schemas/contacts.js +42 -0
- package/dist/types/schemas/deliveries.d.ts +40 -0
- package/dist/types/schemas/deliveries.js +22 -0
- package/dist/types/schemas/files.d.ts +152 -0
- package/dist/types/schemas/files.js +64 -0
- package/dist/types/schemas/index.d.ts +24 -0
- package/dist/types/schemas/index.js +44 -0
- package/dist/types/schemas/invoices.d.ts +594 -0
- package/dist/types/schemas/invoices.js +109 -0
- package/dist/types/schemas/items.d.ts +153 -0
- package/dist/types/schemas/items.js +43 -0
- package/dist/types/schemas/misc.d.ts +64 -0
- package/dist/types/schemas/misc.js +36 -0
- package/dist/types/schemas/orders.d.ts +657 -0
- package/dist/types/schemas/orders.js +101 -0
- package/dist/types/schemas/payments.d.ts +46 -0
- package/dist/types/schemas/payments.js +24 -0
- package/dist/types/schemas/payroll.d.ts +146 -0
- package/dist/types/schemas/payroll.js +65 -0
- package/dist/types/schemas/projects.d.ts +268 -0
- package/dist/types/schemas/projects.js +102 -0
- package/dist/types/schemas/purchase.d.ts +228 -0
- package/dist/types/schemas/purchase.js +114 -0
- package/dist/types/schemas/quotes.d.ts +102 -0
- package/dist/types/schemas/quotes.js +49 -0
- package/dist/types/schemas/reference.d.ts +240 -0
- package/dist/types/schemas/reference.js +99 -0
- package/dist/types/schemas/reminders.d.ts +76 -0
- package/dist/types/schemas/reminders.js +38 -0
- package/dist/types/schemas/reports.d.ts +69 -0
- package/dist/types/schemas/reports.js +36 -0
- package/dist/types/schemas/timetracking.d.ts +150 -0
- package/dist/types/schemas/timetracking.js +68 -0
- package/dist/types/schemas/users.d.ts +51 -0
- package/dist/types/schemas/users.js +27 -0
- package/dist/ui/contact-card/mcp-app.d.ts +1 -0
- package/dist/ui/contact-card/mcp-app.js +108 -0
- package/dist/ui/dashboard/mcp-app.d.ts +1 -0
- package/dist/ui/dashboard/mcp-app.js +81 -0
- package/dist/ui/invoice-preview/mcp-app.d.ts +1 -0
- package/dist/ui/invoice-preview/mcp-app.js +96 -0
- package/dist/ui-resources.d.ts +17 -0
- package/dist/ui-resources.js +124 -0
- package/dist/vite.config.d.ts +2 -0
- package/dist/vite.config.js +46 -0
- package/package.json +78 -0
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Projects tool definitions.
|
|
3
|
+
* Contains MCP tool metadata for projects domain.
|
|
4
|
+
* Includes: Projects (CRUD, archive, search), Project Types, Project Statuses, Milestones, Work Packages
|
|
5
|
+
*/
|
|
6
|
+
export const toolDefinitions = [
|
|
7
|
+
// ===== PROJECTS (PROJ-01) =====
|
|
8
|
+
{
|
|
9
|
+
name: "list_projects",
|
|
10
|
+
description: "List all projects in Bexio with pagination support",
|
|
11
|
+
inputSchema: {
|
|
12
|
+
type: "object",
|
|
13
|
+
properties: {
|
|
14
|
+
limit: {
|
|
15
|
+
type: "integer",
|
|
16
|
+
description: "Maximum number of projects to return (default: 100)",
|
|
17
|
+
default: 100,
|
|
18
|
+
},
|
|
19
|
+
offset: {
|
|
20
|
+
type: "integer",
|
|
21
|
+
description: "Number of projects to skip (default: 0)",
|
|
22
|
+
default: 0,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: "get_project",
|
|
29
|
+
description: "Get a specific project by ID from Bexio",
|
|
30
|
+
inputSchema: {
|
|
31
|
+
type: "object",
|
|
32
|
+
properties: {
|
|
33
|
+
project_id: {
|
|
34
|
+
type: "integer",
|
|
35
|
+
description: "The ID of the project to retrieve",
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
required: ["project_id"],
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: "create_project",
|
|
43
|
+
description: "Create a new project in Bexio. Requires user_id (owner) and name.",
|
|
44
|
+
inputSchema: {
|
|
45
|
+
type: "object",
|
|
46
|
+
properties: {
|
|
47
|
+
user_id: {
|
|
48
|
+
type: "integer",
|
|
49
|
+
description: "The ID of the user who owns/manages the project",
|
|
50
|
+
},
|
|
51
|
+
name: {
|
|
52
|
+
type: "string",
|
|
53
|
+
description: "The name of the project",
|
|
54
|
+
},
|
|
55
|
+
contact_id: {
|
|
56
|
+
type: "integer",
|
|
57
|
+
description: "Optional: The ID of the associated contact/customer",
|
|
58
|
+
},
|
|
59
|
+
pr_state_id: {
|
|
60
|
+
type: "integer",
|
|
61
|
+
description: "Optional: The ID of the project status (use list_project_statuses to see available)",
|
|
62
|
+
},
|
|
63
|
+
pr_project_type_id: {
|
|
64
|
+
type: "integer",
|
|
65
|
+
description: "Optional: The ID of the project type (use list_project_types to see available)",
|
|
66
|
+
},
|
|
67
|
+
start_date: {
|
|
68
|
+
type: "string",
|
|
69
|
+
description: "Optional: Project start date in YYYY-MM-DD format",
|
|
70
|
+
},
|
|
71
|
+
end_date: {
|
|
72
|
+
type: "string",
|
|
73
|
+
description: "Optional: Project end date in YYYY-MM-DD format",
|
|
74
|
+
},
|
|
75
|
+
comment: {
|
|
76
|
+
type: "string",
|
|
77
|
+
description: "Optional: Additional comments/notes about the project",
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
required: ["user_id", "name"],
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: "update_project",
|
|
85
|
+
description: "Update an existing project in Bexio",
|
|
86
|
+
inputSchema: {
|
|
87
|
+
type: "object",
|
|
88
|
+
properties: {
|
|
89
|
+
project_id: {
|
|
90
|
+
type: "integer",
|
|
91
|
+
description: "The ID of the project to update",
|
|
92
|
+
},
|
|
93
|
+
project_data: {
|
|
94
|
+
type: "object",
|
|
95
|
+
description: "Object containing the fields to update (e.g., name, contact_id, pr_state_id, etc.)",
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
required: ["project_id", "project_data"],
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: "delete_project",
|
|
103
|
+
description: "Delete a project from Bexio by ID. Consider using archive_project instead for data retention.",
|
|
104
|
+
inputSchema: {
|
|
105
|
+
type: "object",
|
|
106
|
+
properties: {
|
|
107
|
+
project_id: {
|
|
108
|
+
type: "integer",
|
|
109
|
+
description: "The ID of the project to delete",
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
required: ["project_id"],
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: "archive_project",
|
|
117
|
+
description: "Archive a project in Bexio. Archived projects are hidden but not deleted.",
|
|
118
|
+
inputSchema: {
|
|
119
|
+
type: "object",
|
|
120
|
+
properties: {
|
|
121
|
+
project_id: {
|
|
122
|
+
type: "integer",
|
|
123
|
+
description: "The ID of the project to archive",
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
required: ["project_id"],
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: "unarchive_project",
|
|
131
|
+
description: "Unarchive a previously archived project in Bexio, making it active again.",
|
|
132
|
+
inputSchema: {
|
|
133
|
+
type: "object",
|
|
134
|
+
properties: {
|
|
135
|
+
project_id: {
|
|
136
|
+
type: "integer",
|
|
137
|
+
description: "The ID of the project to unarchive",
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
required: ["project_id"],
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
name: "search_projects",
|
|
145
|
+
description: "Search for projects in Bexio using field-based criteria. Supports exact match and partial matching.",
|
|
146
|
+
inputSchema: {
|
|
147
|
+
type: "object",
|
|
148
|
+
properties: {
|
|
149
|
+
search_criteria: {
|
|
150
|
+
type: "array",
|
|
151
|
+
description: "Array of search criteria objects",
|
|
152
|
+
items: {
|
|
153
|
+
type: "object",
|
|
154
|
+
properties: {
|
|
155
|
+
field: {
|
|
156
|
+
type: "string",
|
|
157
|
+
description: "Field name to search (e.g., 'name', 'contact_id', 'pr_state_id')",
|
|
158
|
+
},
|
|
159
|
+
value: {
|
|
160
|
+
description: "Value to search for",
|
|
161
|
+
},
|
|
162
|
+
criteria: {
|
|
163
|
+
type: "string",
|
|
164
|
+
description: "Search operator: '=' for exact match, 'like' for partial match, '!=' for not equal",
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
required: ["field", "value"],
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
required: ["search_criteria"],
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
// ===== PROJECT TYPES (PROJ-02) =====
|
|
175
|
+
{
|
|
176
|
+
name: "list_project_types",
|
|
177
|
+
description: "List all project types available in Bexio (e.g., Internal, Customer Project)",
|
|
178
|
+
inputSchema: {
|
|
179
|
+
type: "object",
|
|
180
|
+
properties: {
|
|
181
|
+
limit: {
|
|
182
|
+
type: "integer",
|
|
183
|
+
description: "Maximum number of results to return (default: 100)",
|
|
184
|
+
default: 100,
|
|
185
|
+
},
|
|
186
|
+
offset: {
|
|
187
|
+
type: "integer",
|
|
188
|
+
description: "Number of results to skip (default: 0)",
|
|
189
|
+
default: 0,
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: "get_project_type",
|
|
196
|
+
description: "Get a specific project type by ID from Bexio",
|
|
197
|
+
inputSchema: {
|
|
198
|
+
type: "object",
|
|
199
|
+
properties: {
|
|
200
|
+
type_id: {
|
|
201
|
+
type: "integer",
|
|
202
|
+
description: "The ID of the project type to retrieve",
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
required: ["type_id"],
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
// ===== PROJECT STATUSES (PROJ-03) =====
|
|
209
|
+
{
|
|
210
|
+
name: "list_project_statuses",
|
|
211
|
+
description: "List all project statuses available in Bexio (e.g., Active, Completed, On Hold)",
|
|
212
|
+
inputSchema: {
|
|
213
|
+
type: "object",
|
|
214
|
+
properties: {
|
|
215
|
+
limit: {
|
|
216
|
+
type: "integer",
|
|
217
|
+
description: "Maximum number of results to return (default: 100)",
|
|
218
|
+
default: 100,
|
|
219
|
+
},
|
|
220
|
+
offset: {
|
|
221
|
+
type: "integer",
|
|
222
|
+
description: "Number of results to skip (default: 0)",
|
|
223
|
+
default: 0,
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
name: "get_project_status",
|
|
230
|
+
description: "Get a specific project status by ID from Bexio",
|
|
231
|
+
inputSchema: {
|
|
232
|
+
type: "object",
|
|
233
|
+
properties: {
|
|
234
|
+
status_id: {
|
|
235
|
+
type: "integer",
|
|
236
|
+
description: "The ID of the project status to retrieve",
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
required: ["status_id"],
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
// ===== MILESTONES (PROJ-04) =====
|
|
243
|
+
{
|
|
244
|
+
name: "list_milestones",
|
|
245
|
+
description: "List milestones for a specific project in Bexio",
|
|
246
|
+
inputSchema: {
|
|
247
|
+
type: "object",
|
|
248
|
+
properties: {
|
|
249
|
+
project_id: {
|
|
250
|
+
type: "integer",
|
|
251
|
+
description: "The ID of the project to list milestones for",
|
|
252
|
+
},
|
|
253
|
+
limit: {
|
|
254
|
+
type: "integer",
|
|
255
|
+
description: "Maximum number of milestones to return (default: 100)",
|
|
256
|
+
default: 100,
|
|
257
|
+
},
|
|
258
|
+
offset: {
|
|
259
|
+
type: "integer",
|
|
260
|
+
description: "Number of milestones to skip (default: 0)",
|
|
261
|
+
default: 0,
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
required: ["project_id"],
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
name: "get_milestone",
|
|
269
|
+
description: "Get a specific milestone by ID from a project in Bexio",
|
|
270
|
+
inputSchema: {
|
|
271
|
+
type: "object",
|
|
272
|
+
properties: {
|
|
273
|
+
project_id: {
|
|
274
|
+
type: "integer",
|
|
275
|
+
description: "The ID of the project containing the milestone",
|
|
276
|
+
},
|
|
277
|
+
milestone_id: {
|
|
278
|
+
type: "integer",
|
|
279
|
+
description: "The ID of the milestone to retrieve",
|
|
280
|
+
},
|
|
281
|
+
},
|
|
282
|
+
required: ["project_id", "milestone_id"],
|
|
283
|
+
},
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
name: "create_milestone",
|
|
287
|
+
description: "Create a new milestone in a project. Milestones track key deadlines and deliverables.",
|
|
288
|
+
inputSchema: {
|
|
289
|
+
type: "object",
|
|
290
|
+
properties: {
|
|
291
|
+
project_id: {
|
|
292
|
+
type: "integer",
|
|
293
|
+
description: "The ID of the project to add the milestone to",
|
|
294
|
+
},
|
|
295
|
+
name: {
|
|
296
|
+
type: "string",
|
|
297
|
+
description: "The name of the milestone",
|
|
298
|
+
},
|
|
299
|
+
end_date: {
|
|
300
|
+
type: "string",
|
|
301
|
+
description: "Optional: Target completion date in YYYY-MM-DD format",
|
|
302
|
+
},
|
|
303
|
+
},
|
|
304
|
+
required: ["project_id", "name"],
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
name: "delete_milestone",
|
|
309
|
+
description: "Delete a milestone from a project in Bexio",
|
|
310
|
+
inputSchema: {
|
|
311
|
+
type: "object",
|
|
312
|
+
properties: {
|
|
313
|
+
project_id: {
|
|
314
|
+
type: "integer",
|
|
315
|
+
description: "The ID of the project containing the milestone",
|
|
316
|
+
},
|
|
317
|
+
milestone_id: {
|
|
318
|
+
type: "integer",
|
|
319
|
+
description: "The ID of the milestone to delete",
|
|
320
|
+
},
|
|
321
|
+
},
|
|
322
|
+
required: ["project_id", "milestone_id"],
|
|
323
|
+
},
|
|
324
|
+
},
|
|
325
|
+
// ===== WORK PACKAGES (PROJ-05) =====
|
|
326
|
+
{
|
|
327
|
+
name: "list_work_packages",
|
|
328
|
+
description: "List work packages for a specific project in Bexio",
|
|
329
|
+
inputSchema: {
|
|
330
|
+
type: "object",
|
|
331
|
+
properties: {
|
|
332
|
+
project_id: {
|
|
333
|
+
type: "integer",
|
|
334
|
+
description: "The ID of the project to list work packages for",
|
|
335
|
+
},
|
|
336
|
+
limit: {
|
|
337
|
+
type: "integer",
|
|
338
|
+
description: "Maximum number of work packages to return (default: 100)",
|
|
339
|
+
default: 100,
|
|
340
|
+
},
|
|
341
|
+
offset: {
|
|
342
|
+
type: "integer",
|
|
343
|
+
description: "Number of work packages to skip (default: 0)",
|
|
344
|
+
default: 0,
|
|
345
|
+
},
|
|
346
|
+
},
|
|
347
|
+
required: ["project_id"],
|
|
348
|
+
},
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
name: "get_work_package",
|
|
352
|
+
description: "Get a specific work package by ID from a project in Bexio",
|
|
353
|
+
inputSchema: {
|
|
354
|
+
type: "object",
|
|
355
|
+
properties: {
|
|
356
|
+
project_id: {
|
|
357
|
+
type: "integer",
|
|
358
|
+
description: "The ID of the project containing the work package",
|
|
359
|
+
},
|
|
360
|
+
workpackage_id: {
|
|
361
|
+
type: "integer",
|
|
362
|
+
description: "The ID of the work package to retrieve",
|
|
363
|
+
},
|
|
364
|
+
},
|
|
365
|
+
required: ["project_id", "workpackage_id"],
|
|
366
|
+
},
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
name: "create_work_package",
|
|
370
|
+
description: "Create a new work package in a project. Work packages organize deliverables and track estimated effort.",
|
|
371
|
+
inputSchema: {
|
|
372
|
+
type: "object",
|
|
373
|
+
properties: {
|
|
374
|
+
project_id: {
|
|
375
|
+
type: "integer",
|
|
376
|
+
description: "The ID of the project to add the work package to",
|
|
377
|
+
},
|
|
378
|
+
name: {
|
|
379
|
+
type: "string",
|
|
380
|
+
description: "The name of the work package",
|
|
381
|
+
},
|
|
382
|
+
estimated_time: {
|
|
383
|
+
type: "string",
|
|
384
|
+
description: "Optional: Estimated time in HH:MM format (e.g., '02:30' for 2.5 hours)",
|
|
385
|
+
},
|
|
386
|
+
},
|
|
387
|
+
required: ["project_id", "name"],
|
|
388
|
+
},
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
name: "update_work_package",
|
|
392
|
+
description: "Update an existing work package in a project",
|
|
393
|
+
inputSchema: {
|
|
394
|
+
type: "object",
|
|
395
|
+
properties: {
|
|
396
|
+
project_id: {
|
|
397
|
+
type: "integer",
|
|
398
|
+
description: "The ID of the project containing the work package",
|
|
399
|
+
},
|
|
400
|
+
workpackage_id: {
|
|
401
|
+
type: "integer",
|
|
402
|
+
description: "The ID of the work package to update",
|
|
403
|
+
},
|
|
404
|
+
workpackage_data: {
|
|
405
|
+
type: "object",
|
|
406
|
+
description: "Object containing the fields to update (e.g., name, estimated_time)",
|
|
407
|
+
},
|
|
408
|
+
},
|
|
409
|
+
required: ["project_id", "workpackage_id", "workpackage_data"],
|
|
410
|
+
},
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
name: "delete_work_package",
|
|
414
|
+
description: "Delete a work package from a project in Bexio",
|
|
415
|
+
inputSchema: {
|
|
416
|
+
type: "object",
|
|
417
|
+
properties: {
|
|
418
|
+
project_id: {
|
|
419
|
+
type: "integer",
|
|
420
|
+
description: "The ID of the project containing the work package",
|
|
421
|
+
},
|
|
422
|
+
workpackage_id: {
|
|
423
|
+
type: "integer",
|
|
424
|
+
description: "The ID of the work package to delete",
|
|
425
|
+
},
|
|
426
|
+
},
|
|
427
|
+
required: ["project_id", "workpackage_id"],
|
|
428
|
+
},
|
|
429
|
+
},
|
|
430
|
+
];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Projects tool handlers.
|
|
3
|
+
* Implements the logic for each projects tool.
|
|
4
|
+
*/
|
|
5
|
+
import { BexioClient } from "../../bexio-client.js";
|
|
6
|
+
export type HandlerFn = (client: BexioClient, args: unknown) => Promise<unknown>;
|
|
7
|
+
export declare const handlers: Record<string, HandlerFn>;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Projects tool handlers.
|
|
3
|
+
* Implements the logic for each projects tool.
|
|
4
|
+
*/
|
|
5
|
+
import { McpError } from "../../shared/errors.js";
|
|
6
|
+
import {
|
|
7
|
+
// Projects
|
|
8
|
+
ListProjectsParamsSchema, GetProjectParamsSchema, CreateProjectParamsSchema, UpdateProjectParamsSchema, DeleteProjectParamsSchema, ArchiveProjectParamsSchema, UnarchiveProjectParamsSchema, SearchProjectsParamsSchema,
|
|
9
|
+
// Project Types
|
|
10
|
+
ListProjectTypesParamsSchema, GetProjectTypeParamsSchema,
|
|
11
|
+
// Project Statuses
|
|
12
|
+
ListProjectStatusesParamsSchema, GetProjectStatusParamsSchema,
|
|
13
|
+
// Milestones
|
|
14
|
+
ListMilestonesParamsSchema, GetMilestoneParamsSchema, CreateMilestoneParamsSchema, DeleteMilestoneParamsSchema,
|
|
15
|
+
// Work Packages
|
|
16
|
+
ListWorkPackagesParamsSchema, GetWorkPackageParamsSchema, CreateWorkPackageParamsSchema, UpdateWorkPackageParamsSchema, DeleteWorkPackageParamsSchema, } from "../../types/index.js";
|
|
17
|
+
export const handlers = {
|
|
18
|
+
// ===== PROJECTS (PROJ-01) =====
|
|
19
|
+
list_projects: async (client, args) => {
|
|
20
|
+
const params = ListProjectsParamsSchema.parse(args);
|
|
21
|
+
return client.listProjects(params);
|
|
22
|
+
},
|
|
23
|
+
get_project: async (client, args) => {
|
|
24
|
+
const { project_id } = GetProjectParamsSchema.parse(args);
|
|
25
|
+
const project = await client.getProject(project_id);
|
|
26
|
+
if (!project) {
|
|
27
|
+
throw McpError.notFound("Project", project_id);
|
|
28
|
+
}
|
|
29
|
+
return project;
|
|
30
|
+
},
|
|
31
|
+
create_project: async (client, args) => {
|
|
32
|
+
const params = CreateProjectParamsSchema.parse(args);
|
|
33
|
+
return client.createProject(params);
|
|
34
|
+
},
|
|
35
|
+
update_project: async (client, args) => {
|
|
36
|
+
const { project_id, project_data } = UpdateProjectParamsSchema.parse(args);
|
|
37
|
+
return client.updateProject(project_id, project_data);
|
|
38
|
+
},
|
|
39
|
+
delete_project: async (client, args) => {
|
|
40
|
+
const { project_id } = DeleteProjectParamsSchema.parse(args);
|
|
41
|
+
return client.deleteProject(project_id);
|
|
42
|
+
},
|
|
43
|
+
archive_project: async (client, args) => {
|
|
44
|
+
const { project_id } = ArchiveProjectParamsSchema.parse(args);
|
|
45
|
+
return client.archiveProject(project_id);
|
|
46
|
+
},
|
|
47
|
+
unarchive_project: async (client, args) => {
|
|
48
|
+
const { project_id } = UnarchiveProjectParamsSchema.parse(args);
|
|
49
|
+
return client.unarchiveProject(project_id);
|
|
50
|
+
},
|
|
51
|
+
search_projects: async (client, args) => {
|
|
52
|
+
const { search_criteria } = SearchProjectsParamsSchema.parse(args);
|
|
53
|
+
return client.searchProjects(search_criteria);
|
|
54
|
+
},
|
|
55
|
+
// ===== PROJECT TYPES (PROJ-02) =====
|
|
56
|
+
list_project_types: async (client, args) => {
|
|
57
|
+
const params = ListProjectTypesParamsSchema.parse(args);
|
|
58
|
+
return client.listProjectTypes(params);
|
|
59
|
+
},
|
|
60
|
+
get_project_type: async (client, args) => {
|
|
61
|
+
const { type_id } = GetProjectTypeParamsSchema.parse(args);
|
|
62
|
+
const projectType = await client.getProjectType(type_id);
|
|
63
|
+
if (!projectType) {
|
|
64
|
+
throw McpError.notFound("Project Type", type_id);
|
|
65
|
+
}
|
|
66
|
+
return projectType;
|
|
67
|
+
},
|
|
68
|
+
// ===== PROJECT STATUSES (PROJ-03) =====
|
|
69
|
+
list_project_statuses: async (client, args) => {
|
|
70
|
+
const params = ListProjectStatusesParamsSchema.parse(args);
|
|
71
|
+
return client.listProjectStatuses(params);
|
|
72
|
+
},
|
|
73
|
+
get_project_status: async (client, args) => {
|
|
74
|
+
const { status_id } = GetProjectStatusParamsSchema.parse(args);
|
|
75
|
+
const status = await client.getProjectStatus(status_id);
|
|
76
|
+
if (!status) {
|
|
77
|
+
throw McpError.notFound("Project Status", status_id);
|
|
78
|
+
}
|
|
79
|
+
return status;
|
|
80
|
+
},
|
|
81
|
+
// ===== MILESTONES (PROJ-04) =====
|
|
82
|
+
list_milestones: async (client, args) => {
|
|
83
|
+
const { project_id, ...params } = ListMilestonesParamsSchema.parse(args);
|
|
84
|
+
return client.listMilestones(project_id, params);
|
|
85
|
+
},
|
|
86
|
+
get_milestone: async (client, args) => {
|
|
87
|
+
const { project_id, milestone_id } = GetMilestoneParamsSchema.parse(args);
|
|
88
|
+
const milestone = await client.getMilestone(project_id, milestone_id);
|
|
89
|
+
if (!milestone) {
|
|
90
|
+
throw McpError.notFound("Milestone", milestone_id);
|
|
91
|
+
}
|
|
92
|
+
return milestone;
|
|
93
|
+
},
|
|
94
|
+
create_milestone: async (client, args) => {
|
|
95
|
+
const { project_id, ...data } = CreateMilestoneParamsSchema.parse(args);
|
|
96
|
+
return client.createMilestone(project_id, data);
|
|
97
|
+
},
|
|
98
|
+
delete_milestone: async (client, args) => {
|
|
99
|
+
const { project_id, milestone_id } = DeleteMilestoneParamsSchema.parse(args);
|
|
100
|
+
return client.deleteMilestone(project_id, milestone_id);
|
|
101
|
+
},
|
|
102
|
+
// ===== WORK PACKAGES (PROJ-05) =====
|
|
103
|
+
list_work_packages: async (client, args) => {
|
|
104
|
+
const { project_id, ...params } = ListWorkPackagesParamsSchema.parse(args);
|
|
105
|
+
return client.listWorkPackages(project_id, params);
|
|
106
|
+
},
|
|
107
|
+
get_work_package: async (client, args) => {
|
|
108
|
+
const { project_id, workpackage_id } = GetWorkPackageParamsSchema.parse(args);
|
|
109
|
+
const pkg = await client.getWorkPackage(project_id, workpackage_id);
|
|
110
|
+
if (!pkg) {
|
|
111
|
+
throw McpError.notFound("Work Package", workpackage_id);
|
|
112
|
+
}
|
|
113
|
+
return pkg;
|
|
114
|
+
},
|
|
115
|
+
create_work_package: async (client, args) => {
|
|
116
|
+
const { project_id, ...data } = CreateWorkPackageParamsSchema.parse(args);
|
|
117
|
+
return client.createWorkPackage(project_id, data);
|
|
118
|
+
},
|
|
119
|
+
update_work_package: async (client, args) => {
|
|
120
|
+
const { project_id, workpackage_id, workpackage_data } = UpdateWorkPackageParamsSchema.parse(args);
|
|
121
|
+
return client.updateWorkPackage(project_id, workpackage_id, workpackage_data);
|
|
122
|
+
},
|
|
123
|
+
delete_work_package: async (client, args) => {
|
|
124
|
+
const { project_id, workpackage_id } = DeleteWorkPackageParamsSchema.parse(args);
|
|
125
|
+
return client.deleteWorkPackage(project_id, workpackage_id);
|
|
126
|
+
},
|
|
127
|
+
};
|