mcp-grocy 2.2.0 → 2.6.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 +45 -0
- package/README.md +125 -32
- package/build/resources/CHANGELOG.md +47 -0
- package/build/resources/DOCS.md +8 -3
- package/build/resources/README.md +125 -32
- package/build/resources/api-reference.md +88 -88
- package/build/resources/config.md +45 -17
- package/build/resources/examples.md +120 -221
- package/build/resources/installation.md +9 -14
- package/build/resources/response-format.md +29 -20
- package/build/version.js +2 -2
- package/package.json +50 -24
- package/build/api/client.js +0 -121
- package/build/config/index.js +0 -205
- package/build/main.js +0 -44
- package/build/server/http-server.js +0 -218
- package/build/server/mcp-server.js +0 -163
- package/build/server/resources.js +0 -60
- package/build/tools/base.js +0 -141
- package/build/tools/household/definitions.js +0 -157
- package/build/tools/household/handlers.js +0 -109
- package/build/tools/household/index.js +0 -25
- package/build/tools/index.js +0 -2
- package/build/tools/inventory/definitions.js +0 -379
- package/build/tools/inventory/handlers.js +0 -430
- package/build/tools/inventory/index.js +0 -32
- package/build/tools/module-loader.js +0 -151
- package/build/tools/recipes/definitions.js +0 -261
- package/build/tools/recipes/handlers.js +0 -471
- package/build/tools/recipes/index.js +0 -33
- package/build/tools/recipes/validations.js +0 -23
- package/build/tools/shopping/definitions.js +0 -71
- package/build/tools/shopping/handlers.js +0 -43
- package/build/tools/shopping/index.js +0 -14
- package/build/tools/system/definitions.js +0 -86
- package/build/tools/system/handlers.js +0 -94
- package/build/tools/system/index.js +0 -16
- package/build/tools/types.js +0 -1
- package/build/tools/validation-helpers.js +0 -36
- package/build/types/index.js +0 -62
- package/build/utils/errors.js +0 -138
- package/build/utils/logger.js +0 -141
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
export const householdToolDefinitions = [
|
|
2
|
-
// ==================== CHORE MANAGEMENT ====================
|
|
3
|
-
{
|
|
4
|
-
name: 'household_chores_get',
|
|
5
|
-
description: '[HOUSEHOLD/CHORES] Get all chores from your Grocy instance.',
|
|
6
|
-
inputSchema: {
|
|
7
|
-
type: 'object',
|
|
8
|
-
properties: {},
|
|
9
|
-
required: []
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
name: 'household_chores_execute',
|
|
14
|
-
description: '[HOUSEHOLD/CHORES] Track the execution of a chore in your Grocy instance.',
|
|
15
|
-
inputSchema: {
|
|
16
|
-
type: 'object',
|
|
17
|
-
properties: {
|
|
18
|
-
choreId: {
|
|
19
|
-
type: 'number',
|
|
20
|
-
description: 'ID of the chore to track execution for. Use household_chores_get tool to find the correct chore ID.'
|
|
21
|
-
},
|
|
22
|
-
executedBy: {
|
|
23
|
-
type: 'number',
|
|
24
|
-
description: 'ID of the user who executed the chore (optional). Use system_users_get tool to find user IDs.'
|
|
25
|
-
},
|
|
26
|
-
trackedTime: {
|
|
27
|
-
type: 'string',
|
|
28
|
-
description: 'Time when the chore was executed in YYYY-MM-DD HH:mm:ss format (optional, defaults to current time)'
|
|
29
|
-
},
|
|
30
|
-
note: {
|
|
31
|
-
type: 'string',
|
|
32
|
-
description: 'Optional note for the chore execution'
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
required: ['choreId']
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
// ==================== TASK MANAGEMENT ====================
|
|
39
|
-
{
|
|
40
|
-
name: 'household_tasks_get',
|
|
41
|
-
description: '[HOUSEHOLD/TASKS] Get all tasks from your Grocy instance.',
|
|
42
|
-
inputSchema: {
|
|
43
|
-
type: 'object',
|
|
44
|
-
properties: {},
|
|
45
|
-
required: []
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
name: 'household_tasks_complete',
|
|
50
|
-
description: '[HOUSEHOLD/TASKS] Mark a task as completed in your Grocy instance.',
|
|
51
|
-
inputSchema: {
|
|
52
|
-
type: 'object',
|
|
53
|
-
properties: {
|
|
54
|
-
taskId: {
|
|
55
|
-
type: 'number',
|
|
56
|
-
description: 'ID of the task to complete. Use household_tasks_get tool to find the correct task ID.'
|
|
57
|
-
},
|
|
58
|
-
note: {
|
|
59
|
-
type: 'string',
|
|
60
|
-
description: 'Optional note for the task completion'
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
required: ['taskId']
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
// ==================== BATTERY MANAGEMENT ====================
|
|
67
|
-
{
|
|
68
|
-
name: 'household_batteries_get',
|
|
69
|
-
description: '[HOUSEHOLD/BATTERIES] Get all batteries from your Grocy instance.',
|
|
70
|
-
inputSchema: {
|
|
71
|
-
type: 'object',
|
|
72
|
-
properties: {},
|
|
73
|
-
required: []
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
name: 'household_batteries_charge',
|
|
78
|
-
description: '[HOUSEHOLD/BATTERIES] Track battery charging in your Grocy instance.',
|
|
79
|
-
inputSchema: {
|
|
80
|
-
type: 'object',
|
|
81
|
-
properties: {
|
|
82
|
-
batteryId: {
|
|
83
|
-
type: 'number',
|
|
84
|
-
description: 'ID of the battery to charge. Use household_batteries_get tool to find the correct battery ID.'
|
|
85
|
-
},
|
|
86
|
-
trackedTime: {
|
|
87
|
-
type: 'string',
|
|
88
|
-
description: 'Time when the battery was charged in YYYY-MM-DD HH:mm:ss format (optional, defaults to current time)'
|
|
89
|
-
},
|
|
90
|
-
note: {
|
|
91
|
-
type: 'string',
|
|
92
|
-
description: 'Optional note for the battery charge'
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
required: ['batteryId']
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
name: 'household_batteries_print_label',
|
|
100
|
-
description: '[HOUSEHOLD/BATTERIES] Print a Grocycode label for a battery. Use household_batteries_get to find valid batteryId values.',
|
|
101
|
-
inputSchema: {
|
|
102
|
-
type: 'object',
|
|
103
|
-
properties: {
|
|
104
|
-
batteryId: {
|
|
105
|
-
type: 'number',
|
|
106
|
-
description: 'ID of the battery to print label for. Use household_batteries_get tool to find the correct battery ID.'
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
required: ['batteryId']
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
// ==================== CHORE LABEL PRINTING ====================
|
|
113
|
-
{
|
|
114
|
-
name: 'household_chores_print_label',
|
|
115
|
-
description: '[HOUSEHOLD/CHORES] Print a Grocycode label for a chore. Use household_chores_get to find valid choreId values.',
|
|
116
|
-
inputSchema: {
|
|
117
|
-
type: 'object',
|
|
118
|
-
properties: {
|
|
119
|
-
choreId: {
|
|
120
|
-
type: 'number',
|
|
121
|
-
description: 'ID of the chore to print label for. Use household_chores_get tool to find the correct chore ID.'
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
required: ['choreId']
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
// ==================== EQUIPMENT MANAGEMENT ====================
|
|
128
|
-
{
|
|
129
|
-
name: 'household_equipment_get',
|
|
130
|
-
description: '[HOUSEHOLD/EQUIPMENT] Get all equipment from your Grocy instance.',
|
|
131
|
-
inputSchema: {
|
|
132
|
-
type: 'object',
|
|
133
|
-
properties: {},
|
|
134
|
-
required: []
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
// ==================== ACTION UTILITIES ====================
|
|
138
|
-
{
|
|
139
|
-
name: 'household_actions_undo',
|
|
140
|
-
description: '[HOUSEHOLD/ACTIONS] Undo a previously executed action (chore execution, task completion, or battery charge).',
|
|
141
|
-
inputSchema: {
|
|
142
|
-
type: 'object',
|
|
143
|
-
properties: {
|
|
144
|
-
entityType: {
|
|
145
|
-
type: 'string',
|
|
146
|
-
enum: ['chore', 'chores', 'task', 'tasks', 'battery', 'batteries'],
|
|
147
|
-
description: 'Type of entity to undo action for'
|
|
148
|
-
},
|
|
149
|
-
id: {
|
|
150
|
-
type: 'number',
|
|
151
|
-
description: 'ID of the specific execution/completion/charge to undo'
|
|
152
|
-
}
|
|
153
|
-
},
|
|
154
|
-
required: ['entityType', 'id']
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
];
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { BaseToolHandler } from '../base.js';
|
|
2
|
-
export class HouseholdToolHandlers extends BaseToolHandler {
|
|
3
|
-
// ==================== CHORE MANAGEMENT ====================
|
|
4
|
-
getChores = async () => {
|
|
5
|
-
return this.executeToolHandler(async () => {
|
|
6
|
-
const data = await this.apiCall('/objects/chores');
|
|
7
|
-
return this.createSuccess(data);
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
trackChoreExecution = async (args) => {
|
|
11
|
-
return this.executeToolHandler(async () => {
|
|
12
|
-
const { choreId, executedBy, trackedTime, note } = args || {};
|
|
13
|
-
this.validateRequired({ choreId }, ['choreId']);
|
|
14
|
-
const timestamp = new Date().toISOString().replace('T', ' ').substring(0, 19);
|
|
15
|
-
const body = {
|
|
16
|
-
tracked_time: trackedTime || timestamp,
|
|
17
|
-
...(executedBy ? { done_by: executedBy } : {}),
|
|
18
|
-
...(note ? { note } : {})
|
|
19
|
-
};
|
|
20
|
-
const result = await this.apiCall(`/chores/${choreId}/execute`, 'POST', body);
|
|
21
|
-
return this.createSuccess(result, 'Chore execution tracked successfully');
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
// ==================== TASK MANAGEMENT ====================
|
|
25
|
-
getTasks = async () => {
|
|
26
|
-
return this.executeToolHandler(async () => {
|
|
27
|
-
const data = await this.apiCall('/objects/tasks');
|
|
28
|
-
return this.createSuccess(data);
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
completeTask = async (args) => {
|
|
32
|
-
return this.executeToolHandler(async () => {
|
|
33
|
-
const { taskId, note } = args || {};
|
|
34
|
-
this.validateRequired({ taskId }, ['taskId']);
|
|
35
|
-
const result = await this.apiCall(`/tasks/${taskId}/complete`, 'POST', note ? { note } : {});
|
|
36
|
-
return this.createSuccess(result, 'Task completed successfully');
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
// ==================== BATTERY MANAGEMENT ====================
|
|
40
|
-
getBatteries = async () => {
|
|
41
|
-
return this.executeToolHandler(async () => {
|
|
42
|
-
const data = await this.apiCall('/objects/batteries');
|
|
43
|
-
return this.createSuccess(data);
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
|
-
chargeBattery = async (args) => {
|
|
47
|
-
return this.executeToolHandler(async () => {
|
|
48
|
-
const { batteryId, trackedTime, note } = args || {};
|
|
49
|
-
this.validateRequired({ batteryId }, ['batteryId']);
|
|
50
|
-
const timestamp = new Date().toISOString().replace('T', ' ').substring(0, 19);
|
|
51
|
-
const body = {
|
|
52
|
-
tracked_time: trackedTime || timestamp,
|
|
53
|
-
...(note ? { note } : {})
|
|
54
|
-
};
|
|
55
|
-
const result = await this.apiCall(`/batteries/${batteryId}/charge`, 'POST', body);
|
|
56
|
-
return this.createSuccess(result, 'Battery charged successfully');
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
// ==================== EQUIPMENT MANAGEMENT ====================
|
|
60
|
-
getEquipment = async () => {
|
|
61
|
-
return this.executeToolHandler(async () => {
|
|
62
|
-
const data = await this.apiCall('/objects/equipment');
|
|
63
|
-
return this.createSuccess(data);
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
|
-
// ==================== LABEL PRINTING ====================
|
|
67
|
-
printBatteryLabel = async (args) => {
|
|
68
|
-
return this.executeToolHandler(async () => {
|
|
69
|
-
const { batteryId } = args || {};
|
|
70
|
-
this.validateRequired({ batteryId }, ['batteryId']);
|
|
71
|
-
const result = await this.apiCall(`/batteries/${batteryId}/printlabel`);
|
|
72
|
-
return this.createSuccess(result, 'Battery label printed successfully');
|
|
73
|
-
});
|
|
74
|
-
};
|
|
75
|
-
printChoreLabel = async (args) => {
|
|
76
|
-
return this.executeToolHandler(async () => {
|
|
77
|
-
const { choreId } = args || {};
|
|
78
|
-
this.validateRequired({ choreId }, ['choreId']);
|
|
79
|
-
const result = await this.apiCall(`/chores/${choreId}/printlabel`);
|
|
80
|
-
return this.createSuccess(result, 'Chore label printed successfully');
|
|
81
|
-
});
|
|
82
|
-
};
|
|
83
|
-
// ==================== ACTION UTILITIES ====================
|
|
84
|
-
undoAction = async (args) => {
|
|
85
|
-
return this.executeToolHandler(async () => {
|
|
86
|
-
const { entityType, id } = args;
|
|
87
|
-
this.validateRequired({ entityType, id }, ['entityType', 'id']);
|
|
88
|
-
let endpoint;
|
|
89
|
-
switch (entityType.toLowerCase()) {
|
|
90
|
-
case 'chore':
|
|
91
|
-
case 'chores':
|
|
92
|
-
endpoint = `/chores/executions/${id}/undo`;
|
|
93
|
-
break;
|
|
94
|
-
case 'battery':
|
|
95
|
-
case 'batteries':
|
|
96
|
-
endpoint = `/batteries/charge-cycles/${id}/undo`;
|
|
97
|
-
break;
|
|
98
|
-
case 'task':
|
|
99
|
-
case 'tasks':
|
|
100
|
-
endpoint = `/tasks/${id}/undo`;
|
|
101
|
-
break;
|
|
102
|
-
default:
|
|
103
|
-
return this.createError(`Unsupported entity type: ${entityType}`);
|
|
104
|
-
}
|
|
105
|
-
const result = await this.apiCall(endpoint, 'POST');
|
|
106
|
-
return this.createSuccess(result, `${entityType} action undone successfully`);
|
|
107
|
-
});
|
|
108
|
-
};
|
|
109
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { householdToolDefinitions } from './definitions.js';
|
|
2
|
-
import { HouseholdToolHandlers } from './handlers.js';
|
|
3
|
-
const handlers = new HouseholdToolHandlers();
|
|
4
|
-
export const householdModule = {
|
|
5
|
-
definitions: householdToolDefinitions,
|
|
6
|
-
handlers: {
|
|
7
|
-
// Chore Management
|
|
8
|
-
household_chores_get: handlers.getChores,
|
|
9
|
-
household_chores_execute: handlers.trackChoreExecution,
|
|
10
|
-
// Task Management
|
|
11
|
-
household_tasks_get: handlers.getTasks,
|
|
12
|
-
household_tasks_complete: handlers.completeTask,
|
|
13
|
-
// Battery Management
|
|
14
|
-
household_batteries_get: handlers.getBatteries,
|
|
15
|
-
household_batteries_charge: handlers.chargeBattery,
|
|
16
|
-
household_batteries_print_label: handlers.printBatteryLabel,
|
|
17
|
-
// Chore Label Printing
|
|
18
|
-
household_chores_print_label: handlers.printChoreLabel,
|
|
19
|
-
// Equipment Management
|
|
20
|
-
household_equipment_get: handlers.getEquipment,
|
|
21
|
-
// Action Utilities
|
|
22
|
-
household_actions_undo: handlers.undoAction
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
export * from './definitions.js';
|
package/build/tools/index.js
DELETED
|
@@ -1,379 +0,0 @@
|
|
|
1
|
-
export const inventoryToolDefinitions = [
|
|
2
|
-
// Product Management Tools
|
|
3
|
-
{
|
|
4
|
-
name: 'inventory_products_get',
|
|
5
|
-
description: '[INVENTORY/PRODUCTS] Get specific fields for all products from your Grocy instance. You must specify which fields to retrieve.',
|
|
6
|
-
inputSchema: {
|
|
7
|
-
type: 'object',
|
|
8
|
-
properties: {
|
|
9
|
-
fields: {
|
|
10
|
-
type: 'array',
|
|
11
|
-
items: {
|
|
12
|
-
type: 'string',
|
|
13
|
-
enum: ['id', 'name', 'description', 'product_group_id', 'active', 'location_id', 'shopping_location_id', 'qu_id_purchase', 'qu_id_stock', 'qu_factor_purchase_to_stock', 'min_stock_amount', 'default_best_before_days', 'default_best_before_days_after_open', 'default_best_before_days_after_freezing', 'default_best_before_days_after_thawing', 'picture_file_name', 'allow_label_per_unit', 'energy_per_stock_unit', 'calories_per_stock_unit', 'default_stock_label_type', 'should_not_be_frozen', 'treat_opened_as_out_of_stock', 'no_own_stock', 'cumulate_min_stock_amount_of_sub_products', 'parent_product_id', 'calories_per_unit_factor', 'quick_consume_amount', 'hide_on_stock_overview']
|
|
14
|
-
},
|
|
15
|
-
description: 'Array of field names to retrieve. For basic lookup use ["id", "name"]. For detailed info include ["id", "name", "description", "active"]. Available fields: id, name, description, product_group_id, active, location_id, shopping_location_id, qu_id_purchase, qu_id_stock, qu_factor_purchase_to_stock, min_stock_amount, default_best_before_days, default_best_before_days_after_open, default_best_before_days_after_freezing, default_best_before_days_after_thawing, picture_file_name, allow_label_per_unit, energy_per_stock_unit, calories_per_stock_unit, default_stock_label_type, should_not_be_frozen, treat_opened_as_out_of_stock, no_own_stock, cumulate_min_stock_amount_of_sub_products, parent_product_id, calories_per_unit_factor, quick_consume_amount, hide_on_stock_overview'
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
required: ['fields']
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
name: 'inventory_products_get_groups',
|
|
23
|
-
description: '[INVENTORY/PRODUCTS] Get all product groups from your Grocy instance.',
|
|
24
|
-
inputSchema: {
|
|
25
|
-
type: 'object',
|
|
26
|
-
properties: {},
|
|
27
|
-
required: []
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
name: 'inventory_products_get_price_history',
|
|
32
|
-
description: '[INVENTORY/PRODUCTS] Get the price history of a product from your Grocy instance.',
|
|
33
|
-
inputSchema: {
|
|
34
|
-
type: 'object',
|
|
35
|
-
properties: {
|
|
36
|
-
productId: {
|
|
37
|
-
type: 'number',
|
|
38
|
-
description: 'ID of the product to get price history for. Use get_products tool to find the correct product ID by name.'
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
required: ['productId']
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
// Stock Management Tools
|
|
45
|
-
{
|
|
46
|
-
name: 'inventory_stock_get_all',
|
|
47
|
-
description: '[INVENTORY/STOCK] Get all stock entries from every location in your Grocy instance. This returns the complete stock database with detailed information including stock entry IDs.',
|
|
48
|
-
inputSchema: {
|
|
49
|
-
type: 'object',
|
|
50
|
-
properties: {},
|
|
51
|
-
required: []
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
name: 'inventory_stock_get_by_product',
|
|
56
|
-
description: '[INVENTORY/STOCK] Get stock entries for a specific product in your Grocy instance with filtered essential information.',
|
|
57
|
-
inputSchema: {
|
|
58
|
-
type: 'object',
|
|
59
|
-
properties: {
|
|
60
|
-
productId: {
|
|
61
|
-
type: 'number',
|
|
62
|
-
description: 'ID of the product to get stock entries for. Use get_products tool to find the correct product ID by name.'
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
required: ['productId']
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
name: 'inventory_stock_get_volatile',
|
|
70
|
-
description: '[INVENTORY/STOCK] Get volatile stock information (due products, overdue products, expired products, missing products).',
|
|
71
|
-
inputSchema: {
|
|
72
|
-
type: 'object',
|
|
73
|
-
properties: {
|
|
74
|
-
includeDetails: {
|
|
75
|
-
type: 'boolean',
|
|
76
|
-
description: 'Whether to include additional details about each stock item'
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
required: []
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
name: 'inventory_stock_get_by_location',
|
|
84
|
-
description: '[INVENTORY/STOCK] Get stock entries from a specific location in your Grocy instance.',
|
|
85
|
-
inputSchema: {
|
|
86
|
-
type: 'object',
|
|
87
|
-
properties: {
|
|
88
|
-
locationId: {
|
|
89
|
-
type: 'number',
|
|
90
|
-
description: 'ID of the location to get stock for.'
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
required: ['locationId']
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
// Stock Transaction Tools
|
|
97
|
-
{
|
|
98
|
-
name: 'inventory_transactions_purchase',
|
|
99
|
-
description: '[INVENTORY/TRANSACTIONS] Add a product to stock (purchase/add inventory). Use inventory_products_get to find the product ID and system_locations_get to find location IDs.',
|
|
100
|
-
inputSchema: {
|
|
101
|
-
type: 'object',
|
|
102
|
-
properties: {
|
|
103
|
-
productId: {
|
|
104
|
-
type: 'number',
|
|
105
|
-
description: 'ID of the product to purchase. Use get_products tool to find the correct product ID by name.'
|
|
106
|
-
},
|
|
107
|
-
amount: {
|
|
108
|
-
type: 'number',
|
|
109
|
-
description: 'Amount to purchase in the product\'s stock unit (e.g., 2 pieces, 1.5 kg, 750 ml). Ensure you know the product\'s unit before specifying amount.'
|
|
110
|
-
},
|
|
111
|
-
bestBeforeDate: {
|
|
112
|
-
type: 'string',
|
|
113
|
-
description: 'Best before date in YYYY-MM-DD format. If not provided, will use product\'s default best before days.'
|
|
114
|
-
},
|
|
115
|
-
price: {
|
|
116
|
-
type: 'number',
|
|
117
|
-
description: 'Price per stock unit (optional)'
|
|
118
|
-
},
|
|
119
|
-
locationId: {
|
|
120
|
-
type: 'number',
|
|
121
|
-
description: 'Location ID where the product should be stored. Use get_locations tool to find the correct location ID. If not provided, uses product\'s default location.'
|
|
122
|
-
},
|
|
123
|
-
note: {
|
|
124
|
-
type: 'string',
|
|
125
|
-
description: 'Optional note for the stock entry'
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
required: ['productId', 'amount']
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
name: 'inventory_transactions_consume',
|
|
133
|
-
description: '[INVENTORY/TRANSACTIONS] Remove a product from stock (consume/use inventory). For more granular control over specific stock entries, prefer inventory_stock_entry_consume. Use inventory_products_get to find the product ID.',
|
|
134
|
-
inputSchema: {
|
|
135
|
-
type: 'object',
|
|
136
|
-
properties: {
|
|
137
|
-
productId: {
|
|
138
|
-
type: 'number',
|
|
139
|
-
description: 'ID of the product to consume. Use get_products tool to find the correct product ID by name.'
|
|
140
|
-
},
|
|
141
|
-
amount: {
|
|
142
|
-
type: 'number',
|
|
143
|
-
description: 'Amount to consume in the product\'s stock unit (e.g., 2 pieces, 1.5 kg, 750 ml). Ensure you know the product\'s unit before specifying amount.'
|
|
144
|
-
},
|
|
145
|
-
spoiled: {
|
|
146
|
-
type: 'boolean',
|
|
147
|
-
description: 'Whether the product was spoiled/wasted (default: false)',
|
|
148
|
-
default: false
|
|
149
|
-
},
|
|
150
|
-
locationId: {
|
|
151
|
-
type: 'number',
|
|
152
|
-
description: 'Location ID to consume from (optional). Use get_locations tool to find the correct location ID.'
|
|
153
|
-
},
|
|
154
|
-
note: {
|
|
155
|
-
type: 'string',
|
|
156
|
-
description: 'Optional note for the consumption'
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
required: ['productId', 'amount']
|
|
160
|
-
}
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
name: 'inventory_transactions_transfer',
|
|
164
|
-
description: '[INVENTORY/TRANSACTIONS] Transfer a product between locations. For more granular control over specific stock entries, prefer inventory_stock_entry_transfer. Use inventory_products_get to find the product ID and system_locations_get to find location IDs.',
|
|
165
|
-
inputSchema: {
|
|
166
|
-
type: 'object',
|
|
167
|
-
properties: {
|
|
168
|
-
productId: {
|
|
169
|
-
type: 'number',
|
|
170
|
-
description: 'ID of the product to transfer. Use get_products tool to find the correct product ID by name.'
|
|
171
|
-
},
|
|
172
|
-
amount: {
|
|
173
|
-
type: 'number',
|
|
174
|
-
description: 'Amount to transfer in the product\'s stock unit (e.g., 2 pieces, 1.5 kg, 750 ml). Ensure you know the product\'s unit before specifying amount.'
|
|
175
|
-
},
|
|
176
|
-
fromLocationId: {
|
|
177
|
-
type: 'number',
|
|
178
|
-
description: 'Source location ID. Use get_locations tool to find the correct location ID.'
|
|
179
|
-
},
|
|
180
|
-
toLocationId: {
|
|
181
|
-
type: 'number',
|
|
182
|
-
description: 'Destination location ID. Use get_locations tool to find the correct location ID.'
|
|
183
|
-
},
|
|
184
|
-
note: {
|
|
185
|
-
type: 'string',
|
|
186
|
-
description: 'Optional note for the transfer'
|
|
187
|
-
}
|
|
188
|
-
},
|
|
189
|
-
required: ['productId', 'amount', 'fromLocationId', 'toLocationId']
|
|
190
|
-
}
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
name: 'inventory_transactions_adjust',
|
|
194
|
-
description: '[INVENTORY/TRANSACTIONS] Track a product inventory (set current stock amount). Use inventory_products_get to find the product ID and system_locations_get to find location IDs.',
|
|
195
|
-
inputSchema: {
|
|
196
|
-
type: 'object',
|
|
197
|
-
properties: {
|
|
198
|
-
productId: {
|
|
199
|
-
type: 'number',
|
|
200
|
-
description: 'ID of the product to inventory. Use get_products tool to find the correct product ID by name.'
|
|
201
|
-
},
|
|
202
|
-
newAmount: {
|
|
203
|
-
type: 'number',
|
|
204
|
-
description: 'The new/correct total amount of stock for this product in the product\'s stock unit.'
|
|
205
|
-
},
|
|
206
|
-
bestBeforeDate: {
|
|
207
|
-
type: 'string',
|
|
208
|
-
description: 'Best before date in YYYY-MM-DD format for the inventory correction.'
|
|
209
|
-
},
|
|
210
|
-
locationId: {
|
|
211
|
-
type: 'number',
|
|
212
|
-
description: 'Location ID for the inventory (optional). Use get_locations tool to find the correct location ID.'
|
|
213
|
-
},
|
|
214
|
-
note: {
|
|
215
|
-
type: 'string',
|
|
216
|
-
description: 'Optional note for the inventory correction'
|
|
217
|
-
}
|
|
218
|
-
},
|
|
219
|
-
required: ['productId', 'newAmount']
|
|
220
|
-
}
|
|
221
|
-
},
|
|
222
|
-
{
|
|
223
|
-
name: 'inventory_transactions_open',
|
|
224
|
-
description: '[INVENTORY/TRANSACTIONS] Mark a product as opened/started. For more granular control over specific stock entries, prefer inventory_stock_entry_open. Use inventory_products_get to find the product ID.',
|
|
225
|
-
inputSchema: {
|
|
226
|
-
type: 'object',
|
|
227
|
-
properties: {
|
|
228
|
-
productId: {
|
|
229
|
-
type: 'number',
|
|
230
|
-
description: 'ID of the product to open. Use get_products tool to find the correct product ID by name.'
|
|
231
|
-
},
|
|
232
|
-
amount: {
|
|
233
|
-
type: 'number',
|
|
234
|
-
description: 'Amount to mark as opened in the product\'s stock unit (e.g., 1 piece, 0.5 kg). Default: 1',
|
|
235
|
-
default: 1
|
|
236
|
-
},
|
|
237
|
-
note: {
|
|
238
|
-
type: 'string',
|
|
239
|
-
description: 'Optional note for opening the product'
|
|
240
|
-
}
|
|
241
|
-
},
|
|
242
|
-
required: ['productId']
|
|
243
|
-
}
|
|
244
|
-
},
|
|
245
|
-
{
|
|
246
|
-
name: 'inventory_products_lookup',
|
|
247
|
-
description: '[INVENTORY/PRODUCTS] Search for products by name using fuzzy matching. Returns up to 5 best matches with stock information and location details.',
|
|
248
|
-
inputSchema: {
|
|
249
|
-
type: 'object',
|
|
250
|
-
properties: {
|
|
251
|
-
productName: {
|
|
252
|
-
type: 'string',
|
|
253
|
-
description: 'Product name to search for. Uses fuzzy matching to find similar products.'
|
|
254
|
-
}
|
|
255
|
-
},
|
|
256
|
-
required: ['productName']
|
|
257
|
-
}
|
|
258
|
-
},
|
|
259
|
-
{
|
|
260
|
-
name: 'inventory_products_print_label',
|
|
261
|
-
description: '[INVENTORY/PRODUCTS] Print a Grocycode label for a product. Use inventory_products_get to find valid productId values.',
|
|
262
|
-
inputSchema: {
|
|
263
|
-
type: 'object',
|
|
264
|
-
properties: {
|
|
265
|
-
productId: {
|
|
266
|
-
type: 'number',
|
|
267
|
-
description: 'ID of the product to print label for. Use inventory_products_get tool to find the correct product ID.'
|
|
268
|
-
}
|
|
269
|
-
},
|
|
270
|
-
required: ['productId']
|
|
271
|
-
}
|
|
272
|
-
},
|
|
273
|
-
{
|
|
274
|
-
name: 'inventory_stock_entry_print_label',
|
|
275
|
-
description: '[INVENTORY/STOCK] Print a label for a specific stock entry. Use inventory_stock_get_by_product to find valid stockId values.',
|
|
276
|
-
inputSchema: {
|
|
277
|
-
type: 'object',
|
|
278
|
-
properties: {
|
|
279
|
-
stockId: {
|
|
280
|
-
type: 'number',
|
|
281
|
-
description: 'ID of the stock entry to print label for. Use get_stock_by_product tool to find specific stockId values.'
|
|
282
|
-
},
|
|
283
|
-
productId: {
|
|
284
|
-
type: 'number',
|
|
285
|
-
description: 'ID of the product that the stock entry belongs to. This is required for validation.'
|
|
286
|
-
}
|
|
287
|
-
},
|
|
288
|
-
required: ['stockId', 'productId']
|
|
289
|
-
}
|
|
290
|
-
},
|
|
291
|
-
// ==================== GRANULAR STOCK ENTRY OPERATIONS ====================
|
|
292
|
-
{
|
|
293
|
-
name: 'inventory_stock_entry_consume',
|
|
294
|
-
description: '[INVENTORY/STOCK] Consume from a specific stock entry. Use inventory_stock_get_by_product to find specific stockId values.',
|
|
295
|
-
inputSchema: {
|
|
296
|
-
type: 'object',
|
|
297
|
-
properties: {
|
|
298
|
-
stockId: {
|
|
299
|
-
type: 'number',
|
|
300
|
-
description: 'ID of the specific stock entry to consume from.'
|
|
301
|
-
},
|
|
302
|
-
productId: {
|
|
303
|
-
type: 'number',
|
|
304
|
-
description: 'ID of the product being consumed. This is required for verification - if you know the stockId, you must know the productId.'
|
|
305
|
-
},
|
|
306
|
-
amount: {
|
|
307
|
-
type: 'number',
|
|
308
|
-
description: 'Amount to consume in the product\'s stock unit (e.g., 1 piece, 0.5 kg, 250 ml). Ensure you know the product\'s stock unit before specifying amount.'
|
|
309
|
-
},
|
|
310
|
-
spoiled: {
|
|
311
|
-
type: 'boolean',
|
|
312
|
-
description: 'Whether the product is spoiled (default: false)',
|
|
313
|
-
default: false
|
|
314
|
-
},
|
|
315
|
-
note: {
|
|
316
|
-
type: 'string',
|
|
317
|
-
description: 'Optional note'
|
|
318
|
-
}
|
|
319
|
-
},
|
|
320
|
-
required: ['stockId', 'productId', 'amount']
|
|
321
|
-
}
|
|
322
|
-
},
|
|
323
|
-
{
|
|
324
|
-
name: 'inventory_stock_entry_transfer',
|
|
325
|
-
description: '[INVENTORY/STOCK] Transfer a specific stock entry to another location. Use inventory_stock_get_by_product to find specific stockId values.',
|
|
326
|
-
inputSchema: {
|
|
327
|
-
type: 'object',
|
|
328
|
-
properties: {
|
|
329
|
-
stockId: {
|
|
330
|
-
type: 'number',
|
|
331
|
-
description: 'ID of the specific stock entry to transfer.'
|
|
332
|
-
},
|
|
333
|
-
productId: {
|
|
334
|
-
type: 'number',
|
|
335
|
-
description: 'ID of the product being transferred. This is required for verification - if you know the stockId, you must know the productId.'
|
|
336
|
-
},
|
|
337
|
-
amount: {
|
|
338
|
-
type: 'number',
|
|
339
|
-
description: 'Amount to transfer in the product\'s stock unit (e.g., 1 piece, 0.5 kg, 250 ml). Ensure you know the product\'s stock unit before specifying amount.'
|
|
340
|
-
},
|
|
341
|
-
locationIdTo: {
|
|
342
|
-
type: 'number',
|
|
343
|
-
description: 'ID of the destination location.'
|
|
344
|
-
},
|
|
345
|
-
note: {
|
|
346
|
-
type: 'string',
|
|
347
|
-
description: 'Optional note for this transfer'
|
|
348
|
-
}
|
|
349
|
-
},
|
|
350
|
-
required: ['stockId', 'productId', 'amount', 'locationIdTo']
|
|
351
|
-
}
|
|
352
|
-
},
|
|
353
|
-
{
|
|
354
|
-
name: 'inventory_stock_entry_open',
|
|
355
|
-
description: '[INVENTORY/STOCK] Mark a specific stock entry as opened. Use inventory_stock_get_by_product to find specific stockId values.',
|
|
356
|
-
inputSchema: {
|
|
357
|
-
type: 'object',
|
|
358
|
-
properties: {
|
|
359
|
-
stockId: {
|
|
360
|
-
type: 'number',
|
|
361
|
-
description: 'ID of the specific stock entry to mark as opened.'
|
|
362
|
-
},
|
|
363
|
-
productId: {
|
|
364
|
-
type: 'number',
|
|
365
|
-
description: 'ID of the product being opened. This is required for verification - if you know the stockId, you must know the productId.'
|
|
366
|
-
},
|
|
367
|
-
amount: {
|
|
368
|
-
type: 'number',
|
|
369
|
-
description: 'Amount to mark as opened in the product\'s stock unit (e.g., 1 piece, 0.5 kg, 200 ml). Ensure you know the product\'s stock unit before specifying amount.'
|
|
370
|
-
},
|
|
371
|
-
note: {
|
|
372
|
-
type: 'string',
|
|
373
|
-
description: 'Optional note'
|
|
374
|
-
}
|
|
375
|
-
},
|
|
376
|
-
required: ['stockId', 'productId', 'amount']
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
];
|