@whattio/mcp-server 1.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/README.md +48 -0
- package/build/api.js +18 -0
- package/build/index.js +11 -0
- package/build/server.js +140 -0
- package/build/tools/media.js +33 -0
- package/build/tools/registry.js +8 -0
- package/build/tools/types.js +1 -0
- package/build/tools/v1/category.js +65 -0
- package/build/tools/v1/incendo.js +66 -0
- package/build/tools/v1/index.js +16 -0
- package/build/tools/v1/material.js +79 -0
- package/build/tools/v1/product.js +85 -0
- package/build/tools/v1/simplyprint.js +44 -0
- package/build/tools/v1/unit.js +67 -0
- package/build/tools/v1/user.js +46 -0
- package/build/tools/v2/auth.js +75 -0
- package/build/tools/v2/category.js +109 -0
- package/build/tools/v2/device.js +97 -0
- package/build/tools/v2/index.js +16 -0
- package/build/tools/v2/material.js +114 -0
- package/build/tools/v2/part.js +102 -0
- package/build/tools/v2/product.js +99 -0
- package/build/tools/v2/unit.js +86 -0
- package/package.json +26 -0
- package/src/api.ts +24 -0
- package/src/index.ts +13 -0
- package/src/server.ts +165 -0
- package/src/tools/media.ts +36 -0
- package/src/tools/registry.ts +10 -0
- package/src/tools/types.ts +12 -0
- package/src/tools/v1/category.ts +67 -0
- package/src/tools/v1/incendo.ts +68 -0
- package/src/tools/v1/index.ts +18 -0
- package/src/tools/v1/material.ts +81 -0
- package/src/tools/v1/product.ts +87 -0
- package/src/tools/v1/simplyprint.ts +46 -0
- package/src/tools/v1/unit.ts +69 -0
- package/src/tools/v1/user.ts +48 -0
- package/src/tools/v2/auth.ts +77 -0
- package/src/tools/v2/category.ts +111 -0
- package/src/tools/v2/device.ts +99 -0
- package/src/tools/v2/index.ts +18 -0
- package/src/tools/v2/material.ts +116 -0
- package/src/tools/v2/part.ts +104 -0
- package/src/tools/v2/product.ts +101 -0
- package/src/tools/v2/unit.ts +88 -0
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export const unitTools = [
|
|
2
|
+
{
|
|
3
|
+
name: "v1_check_serial_unit",
|
|
4
|
+
description: "Check if unit serial is available in system/team",
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object",
|
|
7
|
+
properties: {
|
|
8
|
+
team: { type: "number", description: "Team ID" },
|
|
9
|
+
serial: { type: "string", description: "Serial UUID" }
|
|
10
|
+
},
|
|
11
|
+
required: ["team", "serial"]
|
|
12
|
+
},
|
|
13
|
+
handler: async (args, apiClient) => {
|
|
14
|
+
const response = await apiClient.get(`/api/checkserial/${args.team}/${args.serial}`);
|
|
15
|
+
return response.data;
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: "v1_create_unit",
|
|
20
|
+
description: "Add a new unit to a product",
|
|
21
|
+
inputSchema: {
|
|
22
|
+
type: "object",
|
|
23
|
+
properties: {
|
|
24
|
+
id: { type: "number", description: "Product ID" },
|
|
25
|
+
unit_identifier: { type: "string", description: "Serial UUID" },
|
|
26
|
+
public: { type: "number" }
|
|
27
|
+
},
|
|
28
|
+
required: ["id", "unit_identifier"]
|
|
29
|
+
},
|
|
30
|
+
handler: async (args, apiClient) => {
|
|
31
|
+
const response = await apiClient.post('/api/unit', null, { params: args });
|
|
32
|
+
return response.data;
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: "v1_get_unit",
|
|
37
|
+
description: "Get information about a specific unit by serial via token auth mode",
|
|
38
|
+
inputSchema: {
|
|
39
|
+
type: "object",
|
|
40
|
+
properties: {
|
|
41
|
+
serial: { type: "string", description: "Serial UUID" },
|
|
42
|
+
token: { type: "string", description: "Auth token" }
|
|
43
|
+
},
|
|
44
|
+
required: ["serial", "token"]
|
|
45
|
+
},
|
|
46
|
+
handler: async (args, apiClient) => {
|
|
47
|
+
const response = await apiClient.get(`/api/unit/${args.serial}/${args.token}`);
|
|
48
|
+
return response.data;
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: "v1_delete_unit",
|
|
53
|
+
description: "Delete a specific product unit by ID",
|
|
54
|
+
inputSchema: {
|
|
55
|
+
type: "object",
|
|
56
|
+
properties: {
|
|
57
|
+
id: { type: "number", description: "Unit ID" },
|
|
58
|
+
token: { type: "string", description: "Auth token" }
|
|
59
|
+
},
|
|
60
|
+
required: ["id", "token"]
|
|
61
|
+
},
|
|
62
|
+
handler: async (args, apiClient) => {
|
|
63
|
+
const response = await apiClient.delete(`/api/unit/${args.id}/${args.token}`);
|
|
64
|
+
return response.data;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
];
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export const userTools = [
|
|
2
|
+
{
|
|
3
|
+
name: "v1_generate_token",
|
|
4
|
+
description: "Generate an auth token",
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object",
|
|
7
|
+
properties: {
|
|
8
|
+
email: { type: "string" },
|
|
9
|
+
password: { type: "string" },
|
|
10
|
+
device_name: { type: "string" }
|
|
11
|
+
},
|
|
12
|
+
required: ["email", "password", "device_name"]
|
|
13
|
+
},
|
|
14
|
+
handler: async (args, apiClient) => {
|
|
15
|
+
const response = await apiClient.post('/api/sanctum/token', null, { params: args });
|
|
16
|
+
return response.data;
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: "v1_switch_team",
|
|
21
|
+
description: "Switch your active team. CRITICAL: Use this tool to change context if you encounter 404 Not Found or 403 Forbidden errors when trying to update/view specific resources.",
|
|
22
|
+
inputSchema: {
|
|
23
|
+
type: "object",
|
|
24
|
+
properties: {
|
|
25
|
+
team_id: { type: "number" }
|
|
26
|
+
},
|
|
27
|
+
required: ["team_id"]
|
|
28
|
+
},
|
|
29
|
+
handler: async (args, apiClient) => {
|
|
30
|
+
const response = await apiClient.post('/api/set_team', null, { params: args });
|
|
31
|
+
return response.data;
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "v1_get_user",
|
|
36
|
+
description: "Get current authenticated user information",
|
|
37
|
+
inputSchema: {
|
|
38
|
+
type: "object",
|
|
39
|
+
properties: {}
|
|
40
|
+
},
|
|
41
|
+
handler: async (_args, apiClient) => {
|
|
42
|
+
const response = await apiClient.get('/api/user');
|
|
43
|
+
return response.data;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
];
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export const authTools = [
|
|
2
|
+
{
|
|
3
|
+
name: "v2_login",
|
|
4
|
+
description: "Authenticate user with email and password, returns user data and API token",
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object",
|
|
7
|
+
properties: {
|
|
8
|
+
email: { type: "string", description: "Email Address" },
|
|
9
|
+
password: { type: "string", description: "Password" }
|
|
10
|
+
},
|
|
11
|
+
required: ["email", "password"]
|
|
12
|
+
},
|
|
13
|
+
handler: async (args, apiClient) => {
|
|
14
|
+
const response = await apiClient.post('/api/v2/login', null, { params: args });
|
|
15
|
+
return response.data;
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: "v2_register",
|
|
20
|
+
description: "Create a new user account and generate auth token",
|
|
21
|
+
inputSchema: {
|
|
22
|
+
type: "object",
|
|
23
|
+
properties: {
|
|
24
|
+
name: { type: "string", description: "Full Name" },
|
|
25
|
+
email: { type: "string", description: "Email Address" },
|
|
26
|
+
password: { type: "string", description: "Password" },
|
|
27
|
+
password_confirmation: { type: "string", description: "Password Confirmation" }
|
|
28
|
+
},
|
|
29
|
+
required: ["name", "email", "password", "password_confirmation"]
|
|
30
|
+
},
|
|
31
|
+
handler: async (args, apiClient) => {
|
|
32
|
+
const response = await apiClient.post('/api/v2/register', null, { params: args });
|
|
33
|
+
return response.data;
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: "v2_get_user",
|
|
38
|
+
description: "Retrieve current authenticated user information from V2 api",
|
|
39
|
+
inputSchema: {
|
|
40
|
+
type: "object",
|
|
41
|
+
properties: {}
|
|
42
|
+
},
|
|
43
|
+
handler: async (_args, apiClient) => {
|
|
44
|
+
const response = await apiClient.get('/api/v2/user');
|
|
45
|
+
return response.data;
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: "v2_switch_team",
|
|
50
|
+
description: "Change the current active team for the authenticated user. CRITICAL: Use this tool to change context if you encounter 404 Not Found or 403 Forbidden errors when trying to update/view specific resources.",
|
|
51
|
+
inputSchema: {
|
|
52
|
+
type: "object",
|
|
53
|
+
properties: {
|
|
54
|
+
team_id: { type: "number", description: "Team ID to switch to" }
|
|
55
|
+
},
|
|
56
|
+
required: ["team_id"]
|
|
57
|
+
},
|
|
58
|
+
handler: async (args, apiClient) => {
|
|
59
|
+
const response = await apiClient.post('/api/v2/switch-team', null, { params: args });
|
|
60
|
+
return response.data;
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: "v2_logout",
|
|
65
|
+
description: "Revoke current authentication token from V2 api",
|
|
66
|
+
inputSchema: {
|
|
67
|
+
type: "object",
|
|
68
|
+
properties: {}
|
|
69
|
+
},
|
|
70
|
+
handler: async (_args, apiClient) => {
|
|
71
|
+
const response = await apiClient.post('/api/v2/logout');
|
|
72
|
+
return response.data;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
];
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
export const categoryTools = [
|
|
2
|
+
{
|
|
3
|
+
name: "v2_list_categories",
|
|
4
|
+
description: "Retrieve a paginated list of all categories belonging to the authenticated user's current team",
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object",
|
|
7
|
+
properties: {
|
|
8
|
+
page: { type: "number", description: "The page number to retrieve" },
|
|
9
|
+
per_page: { type: "number", description: "Number of items per page" }
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
handler: async (args, apiClient) => {
|
|
13
|
+
const response = await apiClient.get('/api/v2/category', { params: args });
|
|
14
|
+
return response.data;
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: "v2_create_category",
|
|
19
|
+
description: "Create a new category, brand, or manufacturer",
|
|
20
|
+
inputSchema: {
|
|
21
|
+
type: "object",
|
|
22
|
+
properties: {
|
|
23
|
+
name: { type: "string" },
|
|
24
|
+
country: { type: "string" },
|
|
25
|
+
city: { type: "string" },
|
|
26
|
+
email: { type: "string" },
|
|
27
|
+
phone: { type: "string" },
|
|
28
|
+
website: { type: "string" },
|
|
29
|
+
ai_description: { type: "string" },
|
|
30
|
+
logo: { type: "string", description: "Base64 encoded image or path to file if supported by client" }
|
|
31
|
+
},
|
|
32
|
+
required: ["name", "country", "city", "email"]
|
|
33
|
+
},
|
|
34
|
+
handler: async (args, apiClient) => {
|
|
35
|
+
// Sends args as JSON. If the whatt.io API strictly requires multipart/form-data,
|
|
36
|
+
// it should be capable of parsing application/json as an alternative.
|
|
37
|
+
const response = await apiClient.post('/api/v2/category/create', args);
|
|
38
|
+
return response.data;
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: "v2_show_category",
|
|
43
|
+
description: "Get detailed information about a specific category",
|
|
44
|
+
inputSchema: {
|
|
45
|
+
type: "object",
|
|
46
|
+
properties: {
|
|
47
|
+
id: { type: "number", description: "Category ID" }
|
|
48
|
+
},
|
|
49
|
+
required: ["id"]
|
|
50
|
+
},
|
|
51
|
+
handler: async (args, apiClient) => {
|
|
52
|
+
const response = await apiClient.get(`/api/v2/category/${args.id}/show`);
|
|
53
|
+
return response.data;
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: "v2_get_category_products",
|
|
58
|
+
description: "Get products by category",
|
|
59
|
+
inputSchema: {
|
|
60
|
+
type: "object",
|
|
61
|
+
properties: {
|
|
62
|
+
id: { type: "number", description: "Category ID" }
|
|
63
|
+
},
|
|
64
|
+
required: ["id"]
|
|
65
|
+
},
|
|
66
|
+
handler: async (args, apiClient) => {
|
|
67
|
+
const response = await apiClient.get(`/api/v2/category/${args.id}/products`);
|
|
68
|
+
return response.data;
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: "v2_update_category",
|
|
73
|
+
description: "Update an existing category's information",
|
|
74
|
+
inputSchema: {
|
|
75
|
+
type: "object",
|
|
76
|
+
properties: {
|
|
77
|
+
id: { type: "number", description: "Category ID" },
|
|
78
|
+
name: { type: "string" },
|
|
79
|
+
country: { type: "string" },
|
|
80
|
+
city: { type: "string" },
|
|
81
|
+
email: { type: "string" },
|
|
82
|
+
phone: { type: "string" },
|
|
83
|
+
website: { type: "string" },
|
|
84
|
+
ai_description: { type: "string" }
|
|
85
|
+
},
|
|
86
|
+
required: ["id"]
|
|
87
|
+
},
|
|
88
|
+
handler: async (args, apiClient) => {
|
|
89
|
+
const { id, ...data } = args;
|
|
90
|
+
const response = await apiClient.post(`/api/v2/category/${id}/update`, { ...data, _method: 'PUT' });
|
|
91
|
+
return response.data;
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: "v2_delete_category",
|
|
96
|
+
description: "Permanently delete a category from the system",
|
|
97
|
+
inputSchema: {
|
|
98
|
+
type: "object",
|
|
99
|
+
properties: {
|
|
100
|
+
id: { type: "number", description: "Category ID" }
|
|
101
|
+
},
|
|
102
|
+
required: ["id"]
|
|
103
|
+
},
|
|
104
|
+
handler: async (args, apiClient) => {
|
|
105
|
+
const response = await apiClient.delete(`/api/v2/category/${args.id}/delete`);
|
|
106
|
+
return response.data;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
];
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
export const deviceTools = [
|
|
2
|
+
{
|
|
3
|
+
name: "v2_list_devices",
|
|
4
|
+
description: "Retrieve a paginated list of all IoT devices and printers belonging to the authenticated user's current team",
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object",
|
|
7
|
+
properties: {
|
|
8
|
+
page: { type: "number", description: "The page number to retrieve" },
|
|
9
|
+
per_page: { type: "number", description: "Number of items per page" }
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
handler: async (args, apiClient) => {
|
|
13
|
+
const response = await apiClient.get('/api/v2/device', { params: args });
|
|
14
|
+
return response.data;
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: "v2_create_device",
|
|
19
|
+
description: "Register a new IoT device, workstation, or printer to your team. Each device is assigned a unique API key and setup code.",
|
|
20
|
+
inputSchema: {
|
|
21
|
+
type: "object",
|
|
22
|
+
properties: {
|
|
23
|
+
name: { type: "string" },
|
|
24
|
+
location: { type: "string" },
|
|
25
|
+
mode: { type: "string", description: "Device operation mode" },
|
|
26
|
+
serial_no: { type: "string", description: "Unique Hardware Serial Number" },
|
|
27
|
+
ethernet: { type: "boolean" },
|
|
28
|
+
ip_address: { type: "string" },
|
|
29
|
+
mac_address: { type: "string" },
|
|
30
|
+
ssid: { type: "string" },
|
|
31
|
+
active_product_id: { type: "number" },
|
|
32
|
+
version_no: { type: "string" }
|
|
33
|
+
},
|
|
34
|
+
required: ["name", "location", "mode", "serial_no"]
|
|
35
|
+
},
|
|
36
|
+
handler: async (args, apiClient) => {
|
|
37
|
+
const response = await apiClient.post('/api/v2/device/create', null, { params: args });
|
|
38
|
+
return response.data;
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: "v2_show_device",
|
|
43
|
+
description: "Get detailed information about a specific device",
|
|
44
|
+
inputSchema: {
|
|
45
|
+
type: "object",
|
|
46
|
+
properties: {
|
|
47
|
+
id: { type: "number", description: "Device ID" }
|
|
48
|
+
},
|
|
49
|
+
required: ["id"]
|
|
50
|
+
},
|
|
51
|
+
handler: async (args, apiClient) => {
|
|
52
|
+
const response = await apiClient.get(`/api/v2/device/${args.id}/show`);
|
|
53
|
+
return response.data;
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: "v2_update_device",
|
|
58
|
+
description: "Update the details of an existing IoT device or printer",
|
|
59
|
+
inputSchema: {
|
|
60
|
+
type: "object",
|
|
61
|
+
properties: {
|
|
62
|
+
id: { type: "number", description: "Device ID" },
|
|
63
|
+
name: { type: "string" },
|
|
64
|
+
location: { type: "string" },
|
|
65
|
+
mode: { type: "string" },
|
|
66
|
+
serial_no: { type: "string" },
|
|
67
|
+
ethernet: { type: "boolean" },
|
|
68
|
+
ip_address: { type: "string" },
|
|
69
|
+
mac_address: { type: "string" },
|
|
70
|
+
ssid: { type: "string" },
|
|
71
|
+
active_product_id: { type: "number" },
|
|
72
|
+
version_no: { type: "string" }
|
|
73
|
+
},
|
|
74
|
+
required: ["id"]
|
|
75
|
+
},
|
|
76
|
+
handler: async (args, apiClient) => {
|
|
77
|
+
const { id, ...data } = args;
|
|
78
|
+
const response = await apiClient.put(`/api/v2/device/${id}/update`, null, { params: data });
|
|
79
|
+
return response.data;
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: "v2_delete_device",
|
|
84
|
+
description: "Permanently remove a device from your system",
|
|
85
|
+
inputSchema: {
|
|
86
|
+
type: "object",
|
|
87
|
+
properties: {
|
|
88
|
+
id: { type: "number", description: "Device ID" }
|
|
89
|
+
},
|
|
90
|
+
required: ["id"]
|
|
91
|
+
},
|
|
92
|
+
handler: async (args, apiClient) => {
|
|
93
|
+
const response = await apiClient.delete(`/api/v2/device/${args.id}/delete`);
|
|
94
|
+
return response.data;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { authTools } from './auth.js';
|
|
2
|
+
import { categoryTools } from './category.js';
|
|
3
|
+
import { deviceTools } from './device.js';
|
|
4
|
+
import { materialTools } from './material.js';
|
|
5
|
+
import { partTools } from './part.js';
|
|
6
|
+
import { productTools } from './product.js';
|
|
7
|
+
import { unitTools } from './unit.js';
|
|
8
|
+
export const v2Tools = [
|
|
9
|
+
...authTools,
|
|
10
|
+
...categoryTools,
|
|
11
|
+
...deviceTools,
|
|
12
|
+
...materialTools,
|
|
13
|
+
...partTools,
|
|
14
|
+
...productTools,
|
|
15
|
+
...unitTools
|
|
16
|
+
];
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
export const materialTools = [
|
|
2
|
+
{
|
|
3
|
+
name: "v2_list_materials",
|
|
4
|
+
description: "Retrieve a paginated list of materials",
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object",
|
|
7
|
+
properties: {
|
|
8
|
+
page: { type: "number", description: "The page number to retrieve" },
|
|
9
|
+
per_page: { type: "number", description: "Number of items per page" },
|
|
10
|
+
public: { type: "boolean", description: "If true, returns global public materials instead of team-specific ones" }
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
handler: async (args, apiClient) => {
|
|
14
|
+
const response = await apiClient.get('/api/v2/material', { params: args });
|
|
15
|
+
return response.data;
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: "v2_create_material",
|
|
20
|
+
description: "Create a new material",
|
|
21
|
+
inputSchema: {
|
|
22
|
+
type: "object",
|
|
23
|
+
properties: {
|
|
24
|
+
brand: { type: "string", description: "Brand Name" },
|
|
25
|
+
name: { type: "string", description: "Material Name" },
|
|
26
|
+
origin_country: { type: "string", description: "Country of Origin" },
|
|
27
|
+
code: { type: "string", description: "Material Code" },
|
|
28
|
+
color_code: { type: "string", description: "Color Code" },
|
|
29
|
+
resin_id: { type: "number", description: "Resin Identification Code (1-7)" },
|
|
30
|
+
chem_name: { type: "string", description: "Material Chemical Name" },
|
|
31
|
+
recycled: { type: "boolean", description: "Contains recycled content" },
|
|
32
|
+
recycle_info: { type: "string", description: "Recycling instructions or information" },
|
|
33
|
+
recycle_url: { type: "string", description: "External recycling information URL" },
|
|
34
|
+
bioderived: { type: "boolean", description: "Is bio-derived material" },
|
|
35
|
+
bio_derived: { type: "string", description: "Bio-Derived From/Details" },
|
|
36
|
+
waste_category: { type: "string", description: "Waste Category" },
|
|
37
|
+
origin_type: { type: "string", description: "Origin Type" },
|
|
38
|
+
recyclable: { type: "boolean", description: "Is Recyclable" },
|
|
39
|
+
biodegradable: { type: "boolean", description: "Is biodegradable material" },
|
|
40
|
+
biodegrade_comment: { type: "string", description: "Biodegradability Comments" },
|
|
41
|
+
buy_link: { type: "string", description: "Material Buy URL" }
|
|
42
|
+
},
|
|
43
|
+
required: ["brand", "name", "origin_country"]
|
|
44
|
+
},
|
|
45
|
+
handler: async (args, apiClient) => {
|
|
46
|
+
const response = await apiClient.post('/api/v2/material/create', args);
|
|
47
|
+
return response.data;
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: "v2_show_material",
|
|
52
|
+
description: "Get detailed information about a specific material",
|
|
53
|
+
inputSchema: {
|
|
54
|
+
type: "object",
|
|
55
|
+
properties: {
|
|
56
|
+
id: { type: "number", description: "Material ID" }
|
|
57
|
+
},
|
|
58
|
+
required: ["id"]
|
|
59
|
+
},
|
|
60
|
+
handler: async (args, apiClient) => {
|
|
61
|
+
const response = await apiClient.get(`/api/v2/material/${args.id}/show`);
|
|
62
|
+
return response.data;
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "v2_update_material",
|
|
67
|
+
description: "Update the details of an existing material",
|
|
68
|
+
inputSchema: {
|
|
69
|
+
type: "object",
|
|
70
|
+
properties: {
|
|
71
|
+
id: { type: "number", description: "Material ID" },
|
|
72
|
+
brand: { type: "string", description: "Brand Name" },
|
|
73
|
+
name: { type: "string", description: "Material Name" },
|
|
74
|
+
origin_country: { type: "string", description: "Country of Origin" },
|
|
75
|
+
code: { type: "string", description: "Material Code" },
|
|
76
|
+
color_code: { type: "string", description: "Color Code" },
|
|
77
|
+
resin_id: { type: "number", description: "Resin Identification Code (1-7)" },
|
|
78
|
+
chem_name: { type: "string", description: "Material Chemical Name" },
|
|
79
|
+
recycled: { type: "boolean", description: "Contains recycled content" },
|
|
80
|
+
recycle_info: { type: "string", description: "Recycling instructions or information" },
|
|
81
|
+
recycle_url: { type: "string", description: "External recycling information URL" },
|
|
82
|
+
bioderived: { type: "boolean", description: "Is bio-derived material" },
|
|
83
|
+
bio_derived: { type: "string", description: "Bio-Derived From/Details" },
|
|
84
|
+
waste_category: { type: "string", description: "Waste Category" },
|
|
85
|
+
origin_type: { type: "string", description: "Origin Type" },
|
|
86
|
+
recyclable: { type: "boolean", description: "Is Recyclable" },
|
|
87
|
+
biodegradable: { type: "boolean", description: "Is biodegradable material" },
|
|
88
|
+
biodegrade_comment: { type: "string", description: "Biodegradability Comments" },
|
|
89
|
+
buy_link: { type: "string", description: "Material Buy URL" }
|
|
90
|
+
},
|
|
91
|
+
required: ["id"]
|
|
92
|
+
},
|
|
93
|
+
handler: async (args, apiClient) => {
|
|
94
|
+
const { id, ...data } = args;
|
|
95
|
+
const response = await apiClient.post(`/api/v2/material/${id}/update`, { ...data, _method: 'PUT' });
|
|
96
|
+
return response.data;
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: "v2_delete_material",
|
|
101
|
+
description: "Permanently delete a material from the system",
|
|
102
|
+
inputSchema: {
|
|
103
|
+
type: "object",
|
|
104
|
+
properties: {
|
|
105
|
+
id: { type: "number", description: "Material ID" }
|
|
106
|
+
},
|
|
107
|
+
required: ["id"]
|
|
108
|
+
},
|
|
109
|
+
handler: async (args, apiClient) => {
|
|
110
|
+
const response = await apiClient.delete(`/api/v2/material/${args.id}/delete`);
|
|
111
|
+
return response.data;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
];
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
export const partTools = [
|
|
2
|
+
{
|
|
3
|
+
name: "v2_list_parts",
|
|
4
|
+
description: "Retrieve a paginated list of parts. Use this tool automatically whenever the user asks about their whatt.io parts, components, sub-assemblies, or manufacturing pieces.",
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object",
|
|
7
|
+
properties: {
|
|
8
|
+
page: { type: "number", description: "The page number to retrieve" },
|
|
9
|
+
per_page: { type: "number", description: "Number of items per page" },
|
|
10
|
+
public: { type: "boolean", description: "If true, returns global public parts instead of team-specific ones" }
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
handler: async (args, apiClient) => {
|
|
14
|
+
const response = await apiClient.get('/api/v2/part', { params: args });
|
|
15
|
+
return response.data;
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: "v2_create_part",
|
|
20
|
+
description: "Create a new part",
|
|
21
|
+
inputSchema: {
|
|
22
|
+
type: "object",
|
|
23
|
+
properties: {
|
|
24
|
+
name: { type: "string" },
|
|
25
|
+
part_number: { type: "string" },
|
|
26
|
+
default_method: { type: "string" },
|
|
27
|
+
material_id: { type: "number" },
|
|
28
|
+
amount: { type: "number" },
|
|
29
|
+
description: { type: "string" },
|
|
30
|
+
self_print: { type: "boolean" },
|
|
31
|
+
ai_description: { type: "string" },
|
|
32
|
+
weight: { type: "number" },
|
|
33
|
+
version: { type: "number" },
|
|
34
|
+
is_main: { type: "boolean" },
|
|
35
|
+
buy_link: { type: "string" }
|
|
36
|
+
},
|
|
37
|
+
required: ["name", "part_number", "default_method", "amount"]
|
|
38
|
+
},
|
|
39
|
+
handler: async (args, apiClient) => {
|
|
40
|
+
const response = await apiClient.post('/api/v2/part/create', args);
|
|
41
|
+
return response.data;
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "v2_show_part",
|
|
46
|
+
description: "Get detailed information about a specific part",
|
|
47
|
+
inputSchema: {
|
|
48
|
+
type: "object",
|
|
49
|
+
properties: {
|
|
50
|
+
id: { type: "number", description: "Part ID" }
|
|
51
|
+
},
|
|
52
|
+
required: ["id"]
|
|
53
|
+
},
|
|
54
|
+
handler: async (args, apiClient) => {
|
|
55
|
+
const response = await apiClient.get(`/api/v2/part/${args.id}/show`);
|
|
56
|
+
return response.data;
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: "v2_update_part",
|
|
61
|
+
description: "Update the details of an existing part",
|
|
62
|
+
inputSchema: {
|
|
63
|
+
type: "object",
|
|
64
|
+
properties: {
|
|
65
|
+
id: { type: "number", description: "Part ID" },
|
|
66
|
+
name: { type: "string" },
|
|
67
|
+
part_number: { type: "string" },
|
|
68
|
+
default_method: { type: "string" },
|
|
69
|
+
material_id: { type: "number" },
|
|
70
|
+
amount: { type: "number" },
|
|
71
|
+
self_print: { type: "boolean" },
|
|
72
|
+
description: { type: "string" },
|
|
73
|
+
ai_description: { type: "string" },
|
|
74
|
+
weight: { type: "number" },
|
|
75
|
+
version: { type: "number" },
|
|
76
|
+
is_main: { type: "boolean" },
|
|
77
|
+
buy_link: { type: "string" }
|
|
78
|
+
},
|
|
79
|
+
required: ["id"]
|
|
80
|
+
},
|
|
81
|
+
handler: async (args, apiClient) => {
|
|
82
|
+
const { id, ...data } = args;
|
|
83
|
+
const response = await apiClient.post(`/api/v2/part/${id}/update`, { ...data, _method: 'PUT' });
|
|
84
|
+
return response.data;
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: "v2_delete_part",
|
|
89
|
+
description: "Permanently delete a part from the system",
|
|
90
|
+
inputSchema: {
|
|
91
|
+
type: "object",
|
|
92
|
+
properties: {
|
|
93
|
+
id: { type: "number", description: "Part ID" }
|
|
94
|
+
},
|
|
95
|
+
required: ["id"]
|
|
96
|
+
},
|
|
97
|
+
handler: async (args, apiClient) => {
|
|
98
|
+
const response = await apiClient.delete(`/api/v2/part/${args.id}/delete`);
|
|
99
|
+
return response.data;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
];
|