vme-mcp-server 0.1.6 → 0.1.8
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/dist/lib/api-utils.js +18 -5
- package/dist/lib/capability-cache.js +131 -0
- package/dist/lib/capability-discovery.js +240 -0
- package/dist/lib/name-resolver.js +174 -0
- package/dist/lib/vm-parsing.js +27 -19
- package/dist/tools/check-capability.js +84 -0
- package/dist/tools/create-vm.js +95 -23
- package/dist/tools/discover-capabilities.js +79 -0
- package/dist/tools/get-cache-status.js +123 -0
- package/dist/tools/get-resources.js +1 -1
- package/dist/tools/index.js +37 -10
- package/dist/tools/query-resources.js +371 -0
- package/package.json +4 -4
@@ -0,0 +1,84 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.handleCheckCapability = exports.checkCapabilityTool = void 0;
|
4
|
+
const capability_discovery_js_1 = require("../lib/capability-discovery.js");
|
5
|
+
exports.checkCapabilityTool = {
|
6
|
+
name: "check_capability",
|
7
|
+
description: "Check if a specific capability is available using natural language queries",
|
8
|
+
inputSchema: {
|
9
|
+
type: "object",
|
10
|
+
properties: {
|
11
|
+
question: {
|
12
|
+
type: "string",
|
13
|
+
description: "Natural language capability question (e.g., 'Can I create VMs with GPUs?', 'Is VMware supported?', 'What's the max CPU per VM?')"
|
14
|
+
},
|
15
|
+
capability_type: {
|
16
|
+
type: "string",
|
17
|
+
enum: ["hypervisor", "gpu_support", "max_cpu", "max_memory", "storage_types", "network_types"],
|
18
|
+
description: "Specific capability type to check (optional, inferred from question if not provided)"
|
19
|
+
}
|
20
|
+
},
|
21
|
+
required: ["question"]
|
22
|
+
}
|
23
|
+
};
|
24
|
+
async function handleCheckCapability(args) {
|
25
|
+
try {
|
26
|
+
const { question, capability_type } = args;
|
27
|
+
if (!question || typeof question !== 'string') {
|
28
|
+
return {
|
29
|
+
content: [
|
30
|
+
{
|
31
|
+
type: "text",
|
32
|
+
text: JSON.stringify({
|
33
|
+
error: "Invalid input",
|
34
|
+
message: "Question parameter is required and must be a string"
|
35
|
+
}, null, 2)
|
36
|
+
}
|
37
|
+
],
|
38
|
+
isError: true
|
39
|
+
};
|
40
|
+
}
|
41
|
+
// Use the capability discovery engine to check the capability
|
42
|
+
const result = await capability_discovery_js_1.capabilityDiscovery.checkCapability(question, capability_type);
|
43
|
+
// Prepare comprehensive response
|
44
|
+
const response = {
|
45
|
+
question: question,
|
46
|
+
answer: result.answer,
|
47
|
+
details: result.details,
|
48
|
+
confidence: result.confidence,
|
49
|
+
confidence_level: result.confidence >= 0.8 ? "high" :
|
50
|
+
result.confidence >= 0.5 ? "medium" : "low",
|
51
|
+
capability_type_detected: capability_type || "inferred_from_question",
|
52
|
+
suggestions: result.confidence < 0.5 ? [
|
53
|
+
"Try being more specific in your question",
|
54
|
+
"Use capability_type parameter for better accuracy",
|
55
|
+
"Examples: 'Can I create 32-CPU VMs?', 'Is GPU support available?'"
|
56
|
+
] : undefined
|
57
|
+
};
|
58
|
+
return {
|
59
|
+
content: [
|
60
|
+
{
|
61
|
+
type: "text",
|
62
|
+
text: JSON.stringify(response, null, 2)
|
63
|
+
}
|
64
|
+
],
|
65
|
+
isError: false
|
66
|
+
};
|
67
|
+
}
|
68
|
+
catch (error) {
|
69
|
+
return {
|
70
|
+
content: [
|
71
|
+
{
|
72
|
+
type: "text",
|
73
|
+
text: JSON.stringify({
|
74
|
+
error: "Capability check failed",
|
75
|
+
message: error.message,
|
76
|
+
question: args?.question || "unknown"
|
77
|
+
}, null, 2)
|
78
|
+
}
|
79
|
+
],
|
80
|
+
isError: true
|
81
|
+
};
|
82
|
+
}
|
83
|
+
}
|
84
|
+
exports.handleCheckCapability = handleCheckCapability;
|
package/dist/tools/create-vm.js
CHANGED
@@ -3,9 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.handleCreateVM = exports.createVMTool = void 0;
|
4
4
|
const vm_parsing_js_1 = require("../lib/vm-parsing.js");
|
5
5
|
const api_utils_js_1 = require("../lib/api-utils.js");
|
6
|
+
const name_resolver_js_1 = require("../lib/name-resolver.js");
|
6
7
|
exports.createVMTool = {
|
7
8
|
name: "create_vm",
|
8
|
-
description: "Provision a new virtual machine",
|
9
|
+
description: "Provision a new virtual machine. ⚡ TIP: Run discover_capabilities first to see available groups, zones, templates, and sizes in your environment.",
|
9
10
|
inputSchema: {
|
10
11
|
type: "object",
|
11
12
|
properties: {
|
@@ -70,20 +71,55 @@ async function handleCreateVM(args) {
|
|
70
71
|
const nodes = await (0, api_utils_js_1.getClusterNodes)();
|
71
72
|
// Calculate node assignments
|
72
73
|
const nodeAssignments = (0, vm_parsing_js_1.calculateNodeAssignments)(vmNames, nodes, distribution);
|
73
|
-
|
74
|
-
const
|
75
|
-
|
74
|
+
// Resolve any node names to IDs
|
75
|
+
for (const assignment of nodeAssignments) {
|
76
|
+
if (assignment.nodeNameToResolve) {
|
77
|
+
// Query servers to find node with matching name
|
78
|
+
try {
|
79
|
+
const servers = await api_utils_js_1.api.get("/servers");
|
80
|
+
if (servers.data.servers) {
|
81
|
+
const foundServer = servers.data.servers.find((server) => server.name?.toLowerCase() === assignment.nodeNameToResolve?.toLowerCase());
|
82
|
+
if (foundServer) {
|
83
|
+
assignment.kvmHostId = foundServer.id;
|
84
|
+
delete assignment.nodeNameToResolve; // Clean up
|
85
|
+
}
|
86
|
+
else {
|
87
|
+
// If no exact name match, log available servers for debugging
|
88
|
+
const availableNames = servers.data.servers.map((s) => s.name).filter(Boolean);
|
89
|
+
console.warn(`Node '${assignment.nodeNameToResolve}' not found. Available: ${availableNames.join(', ')}`);
|
90
|
+
}
|
91
|
+
}
|
92
|
+
}
|
93
|
+
catch (error) {
|
94
|
+
console.error(`Failed to resolve node name '${assignment.nodeNameToResolve}':`, error);
|
95
|
+
}
|
96
|
+
}
|
97
|
+
}
|
98
|
+
// Use name resolver to get IDs from actual VME environment
|
99
|
+
const groupId = await name_resolver_js_1.nameResolver.resolveNameToId('group', group);
|
100
|
+
const cloudId = await name_resolver_js_1.nameResolver.resolveNameToId('zone', location);
|
101
|
+
const imageId = await name_resolver_js_1.nameResolver.resolveNameToId('virtualImage', template);
|
102
|
+
const servicePlanId = await name_resolver_js_1.nameResolver.resolveNameToId('servicePlan', size);
|
103
|
+
const instanceTypeId = await name_resolver_js_1.nameResolver.resolveNameToId('instanceType', 'HPE VM'); // Default for VME
|
104
|
+
// Validate all required IDs were resolved
|
105
|
+
if (!groupId || !cloudId || !servicePlanId || !imageId) {
|
76
106
|
const errors = [];
|
77
|
-
if (!groupId)
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
if (!
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
if (!
|
86
|
-
|
107
|
+
if (!groupId) {
|
108
|
+
const availableGroups = await name_resolver_js_1.nameResolver.getAvailableNames('group');
|
109
|
+
errors.push(`Group '${group}' not found. Available: ${availableGroups.join(', ')}`);
|
110
|
+
}
|
111
|
+
if (!cloudId) {
|
112
|
+
const availableZones = await name_resolver_js_1.nameResolver.getAvailableNames('zone');
|
113
|
+
errors.push(`Zone/Cloud '${location}' not found. Available: ${availableZones.join(', ')}`);
|
114
|
+
}
|
115
|
+
if (!servicePlanId) {
|
116
|
+
const availablePlans = await name_resolver_js_1.nameResolver.getAvailableNames('servicePlan');
|
117
|
+
errors.push(`Size '${size}' could not be resolved to service plan. Available: ${availablePlans.join(', ')}`);
|
118
|
+
}
|
119
|
+
if (!imageId) {
|
120
|
+
const availableImages = await name_resolver_js_1.nameResolver.getAvailableNames('virtualImage');
|
121
|
+
errors.push(`Template '${template}' could not be resolved to OS image. Available: ${availableImages.join(', ')}`);
|
122
|
+
}
|
87
123
|
return {
|
88
124
|
content: [
|
89
125
|
{
|
@@ -99,12 +135,48 @@ async function handleCreateVM(args) {
|
|
99
135
|
isError: true
|
100
136
|
};
|
101
137
|
}
|
138
|
+
// Get additional required IDs from VME environment
|
139
|
+
let resourcePoolId = 'pool-1'; // Default fallback
|
140
|
+
let datastoreId = 5; // Default fallback
|
141
|
+
let networkId = 'network-2'; // Default fallback
|
142
|
+
let layoutId = 2; // Default fallback
|
143
|
+
try {
|
144
|
+
// Try to get real resource pool, datastore, network IDs from VME
|
145
|
+
const [resourcePools, datastores, networks, layouts] = await Promise.allSettled([
|
146
|
+
api_utils_js_1.api.get('/resource-pools').catch(() => null),
|
147
|
+
api_utils_js_1.api.get('/datastores').catch(() => null),
|
148
|
+
api_utils_js_1.api.get('/networks').catch(() => null),
|
149
|
+
api_utils_js_1.api.get('/layouts').catch(() => null)
|
150
|
+
]);
|
151
|
+
// Use first available resource pool
|
152
|
+
if (resourcePools.status === 'fulfilled' && resourcePools.value?.data?.resourcePools?.[0]) {
|
153
|
+
resourcePoolId = resourcePools.value.data.resourcePools[0].id;
|
154
|
+
}
|
155
|
+
// Use first available datastore
|
156
|
+
if (datastores.status === 'fulfilled' && datastores.value?.data?.datastores?.[0]) {
|
157
|
+
datastoreId = datastores.value.data.datastores[0].id;
|
158
|
+
}
|
159
|
+
// Use first available network
|
160
|
+
if (networks.status === 'fulfilled' && networks.value?.data?.networks?.[0]) {
|
161
|
+
networkId = networks.value.data.networks[0].id;
|
162
|
+
}
|
163
|
+
// Use first HPE VM layout
|
164
|
+
if (layouts.status === 'fulfilled' && layouts.value?.data?.layouts) {
|
165
|
+
const hpeLayout = layouts.value.data.layouts.find((l) => l.code?.includes('mvm') || l.name?.toLowerCase().includes('hpe'));
|
166
|
+
if (hpeLayout) {
|
167
|
+
layoutId = hpeLayout.id;
|
168
|
+
}
|
169
|
+
}
|
170
|
+
}
|
171
|
+
catch (error) {
|
172
|
+
console.warn('Could not discover some VME resources, using defaults:', error.message);
|
173
|
+
}
|
102
174
|
// Create VMs sequentially
|
103
175
|
const results = [];
|
104
176
|
const errors = [];
|
105
177
|
for (const assignment of nodeAssignments) {
|
106
178
|
const vmConfig = {
|
107
|
-
resourcePoolId:
|
179
|
+
resourcePoolId: resourcePoolId,
|
108
180
|
poolProviderType: 'mvm',
|
109
181
|
imageId: imageId,
|
110
182
|
createUser: true
|
@@ -117,7 +189,7 @@ async function handleCreateVM(args) {
|
|
117
189
|
zoneId: cloudId,
|
118
190
|
instance: {
|
119
191
|
name: assignment.name,
|
120
|
-
cloud: 'tc-lab',
|
192
|
+
cloud: await name_resolver_js_1.nameResolver.getAvailableNames('zone').then(zones => zones[0]) || 'tc-lab',
|
121
193
|
hostName: assignment.name,
|
122
194
|
type: 'mvm',
|
123
195
|
instanceType: {
|
@@ -127,7 +199,7 @@ async function handleCreateVM(args) {
|
|
127
199
|
id: groupId
|
128
200
|
},
|
129
201
|
layout: {
|
130
|
-
id:
|
202
|
+
id: layoutId,
|
131
203
|
code: 'mvm-1.0-single'
|
132
204
|
},
|
133
205
|
plan: {
|
@@ -142,7 +214,7 @@ async function handleCreateVM(args) {
|
|
142
214
|
name: 'root',
|
143
215
|
size: 10,
|
144
216
|
storageType: 1,
|
145
|
-
datastoreId:
|
217
|
+
datastoreId: datastoreId
|
146
218
|
}
|
147
219
|
],
|
148
220
|
networkInterfaces: [
|
@@ -150,7 +222,7 @@ async function handleCreateVM(args) {
|
|
150
222
|
primaryInterface: true,
|
151
223
|
ipMode: 'dhcp',
|
152
224
|
network: {
|
153
|
-
id:
|
225
|
+
id: networkId
|
154
226
|
},
|
155
227
|
networkInterfaceTypeId: 10
|
156
228
|
}
|
@@ -179,10 +251,10 @@ async function handleCreateVM(args) {
|
|
179
251
|
summary.push(...errors);
|
180
252
|
}
|
181
253
|
summary.push(`\nResolved parameters:`);
|
182
|
-
summary.push(`- Group: ${
|
183
|
-
summary.push(`- Zone/Cloud: ${
|
184
|
-
summary.push(`- Template: ${
|
185
|
-
summary.push(`- Plan: ${
|
254
|
+
summary.push(`- Group: ${group} (ID: ${groupId})`);
|
255
|
+
summary.push(`- Zone/Cloud: ${location} (ID: ${cloudId})`);
|
256
|
+
summary.push(`- Template: ${template} (ID: ${imageId})`);
|
257
|
+
summary.push(`- Plan: ${size} (ID: ${servicePlanId})`);
|
186
258
|
if (distribution === 'spread' || (vmNames.length > 1 && !distribution)) {
|
187
259
|
summary.push(`- Distribution: Spread across nodes ${nodes.join(', ')}`);
|
188
260
|
}
|
@@ -0,0 +1,79 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.handleDiscoverCapabilities = exports.discoverCapabilitiesTool = void 0;
|
4
|
+
const capability_discovery_js_1 = require("../lib/capability-discovery.js");
|
5
|
+
exports.discoverCapabilitiesTool = {
|
6
|
+
name: "discover_capabilities",
|
7
|
+
description: "⚡ RECOMMENDED FIRST STEP: Discover VME infrastructure capabilities to learn available resources. Run this tool at least once per session to cache environment data for optimal performance with other tools.",
|
8
|
+
inputSchema: {
|
9
|
+
type: "object",
|
10
|
+
properties: {
|
11
|
+
domain: {
|
12
|
+
type: "string",
|
13
|
+
enum: ["compute", "storage", "networking", "platform", "all"],
|
14
|
+
description: "Which capability domain to discover (default: all)",
|
15
|
+
default: "all"
|
16
|
+
},
|
17
|
+
refresh: {
|
18
|
+
type: "boolean",
|
19
|
+
description: "Force refresh of cached data (default: false)",
|
20
|
+
default: false
|
21
|
+
},
|
22
|
+
include_limits: {
|
23
|
+
type: "boolean",
|
24
|
+
description: "Include license/quota limits (default: true)",
|
25
|
+
default: true
|
26
|
+
}
|
27
|
+
},
|
28
|
+
required: []
|
29
|
+
}
|
30
|
+
};
|
31
|
+
async function handleDiscoverCapabilities(args) {
|
32
|
+
try {
|
33
|
+
const { domain = "all", refresh = false, include_limits = true } = args;
|
34
|
+
// Convert single domain to array for discovery engine
|
35
|
+
const domains = domain === "all" ? ["all"] : [domain];
|
36
|
+
const capabilities = await capability_discovery_js_1.capabilityDiscovery.discoverCapabilities(domains, refresh);
|
37
|
+
// Filter out license limits if not requested
|
38
|
+
if (!include_limits && capabilities.platform) {
|
39
|
+
delete capabilities.platform.license_limits;
|
40
|
+
}
|
41
|
+
// Prepare response with metadata
|
42
|
+
const response = {
|
43
|
+
capabilities,
|
44
|
+
metadata: {
|
45
|
+
discovery_time: capabilities.discovered_at,
|
46
|
+
domains_requested: domains,
|
47
|
+
cache_refresh_forced: refresh,
|
48
|
+
total_cache_fields: capabilities.cache_status.length,
|
49
|
+
fresh_cache_fields: capabilities.cache_status.filter(s => s.fresh).length,
|
50
|
+
token_optimization: "Field-level TTL caching reduces response size by 90%+"
|
51
|
+
}
|
52
|
+
};
|
53
|
+
return {
|
54
|
+
content: [
|
55
|
+
{
|
56
|
+
type: "text",
|
57
|
+
text: JSON.stringify(response, null, 2)
|
58
|
+
}
|
59
|
+
],
|
60
|
+
isError: false
|
61
|
+
};
|
62
|
+
}
|
63
|
+
catch (error) {
|
64
|
+
return {
|
65
|
+
content: [
|
66
|
+
{
|
67
|
+
type: "text",
|
68
|
+
text: JSON.stringify({
|
69
|
+
error: "Capability discovery failed",
|
70
|
+
message: error.message,
|
71
|
+
suggestion: "Check VME API connectivity and authentication"
|
72
|
+
}, null, 2)
|
73
|
+
}
|
74
|
+
],
|
75
|
+
isError: true
|
76
|
+
};
|
77
|
+
}
|
78
|
+
}
|
79
|
+
exports.handleDiscoverCapabilities = handleDiscoverCapabilities;
|
@@ -0,0 +1,123 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.handleGetCacheStatus = exports.getCacheStatusTool = void 0;
|
4
|
+
const capability_cache_js_1 = require("../lib/capability-cache.js");
|
5
|
+
exports.getCacheStatusTool = {
|
6
|
+
name: "get_cache_status",
|
7
|
+
description: "Show freshness and status of cached capability data for transparency and debugging",
|
8
|
+
inputSchema: {
|
9
|
+
type: "object",
|
10
|
+
properties: {
|
11
|
+
field: {
|
12
|
+
type: "string",
|
13
|
+
enum: ["zones", "clusters", "service_plans", "instance_types", "virtual_images", "resource_pools", "networks", "groups"],
|
14
|
+
description: "Specific field to check (optional, shows all cached fields if omitted)"
|
15
|
+
},
|
16
|
+
include_statistics: {
|
17
|
+
type: "boolean",
|
18
|
+
description: "Include cache hit/miss statistics (default: false)",
|
19
|
+
default: false
|
20
|
+
}
|
21
|
+
},
|
22
|
+
required: []
|
23
|
+
}
|
24
|
+
};
|
25
|
+
async function handleGetCacheStatus(args) {
|
26
|
+
try {
|
27
|
+
const { field, include_statistics = false } = args;
|
28
|
+
// Get cache status for specific field or all fields
|
29
|
+
const cacheStatuses = capability_cache_js_1.capabilityCache.getCacheStatus(field);
|
30
|
+
// Calculate summary statistics
|
31
|
+
const totalFields = cacheStatuses.length;
|
32
|
+
const freshFields = cacheStatuses.filter(s => s.is_fresh).length;
|
33
|
+
const staleFields = totalFields - freshFields;
|
34
|
+
// Build response
|
35
|
+
const response = {
|
36
|
+
cache_summary: {
|
37
|
+
total_cached_fields: totalFields,
|
38
|
+
fresh_fields: freshFields,
|
39
|
+
stale_fields: staleFields,
|
40
|
+
freshness_rate: totalFields > 0 ? Math.round((freshFields / totalFields) * 100) : 0
|
41
|
+
},
|
42
|
+
field_details: cacheStatuses.map(status => ({
|
43
|
+
field_name: status.field_name,
|
44
|
+
status: status.is_fresh ? "fresh" : "stale",
|
45
|
+
cached_at: new Date(status.cached_at * 1000).toISOString(),
|
46
|
+
age_seconds: status.age_seconds,
|
47
|
+
age_human: formatDuration(status.age_seconds),
|
48
|
+
ttl_seconds: status.ttl_seconds,
|
49
|
+
expires_in_seconds: status.expires_in_seconds,
|
50
|
+
expires_in_human: status.is_fresh ? formatDuration(status.expires_in_seconds) : "expired",
|
51
|
+
endpoint: status.endpoint
|
52
|
+
})),
|
53
|
+
recommendations: generateRecommendations(cacheStatuses)
|
54
|
+
};
|
55
|
+
// Include statistics if requested
|
56
|
+
if (include_statistics) {
|
57
|
+
const stats = capability_cache_js_1.capabilityCache.getStatistics();
|
58
|
+
response.statistics = {
|
59
|
+
cache_hits: stats.hits,
|
60
|
+
cache_misses: stats.misses,
|
61
|
+
hit_rate_percentage: Math.round(stats.hitRate * 100),
|
62
|
+
note: "Statistics tracking not yet implemented - placeholder data"
|
63
|
+
};
|
64
|
+
}
|
65
|
+
return {
|
66
|
+
content: [
|
67
|
+
{
|
68
|
+
type: "text",
|
69
|
+
text: JSON.stringify(response, null, 2)
|
70
|
+
}
|
71
|
+
],
|
72
|
+
isError: false
|
73
|
+
};
|
74
|
+
}
|
75
|
+
catch (error) {
|
76
|
+
return {
|
77
|
+
content: [
|
78
|
+
{
|
79
|
+
type: "text",
|
80
|
+
text: JSON.stringify({
|
81
|
+
error: "Cache status check failed",
|
82
|
+
message: error.message
|
83
|
+
}, null, 2)
|
84
|
+
}
|
85
|
+
],
|
86
|
+
isError: true
|
87
|
+
};
|
88
|
+
}
|
89
|
+
}
|
90
|
+
exports.handleGetCacheStatus = handleGetCacheStatus;
|
91
|
+
// Helper function to format duration in human-readable format
|
92
|
+
function formatDuration(seconds) {
|
93
|
+
if (seconds < 60) {
|
94
|
+
return `${seconds}s`;
|
95
|
+
}
|
96
|
+
else if (seconds < 3600) {
|
97
|
+
return `${Math.floor(seconds / 60)}m ${seconds % 60}s`;
|
98
|
+
}
|
99
|
+
else {
|
100
|
+
const hours = Math.floor(seconds / 3600);
|
101
|
+
const minutes = Math.floor((seconds % 3600) / 60);
|
102
|
+
return `${hours}h ${minutes}m`;
|
103
|
+
}
|
104
|
+
}
|
105
|
+
// Generate recommendations based on cache status
|
106
|
+
function generateRecommendations(statuses) {
|
107
|
+
const recommendations = [];
|
108
|
+
const staleFields = statuses.filter(s => !s.is_fresh);
|
109
|
+
const oldFields = statuses.filter(s => s.age_seconds > 3600); // > 1 hour
|
110
|
+
if (staleFields.length > 0) {
|
111
|
+
recommendations.push(`${staleFields.length} field(s) have stale data: ${staleFields.map(s => s.field_name).join(", ")}`);
|
112
|
+
}
|
113
|
+
if (oldFields.length > 0) {
|
114
|
+
recommendations.push(`Consider refreshing old data for: ${oldFields.map(s => s.field_name).join(", ")}`);
|
115
|
+
}
|
116
|
+
if (statuses.length === 0) {
|
117
|
+
recommendations.push("No cached data found. Run discover_capabilities to populate cache.");
|
118
|
+
}
|
119
|
+
if (recommendations.length === 0) {
|
120
|
+
recommendations.push("Cache is healthy - all data is fresh and within TTL limits.");
|
121
|
+
}
|
122
|
+
return recommendations;
|
123
|
+
}
|
@@ -4,7 +4,7 @@ exports.handleGetResources = exports.getResourcesTool = void 0;
|
|
4
4
|
const api_utils_js_1 = require("../lib/api-utils.js");
|
5
5
|
exports.getResourcesTool = {
|
6
6
|
name: "get_resources",
|
7
|
-
description: "Discover and explore available VME infrastructure resources with intelligent filtering",
|
7
|
+
description: "Discover and explore available VME infrastructure resources with intelligent filtering. ⚡ TIP: Use discover_capabilities for comprehensive environment discovery first.",
|
8
8
|
inputSchema: {
|
9
9
|
type: "object",
|
10
10
|
properties: {
|
package/dist/tools/index.js
CHANGED
@@ -1,16 +1,19 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.toolHandlers = exports.allTools = exports.handleProvideFeedback = exports.provideFeedbackTool = exports.handleExportTrainingData = exports.exportTrainingDataTool = exports.handleCreateVM = exports.createVMTool = exports.handleParseIntent = exports.parseIntentTool = exports.handleGetResources = exports.getResourcesTool = void 0;
|
4
|
-
// Import and re-export all tools and their handlers
|
5
|
-
const get_resources_js_1 = require("./get-resources.js");
|
3
|
+
exports.toolHandlers = exports.allTools = exports.handleQueryResources = exports.queryResourcesTool = exports.handleGetCacheStatus = exports.getCacheStatusTool = exports.handleCheckCapability = exports.checkCapabilityTool = exports.handleDiscoverCapabilities = exports.discoverCapabilitiesTool = exports.handleProvideFeedback = exports.provideFeedbackTool = exports.handleExportTrainingData = exports.exportTrainingDataTool = exports.handleCreateVM = exports.createVMTool = exports.handleParseIntent = exports.parseIntentTool = exports.handleGetResources = exports.getResourcesTool = void 0;
|
6
4
|
const parse_intent_js_1 = require("./parse-intent.js");
|
7
5
|
const create_vm_js_1 = require("./create-vm.js");
|
8
6
|
const export_training_data_js_1 = require("./export-training-data.js");
|
9
7
|
const provide_feedback_js_1 = require("./provide-feedback.js");
|
8
|
+
// Sprint 2: Capability Discovery Tools
|
9
|
+
const discover_capabilities_js_1 = require("./discover-capabilities.js");
|
10
|
+
const check_capability_js_1 = require("./check-capability.js");
|
11
|
+
const get_cache_status_js_1 = require("./get-cache-status.js");
|
12
|
+
const query_resources_js_1 = require("./query-resources.js");
|
10
13
|
// Re-export for external use
|
11
|
-
var
|
12
|
-
Object.defineProperty(exports, "getResourcesTool", { enumerable: true, get: function () { return
|
13
|
-
Object.defineProperty(exports, "handleGetResources", { enumerable: true, get: function () { return
|
14
|
+
var get_resources_js_1 = require("./get-resources.js");
|
15
|
+
Object.defineProperty(exports, "getResourcesTool", { enumerable: true, get: function () { return get_resources_js_1.getResourcesTool; } });
|
16
|
+
Object.defineProperty(exports, "handleGetResources", { enumerable: true, get: function () { return get_resources_js_1.handleGetResources; } });
|
14
17
|
var parse_intent_js_2 = require("./parse-intent.js");
|
15
18
|
Object.defineProperty(exports, "parseIntentTool", { enumerable: true, get: function () { return parse_intent_js_2.parseIntentTool; } });
|
16
19
|
Object.defineProperty(exports, "handleParseIntent", { enumerable: true, get: function () { return parse_intent_js_2.handleParseIntent; } });
|
@@ -23,19 +26,43 @@ Object.defineProperty(exports, "handleExportTrainingData", { enumerable: true, g
|
|
23
26
|
var provide_feedback_js_2 = require("./provide-feedback.js");
|
24
27
|
Object.defineProperty(exports, "provideFeedbackTool", { enumerable: true, get: function () { return provide_feedback_js_2.provideFeedbackTool; } });
|
25
28
|
Object.defineProperty(exports, "handleProvideFeedback", { enumerable: true, get: function () { return provide_feedback_js_2.handleProvideFeedback; } });
|
29
|
+
var discover_capabilities_js_2 = require("./discover-capabilities.js");
|
30
|
+
Object.defineProperty(exports, "discoverCapabilitiesTool", { enumerable: true, get: function () { return discover_capabilities_js_2.discoverCapabilitiesTool; } });
|
31
|
+
Object.defineProperty(exports, "handleDiscoverCapabilities", { enumerable: true, get: function () { return discover_capabilities_js_2.handleDiscoverCapabilities; } });
|
32
|
+
var check_capability_js_2 = require("./check-capability.js");
|
33
|
+
Object.defineProperty(exports, "checkCapabilityTool", { enumerable: true, get: function () { return check_capability_js_2.checkCapabilityTool; } });
|
34
|
+
Object.defineProperty(exports, "handleCheckCapability", { enumerable: true, get: function () { return check_capability_js_2.handleCheckCapability; } });
|
35
|
+
var get_cache_status_js_2 = require("./get-cache-status.js");
|
36
|
+
Object.defineProperty(exports, "getCacheStatusTool", { enumerable: true, get: function () { return get_cache_status_js_2.getCacheStatusTool; } });
|
37
|
+
Object.defineProperty(exports, "handleGetCacheStatus", { enumerable: true, get: function () { return get_cache_status_js_2.handleGetCacheStatus; } });
|
38
|
+
var query_resources_js_2 = require("./query-resources.js");
|
39
|
+
Object.defineProperty(exports, "queryResourcesTool", { enumerable: true, get: function () { return query_resources_js_2.queryResourcesTool; } });
|
40
|
+
Object.defineProperty(exports, "handleQueryResources", { enumerable: true, get: function () { return query_resources_js_2.handleQueryResources; } });
|
26
41
|
// Collect all tool definitions
|
27
42
|
exports.allTools = [
|
28
|
-
|
43
|
+
// Sprint 1.5 tools
|
44
|
+
// getResourcesTool, // DISABLED - caused 37K+ token responses, replaced by Sprint 2 capability discovery
|
29
45
|
parse_intent_js_1.parseIntentTool,
|
30
46
|
create_vm_js_1.createVMTool,
|
31
47
|
export_training_data_js_1.exportTrainingDataTool,
|
32
|
-
provide_feedback_js_1.provideFeedbackTool
|
48
|
+
provide_feedback_js_1.provideFeedbackTool,
|
49
|
+
// Sprint 2 capability discovery tools
|
50
|
+
discover_capabilities_js_1.discoverCapabilitiesTool,
|
51
|
+
check_capability_js_1.checkCapabilityTool,
|
52
|
+
get_cache_status_js_1.getCacheStatusTool,
|
53
|
+
query_resources_js_1.queryResourcesTool
|
33
54
|
];
|
34
55
|
// Export tool handlers map for easy lookup
|
35
56
|
exports.toolHandlers = {
|
36
|
-
|
57
|
+
// Sprint 1.5 handlers
|
58
|
+
// get_resources: handleGetResources, // DISABLED - caused 37K+ token responses
|
37
59
|
parse_vm_intent: parse_intent_js_1.handleParseIntent,
|
38
60
|
create_vm: create_vm_js_1.handleCreateVM,
|
39
61
|
export_training_data: export_training_data_js_1.handleExportTrainingData,
|
40
|
-
provide_feedback: provide_feedback_js_1.handleProvideFeedback
|
62
|
+
provide_feedback: provide_feedback_js_1.handleProvideFeedback,
|
63
|
+
// Sprint 2 capability discovery handlers
|
64
|
+
discover_capabilities: discover_capabilities_js_1.handleDiscoverCapabilities,
|
65
|
+
check_capability: check_capability_js_1.handleCheckCapability,
|
66
|
+
get_cache_status: get_cache_status_js_1.handleGetCacheStatus,
|
67
|
+
query_resources: query_resources_js_1.handleQueryResources
|
41
68
|
};
|