mcp-grocy 2.2.0 → 2.5.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/CHANGELOG.md +31 -0
- package/README.md +112 -32
- package/build/api/client.js +11 -13
- package/build/config/index.js +74 -20
- package/build/resources/CHANGELOG.md +31 -0
- package/build/resources/DOCS.md +8 -3
- package/build/resources/README.md +112 -32
- package/build/resources/api-reference.md +88 -88
- package/build/resources/config.md +30 -17
- package/build/resources/examples.md +120 -221
- package/build/resources/installation.md +9 -14
- package/build/resources/response-format.md +18 -13
- package/build/server/http-server.js +154 -42
- package/build/server/mcp-server.js +143 -96
- package/build/server/resources.js +37 -24
- package/build/server/tool-input-zod.js +86 -0
- package/build/tools/base.js +19 -15
- package/build/tools/household/definitions.js +47 -43
- package/build/tools/household/handlers.js +2 -2
- package/build/tools/household/index.js +2 -2
- package/build/tools/inventory/definitions.js +150 -113
- package/build/tools/inventory/handlers.js +55 -42
- package/build/tools/inventory/index.js +2 -2
- package/build/tools/module-loader.js +15 -12
- package/build/tools/recipes/definitions.js +103 -86
- package/build/tools/recipes/handlers.js +44 -38
- package/build/tools/recipes/index.js +3 -3
- package/build/tools/recipes/validations.js +8 -2
- package/build/tools/shopping/definitions.js +22 -20
- package/build/tools/shopping/handlers.js +1 -1
- package/build/tools/shopping/index.js +2 -2
- package/build/tools/system/definitions.js +25 -22
- package/build/tools/system/handlers.js +74 -12
- package/build/tools/system/index.js +2 -2
- package/build/tools/validation-helpers.js +10 -7
- package/build/types/index.js +12 -10
- package/build/utils/errors.js +10 -5
- package/build/utils/logger.js +16 -15
- package/build/version.js +2 -2
- package/package.json +38 -23
|
@@ -2,12 +2,13 @@ export const householdToolDefinitions = [
|
|
|
2
2
|
// ==================== CHORE MANAGEMENT ====================
|
|
3
3
|
{
|
|
4
4
|
name: 'household_chores_get',
|
|
5
|
-
description: '[HOUSEHOLD/CHORES]
|
|
5
|
+
description: '[HOUSEHOLD/CHORES] List **Grocy Chores** (recurring household routines: cleaning schedule, maintenance cadence). Not the same as Tasks—use household_tasks_get for one-off to-dos.',
|
|
6
|
+
annotations: { readOnlyHint: true },
|
|
6
7
|
inputSchema: {
|
|
7
8
|
type: 'object',
|
|
8
9
|
properties: {},
|
|
9
|
-
required: []
|
|
10
|
-
}
|
|
10
|
+
required: [],
|
|
11
|
+
},
|
|
11
12
|
},
|
|
12
13
|
{
|
|
13
14
|
name: 'household_chores_execute',
|
|
@@ -17,33 +18,34 @@ export const householdToolDefinitions = [
|
|
|
17
18
|
properties: {
|
|
18
19
|
choreId: {
|
|
19
20
|
type: 'number',
|
|
20
|
-
description: 'ID of the chore to track execution for. Use household_chores_get tool to find the correct chore ID.'
|
|
21
|
+
description: 'ID of the chore to track execution for. Use household_chores_get tool to find the correct chore ID.',
|
|
21
22
|
},
|
|
22
23
|
executedBy: {
|
|
23
24
|
type: 'number',
|
|
24
|
-
description: 'ID of the user who executed the chore (optional). Use system_users_get tool to find user IDs.'
|
|
25
|
+
description: 'ID of the user who executed the chore (optional). Use system_users_get tool to find user IDs.',
|
|
25
26
|
},
|
|
26
27
|
trackedTime: {
|
|
27
28
|
type: 'string',
|
|
28
|
-
description: 'Time when the chore was executed in YYYY-MM-DD HH:mm:ss format (optional, defaults to current time)'
|
|
29
|
+
description: 'Time when the chore was executed in YYYY-MM-DD HH:mm:ss format (optional, defaults to current time)',
|
|
29
30
|
},
|
|
30
31
|
note: {
|
|
31
32
|
type: 'string',
|
|
32
|
-
description: 'Optional note for the chore execution'
|
|
33
|
-
}
|
|
33
|
+
description: 'Optional note for the chore execution',
|
|
34
|
+
},
|
|
34
35
|
},
|
|
35
|
-
required: ['choreId']
|
|
36
|
-
}
|
|
36
|
+
required: ['choreId'],
|
|
37
|
+
},
|
|
37
38
|
},
|
|
38
39
|
// ==================== TASK MANAGEMENT ====================
|
|
39
40
|
{
|
|
40
41
|
name: 'household_tasks_get',
|
|
41
|
-
description: '[HOUSEHOLD/TASKS]
|
|
42
|
+
description: '[HOUSEHOLD/TASKS] List **Grocy Tasks** (discrete to-dos / task tracker). Not recurring Chores—use household_chores_get for scheduled recurring chores.',
|
|
43
|
+
annotations: { readOnlyHint: true },
|
|
42
44
|
inputSchema: {
|
|
43
45
|
type: 'object',
|
|
44
46
|
properties: {},
|
|
45
|
-
required: []
|
|
46
|
-
}
|
|
47
|
+
required: [],
|
|
48
|
+
},
|
|
47
49
|
},
|
|
48
50
|
{
|
|
49
51
|
name: 'household_tasks_complete',
|
|
@@ -53,25 +55,26 @@ export const householdToolDefinitions = [
|
|
|
53
55
|
properties: {
|
|
54
56
|
taskId: {
|
|
55
57
|
type: 'number',
|
|
56
|
-
description: 'ID of the task to complete. Use household_tasks_get tool to find the correct task ID.'
|
|
58
|
+
description: 'ID of the task to complete. Use household_tasks_get tool to find the correct task ID.',
|
|
57
59
|
},
|
|
58
60
|
note: {
|
|
59
61
|
type: 'string',
|
|
60
|
-
description: 'Optional note for the task completion'
|
|
61
|
-
}
|
|
62
|
+
description: 'Optional note for the task completion',
|
|
63
|
+
},
|
|
62
64
|
},
|
|
63
|
-
required: ['taskId']
|
|
64
|
-
}
|
|
65
|
+
required: ['taskId'],
|
|
66
|
+
},
|
|
65
67
|
},
|
|
66
68
|
// ==================== BATTERY MANAGEMENT ====================
|
|
67
69
|
{
|
|
68
70
|
name: 'household_batteries_get',
|
|
69
71
|
description: '[HOUSEHOLD/BATTERIES] Get all batteries from your Grocy instance.',
|
|
72
|
+
annotations: { readOnlyHint: true },
|
|
70
73
|
inputSchema: {
|
|
71
74
|
type: 'object',
|
|
72
75
|
properties: {},
|
|
73
|
-
required: []
|
|
74
|
-
}
|
|
76
|
+
required: [],
|
|
77
|
+
},
|
|
75
78
|
},
|
|
76
79
|
{
|
|
77
80
|
name: 'household_batteries_charge',
|
|
@@ -81,19 +84,19 @@ export const householdToolDefinitions = [
|
|
|
81
84
|
properties: {
|
|
82
85
|
batteryId: {
|
|
83
86
|
type: 'number',
|
|
84
|
-
description: 'ID of the battery to charge. Use household_batteries_get tool to find the correct battery ID.'
|
|
87
|
+
description: 'ID of the battery to charge. Use household_batteries_get tool to find the correct battery ID.',
|
|
85
88
|
},
|
|
86
89
|
trackedTime: {
|
|
87
90
|
type: 'string',
|
|
88
|
-
description: 'Time when the battery was charged in YYYY-MM-DD HH:mm:ss format (optional, defaults to current time)'
|
|
91
|
+
description: 'Time when the battery was charged in YYYY-MM-DD HH:mm:ss format (optional, defaults to current time)',
|
|
89
92
|
},
|
|
90
93
|
note: {
|
|
91
94
|
type: 'string',
|
|
92
|
-
description: 'Optional note for the battery charge'
|
|
93
|
-
}
|
|
95
|
+
description: 'Optional note for the battery charge',
|
|
96
|
+
},
|
|
94
97
|
},
|
|
95
|
-
required: ['batteryId']
|
|
96
|
-
}
|
|
98
|
+
required: ['batteryId'],
|
|
99
|
+
},
|
|
97
100
|
},
|
|
98
101
|
{
|
|
99
102
|
name: 'household_batteries_print_label',
|
|
@@ -103,11 +106,11 @@ export const householdToolDefinitions = [
|
|
|
103
106
|
properties: {
|
|
104
107
|
batteryId: {
|
|
105
108
|
type: 'number',
|
|
106
|
-
description: 'ID of the battery to print label for. Use household_batteries_get tool to find the correct battery ID.'
|
|
107
|
-
}
|
|
109
|
+
description: 'ID of the battery to print label for. Use household_batteries_get tool to find the correct battery ID.',
|
|
110
|
+
},
|
|
108
111
|
},
|
|
109
|
-
required: ['batteryId']
|
|
110
|
-
}
|
|
112
|
+
required: ['batteryId'],
|
|
113
|
+
},
|
|
111
114
|
},
|
|
112
115
|
// ==================== CHORE LABEL PRINTING ====================
|
|
113
116
|
{
|
|
@@ -118,21 +121,22 @@ export const householdToolDefinitions = [
|
|
|
118
121
|
properties: {
|
|
119
122
|
choreId: {
|
|
120
123
|
type: 'number',
|
|
121
|
-
description: 'ID of the chore to print label for. Use household_chores_get tool to find the correct chore ID.'
|
|
122
|
-
}
|
|
124
|
+
description: 'ID of the chore to print label for. Use household_chores_get tool to find the correct chore ID.',
|
|
125
|
+
},
|
|
123
126
|
},
|
|
124
|
-
required: ['choreId']
|
|
125
|
-
}
|
|
127
|
+
required: ['choreId'],
|
|
128
|
+
},
|
|
126
129
|
},
|
|
127
130
|
// ==================== EQUIPMENT MANAGEMENT ====================
|
|
128
131
|
{
|
|
129
132
|
name: 'household_equipment_get',
|
|
130
|
-
description: '[HOUSEHOLD/EQUIPMENT]
|
|
133
|
+
description: '[HOUSEHOLD/EQUIPMENT] List **equipment** assets tracked in Grocy (appliances, tools—not chore definitions). For recurring chore definitions use household_chores_get.',
|
|
134
|
+
annotations: { readOnlyHint: true },
|
|
131
135
|
inputSchema: {
|
|
132
136
|
type: 'object',
|
|
133
137
|
properties: {},
|
|
134
|
-
required: []
|
|
135
|
-
}
|
|
138
|
+
required: [],
|
|
139
|
+
},
|
|
136
140
|
},
|
|
137
141
|
// ==================== ACTION UTILITIES ====================
|
|
138
142
|
{
|
|
@@ -144,14 +148,14 @@ export const householdToolDefinitions = [
|
|
|
144
148
|
entityType: {
|
|
145
149
|
type: 'string',
|
|
146
150
|
enum: ['chore', 'chores', 'task', 'tasks', 'battery', 'batteries'],
|
|
147
|
-
description: 'Type of entity to undo action for'
|
|
151
|
+
description: 'Type of entity to undo action for',
|
|
148
152
|
},
|
|
149
153
|
id: {
|
|
150
154
|
type: 'number',
|
|
151
|
-
description: 'ID of the specific execution/completion/charge to undo'
|
|
152
|
-
}
|
|
155
|
+
description: 'ID of the specific execution/completion/charge to undo',
|
|
156
|
+
},
|
|
153
157
|
},
|
|
154
|
-
required: ['entityType', 'id']
|
|
155
|
-
}
|
|
156
|
-
}
|
|
158
|
+
required: ['entityType', 'id'],
|
|
159
|
+
},
|
|
160
|
+
},
|
|
157
161
|
];
|
|
@@ -15,7 +15,7 @@ export class HouseholdToolHandlers extends BaseToolHandler {
|
|
|
15
15
|
const body = {
|
|
16
16
|
tracked_time: trackedTime || timestamp,
|
|
17
17
|
...(executedBy ? { done_by: executedBy } : {}),
|
|
18
|
-
...(note ? { note } : {})
|
|
18
|
+
...(note ? { note } : {}),
|
|
19
19
|
};
|
|
20
20
|
const result = await this.apiCall(`/chores/${choreId}/execute`, 'POST', body);
|
|
21
21
|
return this.createSuccess(result, 'Chore execution tracked successfully');
|
|
@@ -50,7 +50,7 @@ export class HouseholdToolHandlers extends BaseToolHandler {
|
|
|
50
50
|
const timestamp = new Date().toISOString().replace('T', ' ').substring(0, 19);
|
|
51
51
|
const body = {
|
|
52
52
|
tracked_time: trackedTime || timestamp,
|
|
53
|
-
...(note ? { note } : {})
|
|
53
|
+
...(note ? { note } : {}),
|
|
54
54
|
};
|
|
55
55
|
const result = await this.apiCall(`/batteries/${batteryId}/charge`, 'POST', body);
|
|
56
56
|
return this.createSuccess(result, 'Battery charged successfully');
|
|
@@ -19,7 +19,7 @@ export const householdModule = {
|
|
|
19
19
|
// Equipment Management
|
|
20
20
|
household_equipment_get: handlers.getEquipment,
|
|
21
21
|
// Action Utilities
|
|
22
|
-
household_actions_undo: handlers.undoAction
|
|
23
|
-
}
|
|
22
|
+
household_actions_undo: handlers.undoAction,
|
|
23
|
+
},
|
|
24
24
|
};
|
|
25
25
|
export * from './definitions.js';
|