@robinmordasiewicz/f5xc-api-mcp 3.10.0 → 3.12.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/dist/prompts/error-resolution.d.ts +70 -0
- package/dist/prompts/error-resolution.d.ts.map +1 -0
- package/dist/prompts/error-resolution.js +350 -0
- package/dist/prompts/error-resolution.js.map +1 -0
- package/dist/prompts/index.d.ts +2 -0
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +2 -0
- package/dist/prompts/index.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +265 -3
- package/dist/server.js.map +1 -1
- package/dist/tools/discovery/best-practices.d.ts +140 -0
- package/dist/tools/discovery/best-practices.d.ts.map +1 -0
- package/dist/tools/discovery/best-practices.js +499 -0
- package/dist/tools/discovery/best-practices.js.map +1 -0
- package/dist/tools/discovery/cost-estimator.d.ts +114 -0
- package/dist/tools/discovery/cost-estimator.d.ts.map +1 -0
- package/dist/tools/discovery/cost-estimator.js +273 -0
- package/dist/tools/discovery/cost-estimator.js.map +1 -0
- package/dist/tools/discovery/index-loader.d.ts.map +1 -1
- package/dist/tools/discovery/index-loader.js +3 -0
- package/dist/tools/discovery/index-loader.js.map +1 -1
- package/dist/tools/discovery/index.d.ts +145 -0
- package/dist/tools/discovery/index.d.ts.map +1 -1
- package/dist/tools/discovery/index.js +141 -0
- package/dist/tools/discovery/index.js.map +1 -1
- package/dist/tools/discovery/resolver.d.ts +119 -0
- package/dist/tools/discovery/resolver.d.ts.map +1 -0
- package/dist/tools/discovery/resolver.js +369 -0
- package/dist/tools/discovery/resolver.js.map +1 -0
- package/dist/tools/discovery/search.d.ts.map +1 -1
- package/dist/tools/discovery/search.js +23 -2
- package/dist/tools/discovery/search.js.map +1 -1
- package/dist/tools/discovery/types.d.ts +21 -0
- package/dist/tools/discovery/types.d.ts.map +1 -1
- package/dist/tools/discovery/validate.d.ts +63 -0
- package/dist/tools/discovery/validate.d.ts.map +1 -0
- package/dist/tools/discovery/validate.js +239 -0
- package/dist/tools/discovery/validate.js.map +1 -0
- package/dist/tools/generated/dependency-graph.json +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cost and Performance Estimation
|
|
3
|
+
*
|
|
4
|
+
* Provides token usage estimates, latency expectations, and
|
|
5
|
+
* workflow cost aggregation for F5XC API operations.
|
|
6
|
+
*/
|
|
7
|
+
import { getToolByName } from "../registry.js";
|
|
8
|
+
import { toolExists } from "./index-loader.js";
|
|
9
|
+
/**
|
|
10
|
+
* Latency level to milliseconds mapping
|
|
11
|
+
*/
|
|
12
|
+
const LATENCY_MS_MAP = {
|
|
13
|
+
low: 500,
|
|
14
|
+
moderate: 2000,
|
|
15
|
+
high: 5000,
|
|
16
|
+
unknown: 1500,
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Latency level descriptions
|
|
20
|
+
*/
|
|
21
|
+
const LATENCY_DESCRIPTIONS = {
|
|
22
|
+
low: "Fast operation, typically completes in under 1 second",
|
|
23
|
+
moderate: "Standard operation, may take 1-3 seconds",
|
|
24
|
+
high: "Complex operation, may take 3-10 seconds or involve async processing",
|
|
25
|
+
unknown: "Latency not specified, estimate based on operation type",
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Estimate token count for a string (rough approximation)
|
|
29
|
+
*/
|
|
30
|
+
function estimateTokens(text) {
|
|
31
|
+
// Rough approximation: 1 token per 4 characters for English text
|
|
32
|
+
// JSON tends to be more verbose, so use 1 token per 3.5 characters
|
|
33
|
+
return Math.ceil(text.length / 3.5);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Get latency level from tool metadata
|
|
37
|
+
*/
|
|
38
|
+
function getLatencyLevel(toolName) {
|
|
39
|
+
const tool = getToolByName(toolName);
|
|
40
|
+
if (!tool) {
|
|
41
|
+
return "unknown";
|
|
42
|
+
}
|
|
43
|
+
// Check operation metadata for performance impact
|
|
44
|
+
const metadata = tool.operationMetadata;
|
|
45
|
+
if (metadata?.performance_impact?.latency) {
|
|
46
|
+
const latency = metadata.performance_impact.latency;
|
|
47
|
+
if (latency === "low" || latency === "moderate" || latency === "high") {
|
|
48
|
+
return latency;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
// Fallback: estimate based on operation type
|
|
52
|
+
switch (tool.operation) {
|
|
53
|
+
case "list":
|
|
54
|
+
return "low";
|
|
55
|
+
case "get":
|
|
56
|
+
return "low";
|
|
57
|
+
case "create":
|
|
58
|
+
return "moderate";
|
|
59
|
+
case "update":
|
|
60
|
+
return "moderate";
|
|
61
|
+
case "delete":
|
|
62
|
+
return "moderate";
|
|
63
|
+
default:
|
|
64
|
+
return "unknown";
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Estimate tokens for a tool call
|
|
69
|
+
*/
|
|
70
|
+
export function estimateToolTokens(toolName) {
|
|
71
|
+
const tool = getToolByName(toolName);
|
|
72
|
+
if (!tool) {
|
|
73
|
+
// Default estimate for unknown tools
|
|
74
|
+
return {
|
|
75
|
+
schemaTokens: 200,
|
|
76
|
+
requestTokens: 100,
|
|
77
|
+
responseTokens: 300,
|
|
78
|
+
totalTokens: 600,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
// Schema tokens: tool description + parameters
|
|
82
|
+
const descriptionTokens = estimateTokens(tool.description);
|
|
83
|
+
const pathParamTokens = tool.pathParameters.length * 30;
|
|
84
|
+
const queryParamTokens = (tool.queryParameters?.length ?? 0) * 40;
|
|
85
|
+
const schemaTokens = descriptionTokens + pathParamTokens + queryParamTokens;
|
|
86
|
+
// Request tokens: based on operation type
|
|
87
|
+
let requestTokens;
|
|
88
|
+
switch (tool.operation) {
|
|
89
|
+
case "create":
|
|
90
|
+
requestTokens = 500; // Create operations typically have larger request bodies
|
|
91
|
+
break;
|
|
92
|
+
case "update":
|
|
93
|
+
requestTokens = 400;
|
|
94
|
+
break;
|
|
95
|
+
case "list":
|
|
96
|
+
requestTokens = 50; // List operations have minimal request
|
|
97
|
+
break;
|
|
98
|
+
case "get":
|
|
99
|
+
requestTokens = 30;
|
|
100
|
+
break;
|
|
101
|
+
case "delete":
|
|
102
|
+
requestTokens = 30;
|
|
103
|
+
break;
|
|
104
|
+
default:
|
|
105
|
+
requestTokens = 200;
|
|
106
|
+
}
|
|
107
|
+
// Response tokens: based on operation type
|
|
108
|
+
let responseTokens;
|
|
109
|
+
switch (tool.operation) {
|
|
110
|
+
case "list":
|
|
111
|
+
responseTokens = 1000; // List operations can return many items
|
|
112
|
+
break;
|
|
113
|
+
case "get":
|
|
114
|
+
responseTokens = 500;
|
|
115
|
+
break;
|
|
116
|
+
case "create":
|
|
117
|
+
responseTokens = 400;
|
|
118
|
+
break;
|
|
119
|
+
case "update":
|
|
120
|
+
responseTokens = 400;
|
|
121
|
+
break;
|
|
122
|
+
case "delete":
|
|
123
|
+
responseTokens = 100;
|
|
124
|
+
break;
|
|
125
|
+
default:
|
|
126
|
+
responseTokens = 300;
|
|
127
|
+
}
|
|
128
|
+
return {
|
|
129
|
+
schemaTokens,
|
|
130
|
+
requestTokens,
|
|
131
|
+
responseTokens,
|
|
132
|
+
totalTokens: schemaTokens + requestTokens + responseTokens,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Estimate latency for a tool call
|
|
137
|
+
*/
|
|
138
|
+
export function estimateToolLatency(toolName) {
|
|
139
|
+
const level = getLatencyLevel(toolName);
|
|
140
|
+
return {
|
|
141
|
+
level,
|
|
142
|
+
estimatedMs: LATENCY_MS_MAP[level],
|
|
143
|
+
description: LATENCY_DESCRIPTIONS[level],
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Get complete cost estimate for a single tool
|
|
148
|
+
*/
|
|
149
|
+
export function estimateToolCost(toolName) {
|
|
150
|
+
const exists = toolExists(toolName);
|
|
151
|
+
const tool = getToolByName(toolName);
|
|
152
|
+
return {
|
|
153
|
+
toolName,
|
|
154
|
+
tokens: estimateToolTokens(toolName),
|
|
155
|
+
latency: estimateToolLatency(toolName),
|
|
156
|
+
dangerLevel: tool?.dangerLevel ?? "low",
|
|
157
|
+
exists,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Estimate costs for multiple tools
|
|
162
|
+
*/
|
|
163
|
+
export function estimateMultipleToolsCost(toolNames) {
|
|
164
|
+
return toolNames.map((name) => estimateToolCost(name));
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Aggregate latency levels into average
|
|
168
|
+
*/
|
|
169
|
+
function aggregateLatency(levels) {
|
|
170
|
+
if (levels.length === 0) {
|
|
171
|
+
return "unknown";
|
|
172
|
+
}
|
|
173
|
+
const levelValues = {
|
|
174
|
+
low: 1,
|
|
175
|
+
moderate: 2,
|
|
176
|
+
high: 3,
|
|
177
|
+
unknown: 2,
|
|
178
|
+
};
|
|
179
|
+
const total = levels.reduce((sum, level) => sum + levelValues[level], 0);
|
|
180
|
+
const avg = total / levels.length;
|
|
181
|
+
if (avg < 1.5)
|
|
182
|
+
return "low";
|
|
183
|
+
if (avg < 2.5)
|
|
184
|
+
return "moderate";
|
|
185
|
+
return "high";
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Estimate costs for a creation plan workflow
|
|
189
|
+
*/
|
|
190
|
+
export function estimateWorkflowCost(plan) {
|
|
191
|
+
const warnings = [];
|
|
192
|
+
const latencyLevels = [];
|
|
193
|
+
const steps = plan.steps.map((step) => {
|
|
194
|
+
const tokens = estimateToolTokens(step.toolName);
|
|
195
|
+
const latency = estimateToolLatency(step.toolName);
|
|
196
|
+
if (!toolExists(step.toolName)) {
|
|
197
|
+
warnings.push(`Tool '${step.toolName}' not found - estimates may be inaccurate`);
|
|
198
|
+
}
|
|
199
|
+
latencyLevels.push(latency.level);
|
|
200
|
+
return {
|
|
201
|
+
stepNumber: step.stepNumber,
|
|
202
|
+
toolName: step.toolName,
|
|
203
|
+
tokens: tokens.totalTokens,
|
|
204
|
+
latencyMs: latency.estimatedMs,
|
|
205
|
+
};
|
|
206
|
+
});
|
|
207
|
+
const totalTokens = steps.reduce((sum, step) => sum + step.tokens, 0);
|
|
208
|
+
const estimatedTotalMs = steps.reduce((sum, step) => sum + step.latencyMs, 0);
|
|
209
|
+
return {
|
|
210
|
+
totalTokens,
|
|
211
|
+
averageLatency: aggregateLatency(latencyLevels),
|
|
212
|
+
estimatedTotalMs,
|
|
213
|
+
stepCount: steps.length,
|
|
214
|
+
steps,
|
|
215
|
+
warnings,
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Format cost estimate for human-readable output
|
|
220
|
+
*/
|
|
221
|
+
export function formatCostEstimate(estimate) {
|
|
222
|
+
const lines = [];
|
|
223
|
+
lines.push(`# Cost Estimate: ${estimate.toolName}`);
|
|
224
|
+
lines.push("");
|
|
225
|
+
if (!estimate.exists) {
|
|
226
|
+
lines.push("**Warning**: Tool not found - estimates are approximate");
|
|
227
|
+
lines.push("");
|
|
228
|
+
}
|
|
229
|
+
lines.push("## Token Usage");
|
|
230
|
+
lines.push(`- Schema/Description: ~${estimate.tokens.schemaTokens} tokens`);
|
|
231
|
+
lines.push(`- Request Body: ~${estimate.tokens.requestTokens} tokens`);
|
|
232
|
+
lines.push(`- Response: ~${estimate.tokens.responseTokens} tokens`);
|
|
233
|
+
lines.push(`- **Total per call**: ~${estimate.tokens.totalTokens} tokens`);
|
|
234
|
+
lines.push("");
|
|
235
|
+
lines.push("## Latency");
|
|
236
|
+
lines.push(`- Level: ${estimate.latency.level}`);
|
|
237
|
+
lines.push(`- Estimated: ~${estimate.latency.estimatedMs}ms`);
|
|
238
|
+
lines.push(`- ${estimate.latency.description}`);
|
|
239
|
+
lines.push("");
|
|
240
|
+
lines.push("## Risk");
|
|
241
|
+
lines.push(`- Danger Level: ${estimate.dangerLevel}`);
|
|
242
|
+
return lines.join("\n");
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Format workflow cost estimate for human-readable output
|
|
246
|
+
*/
|
|
247
|
+
export function formatWorkflowCostEstimate(estimate) {
|
|
248
|
+
const lines = [];
|
|
249
|
+
lines.push("# Workflow Cost Estimate");
|
|
250
|
+
lines.push("");
|
|
251
|
+
lines.push("## Summary");
|
|
252
|
+
lines.push(`- **Total Steps**: ${estimate.stepCount}`);
|
|
253
|
+
lines.push(`- **Total Tokens**: ~${estimate.totalTokens}`);
|
|
254
|
+
lines.push(`- **Average Latency**: ${estimate.averageLatency}`);
|
|
255
|
+
lines.push(`- **Estimated Total Time**: ~${(estimate.estimatedTotalMs / 1000).toFixed(1)}s`);
|
|
256
|
+
lines.push("");
|
|
257
|
+
if (estimate.warnings.length > 0) {
|
|
258
|
+
lines.push("## Warnings");
|
|
259
|
+
for (const warning of estimate.warnings) {
|
|
260
|
+
lines.push(`- ${warning}`);
|
|
261
|
+
}
|
|
262
|
+
lines.push("");
|
|
263
|
+
}
|
|
264
|
+
lines.push("## Step Breakdown");
|
|
265
|
+
lines.push("");
|
|
266
|
+
lines.push("| Step | Tool | Tokens | Latency |");
|
|
267
|
+
lines.push("|------|------|--------|---------|");
|
|
268
|
+
for (const step of estimate.steps) {
|
|
269
|
+
lines.push(`| ${step.stepNumber} | ${step.toolName} | ~${step.tokens} | ~${step.latencyMs}ms |`);
|
|
270
|
+
}
|
|
271
|
+
return lines.join("\n");
|
|
272
|
+
}
|
|
273
|
+
//# sourceMappingURL=cost-estimator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cost-estimator.js","sourceRoot":"","sources":["../../../src/tools/discovery/cost-estimator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAuF/C;;GAEG;AACH,MAA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IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAC7F,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEf,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACjC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC1B,KAAK,MAAM,OAAO,IAAI,QAAQ,CAAC,QAAQ,EAAE,CAAC;YACxC,KAAK,CAAC,IAAI,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC;QAC7B,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAChC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAC;IACjD,KAAK,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAC;IACjD,KAAK,MAAM,IAAI,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;QAClC,KAAK,CAAC,IAAI,CACR,KAAK,IAAI,CAAC,UAAU,MAAM,IAAI,CAAC,QAAQ,OAAO,IAAI,CAAC,MAAM,OAAO,IAAI,CAAC,SAAS,MAAM,CACrF,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-loader.d.ts","sourceRoot":"","sources":["../../../src/tools/discovery/index-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index-loader.d.ts","sourceRoot":"","sources":["../../../src/tools/discovery/index-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAqC/E;;GAEG;AACH,wBAAgB,YAAY,IAAI,SAAS,CAKxC;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,iBAAiB,CAEpD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAGpD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAGzE"}
|
|
@@ -17,6 +17,9 @@ function generateIndex() {
|
|
|
17
17
|
resource: tool.resource,
|
|
18
18
|
operation: tool.operation,
|
|
19
19
|
summary: tool.summary,
|
|
20
|
+
dangerLevel: tool.dangerLevel ?? "low",
|
|
21
|
+
// Note: isDeprecated not yet extracted from x-ves-deprecated in parser
|
|
22
|
+
isDeprecated: false,
|
|
20
23
|
}));
|
|
21
24
|
// Calculate domain counts
|
|
22
25
|
const domains = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-loader.js","sourceRoot":"","sources":["../../../src/tools/discovery/index-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,+BAA+B;AAC/B,IAAI,WAAW,GAAqB,IAAI,CAAC;AAEzC;;GAEG;AACH,SAAS,aAAa;IACpB,MAAM,KAAK,GAAqB,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACtD,IAAI,EAAE,IAAI,CAAC,QAAQ;QACnB,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,OAAO,EAAE,IAAI,CAAC,OAAO;
|
|
1
|
+
{"version":3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GAEG;AACH,MAAM,UAAU,eAAe;IAC7B,WAAW,GAAG,IAAI,CAAC;AACrB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,YAAY,EAAE,CAAC,QAAQ,CAAC;AACjC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,QAAgB;IACzC,MAAM,KAAK,GAAG,YAAY,EAAE,CAAC;IAC7B,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC;AACtD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,QAAgB;IAC3C,MAAM,KAAK,GAAG,YAAY,EAAE,CAAC;IAC7B,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -25,6 +25,14 @@ export { executeTool, validateExecuteParams } from "./execute.js";
|
|
|
25
25
|
export type { CrudOperation, ConsolidatedResource, ConsolidatedIndex } from "./consolidate.js";
|
|
26
26
|
export { getConsolidatedIndex, clearConsolidatedCache, getConsolidatedResource, getConsolidatedByDomain, searchConsolidatedResources, resolveConsolidatedTool, getConsolidationStats, } from "./consolidate.js";
|
|
27
27
|
export { loadDependencyGraph, clearDependencyCache, getResourceDependencies, getCreationOrder, getPrerequisiteResources, getDependentResources, getOneOfGroups, getSubscriptionRequirements, getResourcesRequiringSubscription, getAvailableAddonServices, generateDependencyReport, getDependencyStats, getResourcesInDomain, getAllDependencyDomains, } from "./dependencies.js";
|
|
28
|
+
export type { ValidationError, ValidationResult, ValidateParams } from "./validate.js";
|
|
29
|
+
export { validateToolParams, formatValidationResult } from "./validate.js";
|
|
30
|
+
export type { WorkflowStep, AlternativePath, CreationPlan, ResolveParams, ResolveResult, } from "./resolver.js";
|
|
31
|
+
export { resolveDependencies, formatCreationPlan, generateCompactPlan } from "./resolver.js";
|
|
32
|
+
export type { LatencyLevel, TokenEstimate, LatencyEstimate, ToolCostEstimate, WorkflowCostEstimate, EstimateCostParams, } from "./cost-estimator.js";
|
|
33
|
+
export { estimateToolTokens, estimateToolLatency, estimateToolCost, estimateMultipleToolsCost, estimateWorkflowCost, formatCostEstimate, formatWorkflowCostEstimate, } from "./cost-estimator.js";
|
|
34
|
+
export type { CommonError, DangerAnalysis, RecommendedWorkflow, DomainBestPractices, BestPracticesQuery, BestPracticesResult, } from "./best-practices.js";
|
|
35
|
+
export { getDomainBestPractices, queryBestPractices, getAllDomainsSummary, formatBestPractices, } from "./best-practices.js";
|
|
28
36
|
/**
|
|
29
37
|
* MCP Tool Definitions for the discovery meta-tools
|
|
30
38
|
*
|
|
@@ -61,6 +69,18 @@ export declare const DISCOVERY_TOOLS: {
|
|
|
61
69
|
};
|
|
62
70
|
readonly description: "Filter by operation type(s): create, get, list, update, delete";
|
|
63
71
|
};
|
|
72
|
+
readonly excludeDangerous: {
|
|
73
|
+
readonly type: "boolean";
|
|
74
|
+
readonly description: "Exclude high-danger operations from results";
|
|
75
|
+
};
|
|
76
|
+
readonly excludeDeprecated: {
|
|
77
|
+
readonly type: "boolean";
|
|
78
|
+
readonly description: "Exclude deprecated operations from results";
|
|
79
|
+
};
|
|
80
|
+
readonly includeDependencies: {
|
|
81
|
+
readonly type: "boolean";
|
|
82
|
+
readonly description: "Include prerequisite hints for create operations";
|
|
83
|
+
};
|
|
64
84
|
};
|
|
65
85
|
readonly required: readonly ["query"];
|
|
66
86
|
};
|
|
@@ -214,5 +234,130 @@ export declare const DISCOVERY_TOOLS: {
|
|
|
214
234
|
readonly properties: {};
|
|
215
235
|
};
|
|
216
236
|
};
|
|
237
|
+
readonly validateParams: {
|
|
238
|
+
readonly name: "f5xc-api-validate-params";
|
|
239
|
+
readonly description: string;
|
|
240
|
+
readonly inputSchema: {
|
|
241
|
+
readonly type: "object";
|
|
242
|
+
readonly properties: {
|
|
243
|
+
readonly toolName: {
|
|
244
|
+
readonly type: "string";
|
|
245
|
+
readonly description: "The exact tool name to validate parameters for";
|
|
246
|
+
};
|
|
247
|
+
readonly pathParams: {
|
|
248
|
+
readonly type: "object";
|
|
249
|
+
readonly description: "Path parameters to validate (e.g., { namespace: 'default', name: 'my-resource' })";
|
|
250
|
+
readonly additionalProperties: {
|
|
251
|
+
readonly type: "string";
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
readonly queryParams: {
|
|
255
|
+
readonly type: "object";
|
|
256
|
+
readonly description: "Query parameters to validate";
|
|
257
|
+
readonly additionalProperties: {
|
|
258
|
+
readonly type: "string";
|
|
259
|
+
};
|
|
260
|
+
};
|
|
261
|
+
readonly body: {
|
|
262
|
+
readonly type: "object";
|
|
263
|
+
readonly description: "Request body to validate";
|
|
264
|
+
};
|
|
265
|
+
};
|
|
266
|
+
readonly required: readonly ["toolName"];
|
|
267
|
+
};
|
|
268
|
+
};
|
|
269
|
+
readonly resolveDependencies: {
|
|
270
|
+
readonly name: "f5xc-api-resolve-dependencies";
|
|
271
|
+
readonly description: string;
|
|
272
|
+
readonly inputSchema: {
|
|
273
|
+
readonly type: "object";
|
|
274
|
+
readonly properties: {
|
|
275
|
+
readonly resource: {
|
|
276
|
+
readonly type: "string";
|
|
277
|
+
readonly description: "The target resource to create (e.g., 'http-loadbalancer', 'origin-pool')";
|
|
278
|
+
};
|
|
279
|
+
readonly domain: {
|
|
280
|
+
readonly type: "string";
|
|
281
|
+
readonly description: "The domain containing the resource (e.g., 'virtual', 'network')";
|
|
282
|
+
};
|
|
283
|
+
readonly existingResources: {
|
|
284
|
+
readonly type: "array";
|
|
285
|
+
readonly items: {
|
|
286
|
+
readonly type: "string";
|
|
287
|
+
};
|
|
288
|
+
readonly description: string;
|
|
289
|
+
};
|
|
290
|
+
readonly includeOptional: {
|
|
291
|
+
readonly type: "boolean";
|
|
292
|
+
readonly description: "Include optional dependencies in the plan (default: false)";
|
|
293
|
+
readonly default: false;
|
|
294
|
+
};
|
|
295
|
+
readonly maxDepth: {
|
|
296
|
+
readonly type: "number";
|
|
297
|
+
readonly description: "Maximum depth for dependency traversal (default: 10)";
|
|
298
|
+
readonly default: 10;
|
|
299
|
+
};
|
|
300
|
+
readonly expandAlternatives: {
|
|
301
|
+
readonly type: "boolean";
|
|
302
|
+
readonly description: "Include alternative paths for oneOf choices (default: false)";
|
|
303
|
+
readonly default: false;
|
|
304
|
+
};
|
|
305
|
+
};
|
|
306
|
+
readonly required: readonly ["resource", "domain"];
|
|
307
|
+
};
|
|
308
|
+
};
|
|
309
|
+
readonly estimateCost: {
|
|
310
|
+
readonly name: "f5xc-api-estimate-cost";
|
|
311
|
+
readonly description: string;
|
|
312
|
+
readonly inputSchema: {
|
|
313
|
+
readonly type: "object";
|
|
314
|
+
readonly properties: {
|
|
315
|
+
readonly toolName: {
|
|
316
|
+
readonly type: "string";
|
|
317
|
+
readonly description: "A single tool name to estimate (e.g., 'f5xc-api-waap-http-loadbalancer-create')";
|
|
318
|
+
};
|
|
319
|
+
readonly toolNames: {
|
|
320
|
+
readonly type: "array";
|
|
321
|
+
readonly items: {
|
|
322
|
+
readonly type: "string";
|
|
323
|
+
};
|
|
324
|
+
readonly description: "Multiple tool names to estimate costs for";
|
|
325
|
+
};
|
|
326
|
+
readonly plan: {
|
|
327
|
+
readonly type: "object";
|
|
328
|
+
readonly description: "A CreationPlan object from f5xc-api-resolve-dependencies to estimate workflow costs";
|
|
329
|
+
};
|
|
330
|
+
readonly detailed: {
|
|
331
|
+
readonly type: "boolean";
|
|
332
|
+
readonly description: "Include detailed breakdown of token usage and latency (default: true)";
|
|
333
|
+
readonly default: true;
|
|
334
|
+
};
|
|
335
|
+
};
|
|
336
|
+
};
|
|
337
|
+
};
|
|
338
|
+
readonly bestPractices: {
|
|
339
|
+
readonly name: "f5xc-api-best-practices";
|
|
340
|
+
readonly description: string;
|
|
341
|
+
readonly inputSchema: {
|
|
342
|
+
readonly type: "object";
|
|
343
|
+
readonly properties: {
|
|
344
|
+
readonly domain: {
|
|
345
|
+
readonly type: "string";
|
|
346
|
+
readonly description: string;
|
|
347
|
+
};
|
|
348
|
+
readonly aspect: {
|
|
349
|
+
readonly type: "string";
|
|
350
|
+
readonly enum: readonly ["errors", "workflows", "danger", "security", "performance", "all"];
|
|
351
|
+
readonly description: string;
|
|
352
|
+
readonly default: "all";
|
|
353
|
+
};
|
|
354
|
+
readonly detailed: {
|
|
355
|
+
readonly type: "boolean";
|
|
356
|
+
readonly description: "Include detailed breakdowns (default: true)";
|
|
357
|
+
readonly default: true;
|
|
358
|
+
};
|
|
359
|
+
};
|
|
360
|
+
};
|
|
361
|
+
};
|
|
217
362
|
};
|
|
218
363
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/discovery/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,YAAY,EACV,cAAc,EACd,YAAY,EACZ,aAAa,EACb,SAAS,EACT,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEnG,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAGhG,OAAO,EACL,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,YAAY,GACb,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAGlE,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,2BAA2B,EAC3B,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,gBAAgB,EAChB,wBAAwB,EACxB,qBAAqB,EACrB,cAAc,EACd,2BAA2B,EAC3B,iCAAiC,EACjC,yBAAyB,EACzB,wBAAwB,EACxB,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/discovery/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,YAAY,EACV,cAAc,EACd,YAAY,EACZ,aAAa,EACb,SAAS,EACT,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEnG,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAGhG,OAAO,EACL,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,YAAY,GACb,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,cAAc,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M,qBAAqB,CAAC;AAE7B;;;;;GAKG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiWlB,CAAC"}
|
|
@@ -26,6 +26,10 @@ export { executeTool, validateExecuteParams } from "./execute.js";
|
|
|
26
26
|
export { getConsolidatedIndex, clearConsolidatedCache, getConsolidatedResource, getConsolidatedByDomain, searchConsolidatedResources, resolveConsolidatedTool, getConsolidationStats, } from "./consolidate.js";
|
|
27
27
|
// Dependency discovery exports
|
|
28
28
|
export { loadDependencyGraph, clearDependencyCache, getResourceDependencies, getCreationOrder, getPrerequisiteResources, getDependentResources, getOneOfGroups, getSubscriptionRequirements, getResourcesRequiringSubscription, getAvailableAddonServices, generateDependencyReport, getDependencyStats, getResourcesInDomain, getAllDependencyDomains, } from "./dependencies.js";
|
|
29
|
+
export { validateToolParams, formatValidationResult } from "./validate.js";
|
|
30
|
+
export { resolveDependencies, formatCreationPlan, generateCompactPlan } from "./resolver.js";
|
|
31
|
+
export { estimateToolTokens, estimateToolLatency, estimateToolCost, estimateMultipleToolsCost, estimateWorkflowCost, formatCostEstimate, formatWorkflowCostEstimate, } from "./cost-estimator.js";
|
|
32
|
+
export { getDomainBestPractices, queryBestPractices, getAllDomainsSummary, formatBestPractices, } from "./best-practices.js";
|
|
29
33
|
/**
|
|
30
34
|
* MCP Tool Definitions for the discovery meta-tools
|
|
31
35
|
*
|
|
@@ -59,6 +63,18 @@ export const DISCOVERY_TOOLS = {
|
|
|
59
63
|
items: { type: "string" },
|
|
60
64
|
description: "Filter by operation type(s): create, get, list, update, delete",
|
|
61
65
|
},
|
|
66
|
+
excludeDangerous: {
|
|
67
|
+
type: "boolean",
|
|
68
|
+
description: "Exclude high-danger operations from results",
|
|
69
|
+
},
|
|
70
|
+
excludeDeprecated: {
|
|
71
|
+
type: "boolean",
|
|
72
|
+
description: "Exclude deprecated operations from results",
|
|
73
|
+
},
|
|
74
|
+
includeDependencies: {
|
|
75
|
+
type: "boolean",
|
|
76
|
+
description: "Include prerequisite hints for create operations",
|
|
77
|
+
},
|
|
62
78
|
},
|
|
63
79
|
required: ["query"],
|
|
64
80
|
},
|
|
@@ -216,5 +232,130 @@ export const DISCOVERY_TOOLS = {
|
|
|
216
232
|
properties: {},
|
|
217
233
|
},
|
|
218
234
|
},
|
|
235
|
+
validateParams: {
|
|
236
|
+
name: "f5xc-api-validate-params",
|
|
237
|
+
description: "Validate parameters for an F5XC API tool before execution. Checks required fields, " +
|
|
238
|
+
"parameter types, and oneOf constraints. Returns detailed error messages for invalid inputs.",
|
|
239
|
+
inputSchema: {
|
|
240
|
+
type: "object",
|
|
241
|
+
properties: {
|
|
242
|
+
toolName: {
|
|
243
|
+
type: "string",
|
|
244
|
+
description: "The exact tool name to validate parameters for",
|
|
245
|
+
},
|
|
246
|
+
pathParams: {
|
|
247
|
+
type: "object",
|
|
248
|
+
description: "Path parameters to validate (e.g., { namespace: 'default', name: 'my-resource' })",
|
|
249
|
+
additionalProperties: { type: "string" },
|
|
250
|
+
},
|
|
251
|
+
queryParams: {
|
|
252
|
+
type: "object",
|
|
253
|
+
description: "Query parameters to validate",
|
|
254
|
+
additionalProperties: { type: "string" },
|
|
255
|
+
},
|
|
256
|
+
body: {
|
|
257
|
+
type: "object",
|
|
258
|
+
description: "Request body to validate",
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
required: ["toolName"],
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
resolveDependencies: {
|
|
265
|
+
name: "f5xc-api-resolve-dependencies",
|
|
266
|
+
description: "Generate a complete creation plan for an F5XC resource with all transitive dependencies. " +
|
|
267
|
+
"Returns step-by-step workflow with tool names, required inputs, and oneOf choices. " +
|
|
268
|
+
"Essential for understanding what resources must be created before the target resource.",
|
|
269
|
+
inputSchema: {
|
|
270
|
+
type: "object",
|
|
271
|
+
properties: {
|
|
272
|
+
resource: {
|
|
273
|
+
type: "string",
|
|
274
|
+
description: "The target resource to create (e.g., 'http-loadbalancer', 'origin-pool')",
|
|
275
|
+
},
|
|
276
|
+
domain: {
|
|
277
|
+
type: "string",
|
|
278
|
+
description: "The domain containing the resource (e.g., 'virtual', 'network')",
|
|
279
|
+
},
|
|
280
|
+
existingResources: {
|
|
281
|
+
type: "array",
|
|
282
|
+
items: { type: "string" },
|
|
283
|
+
description: "Resources that already exist (will be skipped). Format: 'domain/resource' " +
|
|
284
|
+
"(e.g., ['network/origin-pool', 'certificates/certificate'])",
|
|
285
|
+
},
|
|
286
|
+
includeOptional: {
|
|
287
|
+
type: "boolean",
|
|
288
|
+
description: "Include optional dependencies in the plan (default: false)",
|
|
289
|
+
default: false,
|
|
290
|
+
},
|
|
291
|
+
maxDepth: {
|
|
292
|
+
type: "number",
|
|
293
|
+
description: "Maximum depth for dependency traversal (default: 10)",
|
|
294
|
+
default: 10,
|
|
295
|
+
},
|
|
296
|
+
expandAlternatives: {
|
|
297
|
+
type: "boolean",
|
|
298
|
+
description: "Include alternative paths for oneOf choices (default: false)",
|
|
299
|
+
default: false,
|
|
300
|
+
},
|
|
301
|
+
},
|
|
302
|
+
required: ["resource", "domain"],
|
|
303
|
+
},
|
|
304
|
+
},
|
|
305
|
+
estimateCost: {
|
|
306
|
+
name: "f5xc-api-estimate-cost",
|
|
307
|
+
description: "Estimate token usage and latency for F5XC API tool calls. Provides cost estimates for individual tools, " +
|
|
308
|
+
"multiple tools, or complete creation plan workflows. Useful for planning and optimizing API interactions.",
|
|
309
|
+
inputSchema: {
|
|
310
|
+
type: "object",
|
|
311
|
+
properties: {
|
|
312
|
+
toolName: {
|
|
313
|
+
type: "string",
|
|
314
|
+
description: "A single tool name to estimate (e.g., 'f5xc-api-waap-http-loadbalancer-create')",
|
|
315
|
+
},
|
|
316
|
+
toolNames: {
|
|
317
|
+
type: "array",
|
|
318
|
+
items: { type: "string" },
|
|
319
|
+
description: "Multiple tool names to estimate costs for",
|
|
320
|
+
},
|
|
321
|
+
plan: {
|
|
322
|
+
type: "object",
|
|
323
|
+
description: "A CreationPlan object from f5xc-api-resolve-dependencies to estimate workflow costs",
|
|
324
|
+
},
|
|
325
|
+
detailed: {
|
|
326
|
+
type: "boolean",
|
|
327
|
+
description: "Include detailed breakdown of token usage and latency (default: true)",
|
|
328
|
+
default: true,
|
|
329
|
+
},
|
|
330
|
+
},
|
|
331
|
+
},
|
|
332
|
+
},
|
|
333
|
+
bestPractices: {
|
|
334
|
+
name: "f5xc-api-best-practices",
|
|
335
|
+
description: "Get domain-specific best practices for F5XC API operations. Includes common errors with resolutions, " +
|
|
336
|
+
"recommended workflows, danger level analysis, security notes, and performance tips.",
|
|
337
|
+
inputSchema: {
|
|
338
|
+
type: "object",
|
|
339
|
+
properties: {
|
|
340
|
+
domain: {
|
|
341
|
+
type: "string",
|
|
342
|
+
description: "Domain to get best practices for (e.g., 'virtual', 'dns', 'certificates'). " +
|
|
343
|
+
"Omit to list available domains.",
|
|
344
|
+
},
|
|
345
|
+
aspect: {
|
|
346
|
+
type: "string",
|
|
347
|
+
enum: ["errors", "workflows", "danger", "security", "performance", "all"],
|
|
348
|
+
description: "Specific aspect to retrieve: 'errors' (common errors), 'workflows' (recommended workflows), " +
|
|
349
|
+
"'danger' (danger level analysis), 'security' (security notes), 'performance' (tips), 'all' (default)",
|
|
350
|
+
default: "all",
|
|
351
|
+
},
|
|
352
|
+
detailed: {
|
|
353
|
+
type: "boolean",
|
|
354
|
+
description: "Include detailed breakdowns (default: true)",
|
|
355
|
+
default: true,
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
},
|
|
359
|
+
},
|
|
219
360
|
};
|
|
220
361
|
//# sourceMappingURL=index.js.map
|