@robinmordasiewicz/f5xc-terraform-mcp 2.14.11 → 2.15.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 +1 -1
- package/dist/docs/data-sources/dns_zone.md +2 -2
- package/dist/docs/resources/api_credential.md +2 -2
- package/dist/docs/resources/child_tenant.md +2 -2
- package/dist/docs/resources/dns_zone.md +443 -306
- package/dist/index.d.ts +14 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +83 -1058
- package/dist/index.js.map +1 -1
- package/dist/schemas/common.d.ts +180 -0
- package/dist/schemas/common.d.ts.map +1 -0
- package/dist/schemas/common.js +230 -0
- package/dist/schemas/common.js.map +1 -0
- package/dist/schemas/index.d.ts +13 -13
- package/dist/tools/addon.d.ts +19 -0
- package/dist/tools/addon.d.ts.map +1 -0
- package/dist/tools/addon.js +219 -0
- package/dist/tools/addon.js.map +1 -0
- package/dist/tools/api.d.ts +20 -0
- package/dist/tools/api.d.ts.map +1 -0
- package/dist/tools/api.js +281 -0
- package/dist/tools/api.js.map +1 -0
- package/dist/tools/discover.d.ts +18 -0
- package/dist/tools/discover.d.ts.map +1 -0
- package/dist/tools/discover.js +190 -0
- package/dist/tools/discover.js.map +1 -0
- package/dist/tools/docs.d.ts +18 -0
- package/dist/tools/docs.d.ts.map +1 -0
- package/dist/tools/docs.js +158 -0
- package/dist/tools/docs.js.map +1 -0
- package/dist/tools/subscription.d.ts +18 -0
- package/dist/tools/subscription.d.ts.map +1 -0
- package/dist/tools/subscription.js +225 -0
- package/dist/tools/subscription.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Consolidated Addon Tool Handler
|
|
3
|
+
*
|
|
4
|
+
* Replaces: f5xc_terraform_addon_list_services, f5xc_terraform_addon_check_activation,
|
|
5
|
+
* f5xc_terraform_addon_activation_workflow
|
|
6
|
+
*
|
|
7
|
+
* Tool: f5xc_terraform_addon
|
|
8
|
+
*/
|
|
9
|
+
import { ResponseFormat } from '../types.js';
|
|
10
|
+
import { listAddonServices, checkAddonActivation, getAddonWorkflow, } from '../services/addons.js';
|
|
11
|
+
// =============================================================================
|
|
12
|
+
// HANDLER
|
|
13
|
+
// =============================================================================
|
|
14
|
+
/**
|
|
15
|
+
* Handles the f5xc_terraform_addon tool invocation
|
|
16
|
+
* Routes to appropriate operation based on input.operation
|
|
17
|
+
*/
|
|
18
|
+
export async function handleAddon(input) {
|
|
19
|
+
const { operation, response_format } = input;
|
|
20
|
+
switch (operation) {
|
|
21
|
+
case 'list':
|
|
22
|
+
return handleList(input, response_format);
|
|
23
|
+
case 'check':
|
|
24
|
+
return handleCheck(input, response_format);
|
|
25
|
+
case 'workflow':
|
|
26
|
+
return handleWorkflow(input, response_format);
|
|
27
|
+
default:
|
|
28
|
+
throw new Error(`Unknown operation: ${operation}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
// =============================================================================
|
|
32
|
+
// OPERATION HANDLERS
|
|
33
|
+
// =============================================================================
|
|
34
|
+
function handleList(input, format) {
|
|
35
|
+
const { tier, activation_type } = input;
|
|
36
|
+
// Map tier from schema enum to service format
|
|
37
|
+
const tierFilter = tier;
|
|
38
|
+
const activationFilter = activation_type === 'partial' ? 'managed' : activation_type;
|
|
39
|
+
const result = listAddonServices(tierFilter, activationFilter);
|
|
40
|
+
if (format === ResponseFormat.JSON) {
|
|
41
|
+
return JSON.stringify({
|
|
42
|
+
operation: 'list',
|
|
43
|
+
filters: {
|
|
44
|
+
tier: tier || 'all',
|
|
45
|
+
activation_type: activation_type || 'all',
|
|
46
|
+
},
|
|
47
|
+
total: result.total,
|
|
48
|
+
services: result.services,
|
|
49
|
+
}, null, 2);
|
|
50
|
+
}
|
|
51
|
+
// Markdown format
|
|
52
|
+
const lines = [
|
|
53
|
+
'# F5XC Addon Services',
|
|
54
|
+
'',
|
|
55
|
+
tier ? `**Tier Filter**: ${tier}` : '',
|
|
56
|
+
activation_type ? `**Activation Filter**: ${activation_type}` : '',
|
|
57
|
+
`**Total**: ${result.total} service(s)`,
|
|
58
|
+
'',
|
|
59
|
+
];
|
|
60
|
+
if (result.total === 0) {
|
|
61
|
+
lines.push('No addon services match the specified filters.');
|
|
62
|
+
return lines.join('\n');
|
|
63
|
+
}
|
|
64
|
+
// Group by category
|
|
65
|
+
const byCategory = new Map();
|
|
66
|
+
for (const service of result.services) {
|
|
67
|
+
const cat = service.category || 'other';
|
|
68
|
+
if (!byCategory.has(cat)) {
|
|
69
|
+
byCategory.set(cat, []);
|
|
70
|
+
}
|
|
71
|
+
byCategory.get(cat).push(service);
|
|
72
|
+
}
|
|
73
|
+
for (const [category, services] of byCategory) {
|
|
74
|
+
lines.push(`## ${category.charAt(0).toUpperCase() + category.slice(1)}`);
|
|
75
|
+
lines.push('');
|
|
76
|
+
for (const service of services) {
|
|
77
|
+
lines.push(`### ${service.displayName}`);
|
|
78
|
+
lines.push(`- **Name**: \`${service.name}\``);
|
|
79
|
+
lines.push(`- **Tier**: ${service.tier}`);
|
|
80
|
+
lines.push(`- **Activation**: ${service.activationType}`);
|
|
81
|
+
lines.push(`- ${service.description}`);
|
|
82
|
+
lines.push('');
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return lines.join('\n');
|
|
86
|
+
}
|
|
87
|
+
function handleCheck(input, format) {
|
|
88
|
+
const { service_name } = input;
|
|
89
|
+
if (!service_name) {
|
|
90
|
+
throw new Error('service_name is required for check operation');
|
|
91
|
+
}
|
|
92
|
+
const result = checkAddonActivation(service_name);
|
|
93
|
+
if (!result) {
|
|
94
|
+
const error = {
|
|
95
|
+
error: 'Addon service not found',
|
|
96
|
+
service_name,
|
|
97
|
+
suggestion: "Use operation: 'list' to see available addon services",
|
|
98
|
+
};
|
|
99
|
+
return format === ResponseFormat.JSON
|
|
100
|
+
? JSON.stringify(error, null, 2)
|
|
101
|
+
: `# Error: Addon Service Not Found\n\n**Service**: ${service_name}\n\nUse \`operation: 'list'\` to see available addon services.`;
|
|
102
|
+
}
|
|
103
|
+
if (format === ResponseFormat.JSON) {
|
|
104
|
+
return JSON.stringify({
|
|
105
|
+
operation: 'check',
|
|
106
|
+
service_name: result.addonService,
|
|
107
|
+
display_name: result.displayName,
|
|
108
|
+
tier: result.tier,
|
|
109
|
+
activation_type: result.activationType,
|
|
110
|
+
can_activate: result.canActivate,
|
|
111
|
+
steps: result.steps,
|
|
112
|
+
terraform_example: result.terraformExample,
|
|
113
|
+
}, null, 2);
|
|
114
|
+
}
|
|
115
|
+
// Markdown format
|
|
116
|
+
const lines = [
|
|
117
|
+
`# Addon Activation Check: ${result.displayName}`,
|
|
118
|
+
'',
|
|
119
|
+
`**Service Name**: \`${result.addonService}\``,
|
|
120
|
+
`**Tier Required**: ${result.tier}`,
|
|
121
|
+
`**Activation Type**: ${result.activationType}`,
|
|
122
|
+
`**Can Self-Activate**: ${result.canActivate ? '✅ Yes' : '❌ No (requires sales contact)'}`,
|
|
123
|
+
'',
|
|
124
|
+
'## Activation Steps',
|
|
125
|
+
'',
|
|
126
|
+
];
|
|
127
|
+
for (let i = 0; i < result.steps.length; i++) {
|
|
128
|
+
lines.push(`${i + 1}. ${result.steps[i]}`);
|
|
129
|
+
}
|
|
130
|
+
lines.push('');
|
|
131
|
+
lines.push('## Terraform Example');
|
|
132
|
+
lines.push('');
|
|
133
|
+
lines.push('```hcl');
|
|
134
|
+
lines.push(result.terraformExample);
|
|
135
|
+
lines.push('```');
|
|
136
|
+
return lines.join('\n');
|
|
137
|
+
}
|
|
138
|
+
function handleWorkflow(input, format) {
|
|
139
|
+
const { service_name, activation_type } = input;
|
|
140
|
+
if (!service_name) {
|
|
141
|
+
throw new Error('service_name is required for workflow operation');
|
|
142
|
+
}
|
|
143
|
+
const result = getAddonWorkflow(service_name, activation_type);
|
|
144
|
+
if (!result) {
|
|
145
|
+
const error = {
|
|
146
|
+
error: 'Addon service not found or workflow not available',
|
|
147
|
+
service_name,
|
|
148
|
+
suggestion: "Use operation: 'list' to see available addon services",
|
|
149
|
+
};
|
|
150
|
+
return format === ResponseFormat.JSON
|
|
151
|
+
? JSON.stringify(error, null, 2)
|
|
152
|
+
: `# Error: Workflow Not Available\n\n**Service**: ${service_name}\n\nUse \`operation: 'list'\` to see available addon services.`;
|
|
153
|
+
}
|
|
154
|
+
if (format === ResponseFormat.JSON) {
|
|
155
|
+
return JSON.stringify({
|
|
156
|
+
operation: 'workflow',
|
|
157
|
+
service_name: result.addonService,
|
|
158
|
+
activation_type: result.activationType,
|
|
159
|
+
description: result.description,
|
|
160
|
+
prerequisites: result.prerequisites,
|
|
161
|
+
steps: result.steps,
|
|
162
|
+
terraform_config: result.terraformConfig,
|
|
163
|
+
estimated_time: result.estimatedTime,
|
|
164
|
+
notes: result.notes,
|
|
165
|
+
}, null, 2);
|
|
166
|
+
}
|
|
167
|
+
// Markdown format
|
|
168
|
+
const lines = [
|
|
169
|
+
`# Activation Workflow: ${result.addonService}`,
|
|
170
|
+
'',
|
|
171
|
+
`**Activation Type**: ${result.activationType}`,
|
|
172
|
+
`**Estimated Time**: ${result.estimatedTime}`,
|
|
173
|
+
'',
|
|
174
|
+
result.description,
|
|
175
|
+
'',
|
|
176
|
+
'## Prerequisites',
|
|
177
|
+
'',
|
|
178
|
+
];
|
|
179
|
+
for (const prereq of result.prerequisites) {
|
|
180
|
+
lines.push(`- ${prereq}`);
|
|
181
|
+
}
|
|
182
|
+
lines.push('');
|
|
183
|
+
lines.push('## Steps');
|
|
184
|
+
lines.push('');
|
|
185
|
+
for (const step of result.steps) {
|
|
186
|
+
lines.push(`### Step ${step.step}: ${step.action}`);
|
|
187
|
+
lines.push('');
|
|
188
|
+
lines.push(step.description);
|
|
189
|
+
if (step.terraformSnippet) {
|
|
190
|
+
lines.push('');
|
|
191
|
+
lines.push('```hcl');
|
|
192
|
+
lines.push(step.terraformSnippet);
|
|
193
|
+
lines.push('```');
|
|
194
|
+
}
|
|
195
|
+
lines.push('');
|
|
196
|
+
}
|
|
197
|
+
lines.push('## Complete Terraform Configuration');
|
|
198
|
+
lines.push('');
|
|
199
|
+
lines.push('```hcl');
|
|
200
|
+
lines.push(result.terraformConfig);
|
|
201
|
+
lines.push('```');
|
|
202
|
+
lines.push('');
|
|
203
|
+
if (result.notes.length > 0) {
|
|
204
|
+
lines.push('## Notes');
|
|
205
|
+
lines.push('');
|
|
206
|
+
for (const note of result.notes) {
|
|
207
|
+
lines.push(`> ${note}`);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return lines.join('\n');
|
|
211
|
+
}
|
|
212
|
+
// =============================================================================
|
|
213
|
+
// TOOL DEFINITION
|
|
214
|
+
// =============================================================================
|
|
215
|
+
export const ADDON_TOOL_DEFINITION = {
|
|
216
|
+
name: 'f5xc_terraform_addon',
|
|
217
|
+
description: 'List, check activation, and get workflows for F5XC addon services',
|
|
218
|
+
};
|
|
219
|
+
//# sourceMappingURL=addon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addon.js","sourceRoot":"","sources":["../../src/tools/addon.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,uBAAuB,CAAC;AAE/B,gFAAgF;AAChF,UAAU;AACV,gFAAgF;AAEhF;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,KAAiB;IACjD,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAE7C,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,MAAM;YACT,OAAO,UAAU,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC;QAC5C,KAAK,OAAO;YACV,OAAO,WAAW,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC;QAC7C,KAAK,UAAU;YACb,OAAO,cAAc,CAAC,KAAK,EAAE,eAAe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B;IAC5B,WAAW,EAAE,mEAAmE;CACjF,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Consolidated API Tool Handler
|
|
3
|
+
*
|
|
4
|
+
* Replaces: f5xc_terraform_search_api_specs, f5xc_terraform_get_api_spec,
|
|
5
|
+
* f5xc_terraform_find_endpoints, f5xc_terraform_get_schema_definition,
|
|
6
|
+
* f5xc_terraform_list_definitions
|
|
7
|
+
*
|
|
8
|
+
* Tool: f5xc_terraform_api
|
|
9
|
+
*/
|
|
10
|
+
import { ApiInput } from '../schemas/common.js';
|
|
11
|
+
/**
|
|
12
|
+
* Handles the f5xc_terraform_api tool invocation
|
|
13
|
+
* Routes to appropriate operation based on input.operation
|
|
14
|
+
*/
|
|
15
|
+
export declare function handleApi(input: ApiInput): Promise<string>;
|
|
16
|
+
export declare const API_TOOL_DEFINITION: {
|
|
17
|
+
name: string;
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/tools/api.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAchD;;;GAGG;AACH,wBAAsB,SAAS,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAiBhE;AAmTD,eAAO,MAAM,mBAAmB;;;CAG/B,CAAC"}
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Consolidated API Tool Handler
|
|
3
|
+
*
|
|
4
|
+
* Replaces: f5xc_terraform_search_api_specs, f5xc_terraform_get_api_spec,
|
|
5
|
+
* f5xc_terraform_find_endpoints, f5xc_terraform_get_schema_definition,
|
|
6
|
+
* f5xc_terraform_list_definitions
|
|
7
|
+
*
|
|
8
|
+
* Tool: f5xc_terraform_api
|
|
9
|
+
*/
|
|
10
|
+
import { ResponseFormat } from '../types.js';
|
|
11
|
+
import { searchApiSpecs, getApiSpec, findEndpoints, getSchemaDefinition, listDefinitions, } from '../services/api-specs.js';
|
|
12
|
+
// =============================================================================
|
|
13
|
+
// HANDLER
|
|
14
|
+
// =============================================================================
|
|
15
|
+
/**
|
|
16
|
+
* Handles the f5xc_terraform_api tool invocation
|
|
17
|
+
* Routes to appropriate operation based on input.operation
|
|
18
|
+
*/
|
|
19
|
+
export async function handleApi(input) {
|
|
20
|
+
const { operation, response_format } = input;
|
|
21
|
+
switch (operation) {
|
|
22
|
+
case 'search':
|
|
23
|
+
return handleSearch(input, response_format);
|
|
24
|
+
case 'get':
|
|
25
|
+
return handleGet(input, response_format);
|
|
26
|
+
case 'find_endpoints':
|
|
27
|
+
return handleFindEndpoints(input, response_format);
|
|
28
|
+
case 'get_definition':
|
|
29
|
+
return handleGetDefinition(input, response_format);
|
|
30
|
+
case 'list_definitions':
|
|
31
|
+
return handleListDefinitions(input, response_format);
|
|
32
|
+
default:
|
|
33
|
+
throw new Error(`Unknown operation: ${operation}`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
// =============================================================================
|
|
37
|
+
// OPERATION HANDLERS
|
|
38
|
+
// =============================================================================
|
|
39
|
+
function handleSearch(input, format) {
|
|
40
|
+
const { query, limit = 20 } = input;
|
|
41
|
+
if (!query) {
|
|
42
|
+
throw new Error('query is required for search operation');
|
|
43
|
+
}
|
|
44
|
+
const results = searchApiSpecs(query, limit);
|
|
45
|
+
if (format === ResponseFormat.JSON) {
|
|
46
|
+
return JSON.stringify({
|
|
47
|
+
operation: 'search',
|
|
48
|
+
query,
|
|
49
|
+
results_count: results.length,
|
|
50
|
+
results: results.map((r) => ({
|
|
51
|
+
name: r.name,
|
|
52
|
+
type: r.type,
|
|
53
|
+
score: r.score,
|
|
54
|
+
snippet: r.snippet,
|
|
55
|
+
})),
|
|
56
|
+
}, null, 2);
|
|
57
|
+
}
|
|
58
|
+
// Markdown format
|
|
59
|
+
const lines = [
|
|
60
|
+
`# API Spec Search: "${query}"`,
|
|
61
|
+
'',
|
|
62
|
+
`**Found**: ${results.length} specification(s)`,
|
|
63
|
+
'',
|
|
64
|
+
];
|
|
65
|
+
if (results.length === 0) {
|
|
66
|
+
lines.push('No matching API specifications found.');
|
|
67
|
+
lines.push('');
|
|
68
|
+
lines.push('**Suggestions**:');
|
|
69
|
+
lines.push("- Try different search terms (e.g., 'http_loadbalancer', 'namespace', 'waf')");
|
|
70
|
+
lines.push("- Use `operation: 'get'` with a specific spec name");
|
|
71
|
+
return lines.join('\n');
|
|
72
|
+
}
|
|
73
|
+
for (const result of results) {
|
|
74
|
+
lines.push(`## ${result.name}`);
|
|
75
|
+
lines.push(`- **Type**: ${result.type}`);
|
|
76
|
+
lines.push(`- **Score**: ${result.score.toFixed(2)}`);
|
|
77
|
+
if (result.snippet) {
|
|
78
|
+
lines.push(`- **Info**: ${result.snippet.slice(0, 100)}...`);
|
|
79
|
+
}
|
|
80
|
+
lines.push('');
|
|
81
|
+
}
|
|
82
|
+
return lines.join('\n');
|
|
83
|
+
}
|
|
84
|
+
function handleGet(input, format) {
|
|
85
|
+
const name = input.name || input.spec_name;
|
|
86
|
+
const { include_paths = true, include_definitions = false } = input;
|
|
87
|
+
if (!name) {
|
|
88
|
+
throw new Error('name or spec_name is required for get operation');
|
|
89
|
+
}
|
|
90
|
+
const spec = getApiSpec(name);
|
|
91
|
+
if (!spec) {
|
|
92
|
+
const error = {
|
|
93
|
+
error: 'API specification not found',
|
|
94
|
+
name,
|
|
95
|
+
suggestion: "Use operation: 'search' to find available specifications",
|
|
96
|
+
};
|
|
97
|
+
return format === ResponseFormat.JSON
|
|
98
|
+
? JSON.stringify(error, null, 2)
|
|
99
|
+
: `# Error: API Specification Not Found\n\n**Name**: ${name}\n\nUse \`operation: 'search'\` to find available specifications.`;
|
|
100
|
+
}
|
|
101
|
+
const content = spec.content;
|
|
102
|
+
if (format === ResponseFormat.JSON) {
|
|
103
|
+
const result = {
|
|
104
|
+
operation: 'get',
|
|
105
|
+
name: spec.name,
|
|
106
|
+
schemaName: spec.schemaName,
|
|
107
|
+
info: content?.info,
|
|
108
|
+
};
|
|
109
|
+
if (include_paths && content?.paths) {
|
|
110
|
+
result.paths = Object.keys(content.paths).slice(0, 50);
|
|
111
|
+
result.paths_count = Object.keys(content.paths).length;
|
|
112
|
+
}
|
|
113
|
+
if (include_definitions && content?.definitions) {
|
|
114
|
+
result.definitions = Object.keys(content.definitions);
|
|
115
|
+
result.definitions_count = Object.keys(content.definitions).length;
|
|
116
|
+
}
|
|
117
|
+
return JSON.stringify(result, null, 2);
|
|
118
|
+
}
|
|
119
|
+
// Markdown format
|
|
120
|
+
const lines = [
|
|
121
|
+
`# API Specification: ${spec.schemaName}`,
|
|
122
|
+
'',
|
|
123
|
+
`**File**: ${spec.name}`,
|
|
124
|
+
'',
|
|
125
|
+
];
|
|
126
|
+
if (content?.info) {
|
|
127
|
+
lines.push('## Info');
|
|
128
|
+
if (content.info.title)
|
|
129
|
+
lines.push(`- **Title**: ${content.info.title}`);
|
|
130
|
+
if (content.info.version)
|
|
131
|
+
lines.push(`- **Version**: ${content.info.version}`);
|
|
132
|
+
if (content.info.description) {
|
|
133
|
+
lines.push(`- **Description**: ${content.info.description.slice(0, 200)}...`);
|
|
134
|
+
}
|
|
135
|
+
lines.push('');
|
|
136
|
+
}
|
|
137
|
+
if (include_paths && content?.paths) {
|
|
138
|
+
const pathKeys = Object.keys(content.paths);
|
|
139
|
+
lines.push(`## Endpoints (${pathKeys.length})`);
|
|
140
|
+
lines.push('');
|
|
141
|
+
for (const path of pathKeys.slice(0, 20)) {
|
|
142
|
+
const methods = Object.keys(content.paths[path]).filter((m) => ['get', 'post', 'put', 'delete', 'patch'].includes(m.toLowerCase()));
|
|
143
|
+
lines.push(`- \`${methods.join(', ').toUpperCase()}\` ${path}`);
|
|
144
|
+
}
|
|
145
|
+
if (pathKeys.length > 20) {
|
|
146
|
+
lines.push(`- *... and ${pathKeys.length - 20} more endpoints*`);
|
|
147
|
+
}
|
|
148
|
+
lines.push('');
|
|
149
|
+
}
|
|
150
|
+
if (include_definitions && content?.definitions) {
|
|
151
|
+
const defKeys = Object.keys(content.definitions);
|
|
152
|
+
lines.push(`## Definitions (${defKeys.length})`);
|
|
153
|
+
lines.push('');
|
|
154
|
+
for (const def of defKeys.slice(0, 30)) {
|
|
155
|
+
lines.push(`- ${def}`);
|
|
156
|
+
}
|
|
157
|
+
if (defKeys.length > 30) {
|
|
158
|
+
lines.push(`- *... and ${defKeys.length - 30} more definitions*`);
|
|
159
|
+
}
|
|
160
|
+
lines.push('');
|
|
161
|
+
}
|
|
162
|
+
return lines.join('\n');
|
|
163
|
+
}
|
|
164
|
+
function handleFindEndpoints(input, format) {
|
|
165
|
+
const { pattern, method, limit = 20 } = input;
|
|
166
|
+
if (!pattern) {
|
|
167
|
+
throw new Error('pattern is required for find_endpoints operation');
|
|
168
|
+
}
|
|
169
|
+
const results = findEndpoints(pattern, method, limit);
|
|
170
|
+
if (format === ResponseFormat.JSON) {
|
|
171
|
+
return JSON.stringify({
|
|
172
|
+
operation: 'find_endpoints',
|
|
173
|
+
pattern,
|
|
174
|
+
method: method || 'any',
|
|
175
|
+
results_count: results.length,
|
|
176
|
+
results,
|
|
177
|
+
}, null, 2);
|
|
178
|
+
}
|
|
179
|
+
// Markdown format
|
|
180
|
+
const lines = [
|
|
181
|
+
`# Endpoint Search: "${pattern}"`,
|
|
182
|
+
'',
|
|
183
|
+
method ? `**Method Filter**: ${method}` : '',
|
|
184
|
+
`**Found**: ${results.length} endpoint(s)`,
|
|
185
|
+
'',
|
|
186
|
+
];
|
|
187
|
+
if (results.length === 0) {
|
|
188
|
+
lines.push('No matching endpoints found.');
|
|
189
|
+
return lines.join('\n');
|
|
190
|
+
}
|
|
191
|
+
for (const result of results) {
|
|
192
|
+
lines.push(`## \`${result.method}\` ${result.path}`);
|
|
193
|
+
lines.push(`- **Spec**: ${result.specName}`);
|
|
194
|
+
if (result.summary) {
|
|
195
|
+
lines.push(`- **Summary**: ${result.summary}`);
|
|
196
|
+
}
|
|
197
|
+
lines.push('');
|
|
198
|
+
}
|
|
199
|
+
return lines.join('\n');
|
|
200
|
+
}
|
|
201
|
+
function handleGetDefinition(input, format) {
|
|
202
|
+
const { spec_name, definition_name } = input;
|
|
203
|
+
if (!spec_name) {
|
|
204
|
+
throw new Error('spec_name is required for get_definition operation');
|
|
205
|
+
}
|
|
206
|
+
if (!definition_name) {
|
|
207
|
+
throw new Error('definition_name is required for get_definition operation');
|
|
208
|
+
}
|
|
209
|
+
const definition = getSchemaDefinition(spec_name, definition_name);
|
|
210
|
+
if (!definition) {
|
|
211
|
+
const error = {
|
|
212
|
+
error: 'Schema definition not found',
|
|
213
|
+
spec_name,
|
|
214
|
+
definition_name,
|
|
215
|
+
suggestion: "Use operation: 'list_definitions' to see available definitions",
|
|
216
|
+
};
|
|
217
|
+
return format === ResponseFormat.JSON
|
|
218
|
+
? JSON.stringify(error, null, 2)
|
|
219
|
+
: `# Error: Schema Definition Not Found\n\n**Spec**: ${spec_name}\n**Definition**: ${definition_name}\n\nUse \`operation: 'list_definitions'\` to see available definitions.`;
|
|
220
|
+
}
|
|
221
|
+
if (format === ResponseFormat.JSON) {
|
|
222
|
+
return JSON.stringify({
|
|
223
|
+
operation: 'get_definition',
|
|
224
|
+
spec_name,
|
|
225
|
+
definition_name,
|
|
226
|
+
definition,
|
|
227
|
+
}, null, 2);
|
|
228
|
+
}
|
|
229
|
+
// Markdown format
|
|
230
|
+
const lines = [
|
|
231
|
+
`# Schema Definition: ${definition_name}`,
|
|
232
|
+
'',
|
|
233
|
+
`**Spec**: ${spec_name}`,
|
|
234
|
+
'',
|
|
235
|
+
'```json',
|
|
236
|
+
JSON.stringify(definition, null, 2),
|
|
237
|
+
'```',
|
|
238
|
+
];
|
|
239
|
+
return lines.join('\n');
|
|
240
|
+
}
|
|
241
|
+
function handleListDefinitions(input, format) {
|
|
242
|
+
const { spec_name } = input;
|
|
243
|
+
if (!spec_name) {
|
|
244
|
+
throw new Error('spec_name is required for list_definitions operation');
|
|
245
|
+
}
|
|
246
|
+
const definitions = listDefinitions(spec_name);
|
|
247
|
+
if (format === ResponseFormat.JSON) {
|
|
248
|
+
return JSON.stringify({
|
|
249
|
+
operation: 'list_definitions',
|
|
250
|
+
spec_name,
|
|
251
|
+
count: definitions.length,
|
|
252
|
+
definitions,
|
|
253
|
+
}, null, 2);
|
|
254
|
+
}
|
|
255
|
+
// Markdown format
|
|
256
|
+
const lines = [
|
|
257
|
+
`# Schema Definitions: ${spec_name}`,
|
|
258
|
+
'',
|
|
259
|
+
`**Total**: ${definitions.length} definition(s)`,
|
|
260
|
+
'',
|
|
261
|
+
];
|
|
262
|
+
if (definitions.length === 0) {
|
|
263
|
+
lines.push('No definitions found in this specification.');
|
|
264
|
+
return lines.join('\n');
|
|
265
|
+
}
|
|
266
|
+
for (const def of definitions.slice(0, 50)) {
|
|
267
|
+
lines.push(`- ${def}`);
|
|
268
|
+
}
|
|
269
|
+
if (definitions.length > 50) {
|
|
270
|
+
lines.push(`- *... and ${definitions.length - 50} more definitions*`);
|
|
271
|
+
}
|
|
272
|
+
return lines.join('\n');
|
|
273
|
+
}
|
|
274
|
+
// =============================================================================
|
|
275
|
+
// TOOL DEFINITION
|
|
276
|
+
// =============================================================================
|
|
277
|
+
export const API_TOOL_DEFINITION = {
|
|
278
|
+
name: 'f5xc_terraform_api',
|
|
279
|
+
description: 'Query 270+ F5XC OpenAPI specs - search, get, find endpoints, schema definitions',
|
|
280
|
+
};
|
|
281
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/tools/api.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EACL,cAAc,EACd,UAAU,EACV,a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AC;QAC7B,KAAK,CAAC,IAAI,CAAC,6CAA6C,CAAC,CAAC;QAC1D,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED,KAAK,MAAM,GAAG,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;QAC3C,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC;IACzB,CAAC;IAED,IAAI,WAAW,CAAC,MAAM,GAAG,EAAE,EAAE,CAAC;QAC5B,KAAK,CAAC,IAAI,CAAC,cAAc,WAAW,CAAC,MAAM,GAAG,EAAE,oBAAoB,CAAC,CAAC;IACxE,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,gFAAgF;AAChF,kBAAkB;AAClB,gFAAgF;AAEhF,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,iFAAiF;CAC/F,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Discovery Meta-Tool Handler
|
|
3
|
+
*
|
|
4
|
+
* Enables lazy loading of tool schemas for token efficiency.
|
|
5
|
+
* AI assistants can discover available tools without loading full schemas.
|
|
6
|
+
*
|
|
7
|
+
* Tool: f5xc_terraform_discover
|
|
8
|
+
*/
|
|
9
|
+
import { DiscoverInput } from '../schemas/common.js';
|
|
10
|
+
/**
|
|
11
|
+
* Handles the f5xc_terraform_discover tool invocation
|
|
12
|
+
*/
|
|
13
|
+
export declare function handleDiscover(input: DiscoverInput): Promise<string>;
|
|
14
|
+
export declare const DISCOVER_TOOL_DEFINITION: {
|
|
15
|
+
name: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=discover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discover.d.ts","sourceRoot":"","sources":["../../src/tools/discover.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAmDrD;;GAEG;AACH,wBAAsB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAY1E;AA0KD,eAAO,MAAM,wBAAwB;;;CAGpC,CAAC"}
|