@tunnelhub/mcp 1.0.3 → 1.0.5
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 +56 -1
- package/dist/auth/cognito-client.d.ts +0 -4
- package/dist/auth/cognito-client.d.ts.map +1 -1
- package/dist/auth/cognito-client.js +0 -30
- package/dist/auth/cognito-client.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +10 -1
- package/dist/server.js.map +1 -1
- package/dist/tools/api-gateway/index.d.ts +1 -1
- package/dist/tools/api-gateway/index.d.ts.map +1 -1
- package/dist/tools/api-gateway/index.js +449 -7
- package/dist/tools/api-gateway/index.js.map +1 -1
- package/dist/tools/data-stores/index.d.ts +3 -0
- package/dist/tools/data-stores/index.d.ts.map +1 -0
- package/dist/tools/data-stores/index.js +171 -0
- package/dist/tools/data-stores/index.js.map +1 -0
- package/dist/tools/packages/index.d.ts +1 -1
- package/dist/tools/packages/index.d.ts.map +1 -1
- package/dist/tools/packages/index.js +91 -5
- package/dist/tools/packages/index.js.map +1 -1
- package/dist/tools/systems/index.d.ts +3 -0
- package/dist/tools/systems/index.d.ts.map +1 -0
- package/dist/tools/systems/index.js +96 -0
- package/dist/tools/systems/index.js.map +1 -0
- package/dist/types/api.d.ts +168 -0
- package/dist/types/api.d.ts.map +1 -1
- package/dist/types/mcp.d.ts +319 -1
- package/dist/types/mcp.d.ts.map +1 -1
- package/dist/types/mcp.js +93 -1
- package/dist/types/mcp.js.map +1 -1
- package/dist/utils/api-client.d.ts +44 -1
- package/dist/utils/api-client.d.ts.map +1 -1
- package/dist/utils/api-client.js +224 -0
- package/dist/utils/api-client.js.map +1 -1
- package/package.json +3 -5
- package/dist/types/dynamodb.d.ts +0 -54
- package/dist/types/dynamodb.d.ts.map +0 -1
- package/dist/types/dynamodb.js +0 -55
- package/dist/types/dynamodb.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# TunnelHub MCP
|
|
2
2
|
|
|
3
|
-
Conecte clientes MCP ao TunnelHub para investigar automações, execuções, logs e
|
|
3
|
+
Conecte clientes MCP ao TunnelHub para investigar automações, execuções, logs, traces, API Gateway, sistemas e pacotes usando o mesmo fluxo de autenticação do frontend.
|
|
4
4
|
|
|
5
5
|
Este MCP é especialmente útil para:
|
|
6
6
|
|
|
@@ -15,6 +15,10 @@ Este MCP é especialmente útil para:
|
|
|
15
15
|
- Autenticar no TunnelHub pelo navegador
|
|
16
16
|
- Listar ambientes disponíveis
|
|
17
17
|
- Listar e inspecionar automações
|
|
18
|
+
- Consultar sistemas do ambiente atual
|
|
19
|
+
- Consultar pacotes do ambiente atual
|
|
20
|
+
- Consultar tabelas de de/para do ambiente atual
|
|
21
|
+
- Consultar APIs, clients, usage plans, API keys e logs do API Gateway
|
|
18
22
|
- Localizar execuções por intervalo de tempo
|
|
19
23
|
- Resumir uma execução completa
|
|
20
24
|
- Consultar logs e traces de uma execução
|
|
@@ -224,6 +228,23 @@ Você pode pedir coisas como:
|
|
|
224
228
|
- `Qual sessão está ativa?`
|
|
225
229
|
- `Liste os ambientes disponíveis`
|
|
226
230
|
- `Liste as automações ativas`
|
|
231
|
+
- `Liste os sistemas HTTP do ambiente atual`
|
|
232
|
+
- `Mostre o system 1234`
|
|
233
|
+
- `Liste os pacotes do ambiente atual`
|
|
234
|
+
- `Mostre o package abc`
|
|
235
|
+
- `Liste as APIs do API Gateway`
|
|
236
|
+
- `Mostre a API 123abc`
|
|
237
|
+
- `Liste os clients de autenticacao`
|
|
238
|
+
- `Mostre o client xyz`
|
|
239
|
+
- `Liste os usage plans`
|
|
240
|
+
- `Liste as API keys`
|
|
241
|
+
- `Liste os logs da API 123abc`
|
|
242
|
+
- `Mostre o log 9988 da API 123abc no timestamp 1710345600`
|
|
243
|
+
- `Liste os logs globais do API Gateway no dia 2026-03-13`
|
|
244
|
+
- `Liste as tabelas de de/para do ambiente atual`
|
|
245
|
+
- `Busque a tabela de de/para CFOP`
|
|
246
|
+
- `Liste os itens da tabela de de/para 1234`
|
|
247
|
+
- `Me mostre o item abc da tabela de de/para 1234`
|
|
227
248
|
- `Ache a execução 9b696080439f no dia 2026-03-13`
|
|
228
249
|
- `Resuma a execução 019ce7f3-2707-740c-8692-9b696080439f`
|
|
229
250
|
- `Me mostre os traces com ERROR dessa execução`
|
|
@@ -248,6 +269,36 @@ Você pode pedir coisas como:
|
|
|
248
269
|
- `list_tenants_tunnelhub`
|
|
249
270
|
- `get_tenant_tunnelhub`
|
|
250
271
|
|
|
272
|
+
### Tabelas de de/para
|
|
273
|
+
|
|
274
|
+
- `list_data_stores_tunnelhub`
|
|
275
|
+
- `get_data_store_tunnelhub`
|
|
276
|
+
- `list_data_store_items_tunnelhub`
|
|
277
|
+
- `get_data_store_item_tunnelhub`
|
|
278
|
+
|
|
279
|
+
### API Gateway
|
|
280
|
+
|
|
281
|
+
- `list_api_gateways_tunnelhub`
|
|
282
|
+
- `get_api_gateway_tunnelhub`
|
|
283
|
+
- `list_api_keys_tunnelhub`
|
|
284
|
+
- `list_usage_plans_tunnelhub`
|
|
285
|
+
- `list_auth_clients_tunnelhub`
|
|
286
|
+
- `get_auth_client_tunnelhub`
|
|
287
|
+
- `list_auth_resource_servers_tunnelhub`
|
|
288
|
+
- `list_api_gateway_logs_tunnelhub`
|
|
289
|
+
- `get_api_gateway_log_tunnelhub`
|
|
290
|
+
- `list_all_api_gateway_logs_tunnelhub`
|
|
291
|
+
|
|
292
|
+
### Sistemas
|
|
293
|
+
|
|
294
|
+
- `list_systems_tunnelhub`
|
|
295
|
+
- `get_system_tunnelhub`
|
|
296
|
+
|
|
297
|
+
### Pacotes
|
|
298
|
+
|
|
299
|
+
- `list_packages_tunnelhub`
|
|
300
|
+
- `get_package_tunnelhub`
|
|
301
|
+
|
|
251
302
|
### Automações
|
|
252
303
|
|
|
253
304
|
- `list_automations_tunnelhub`
|
|
@@ -289,6 +340,10 @@ Observações:
|
|
|
289
340
|
## ⚠️ Limitações atuais
|
|
290
341
|
|
|
291
342
|
- O foco atual está em automações e monitoramento
|
|
343
|
+
- API Gateway está disponível em modo somente leitura
|
|
344
|
+
- Sistemas e pacotes estão disponíveis em modo somente leitura
|
|
345
|
+
- Tabelas de de/para estão disponíveis em modo somente leitura
|
|
346
|
+
- API keys e logs podem incluir dados sensíveis retornados pelo backend
|
|
292
347
|
- Algumas APIs do backend têm comportamentos específicos de filtro e paginação
|
|
293
348
|
- A listagem de execuções depende de intervalo de tempo obrigatório
|
|
294
349
|
|
|
@@ -6,9 +6,5 @@ export declare class CognitoClient {
|
|
|
6
6
|
* Refresh tokens using refresh token
|
|
7
7
|
*/
|
|
8
8
|
refreshTokens(clientId: string, refreshToken: string): Promise<BrowserAuthTokens>;
|
|
9
|
-
/**
|
|
10
|
-
* Initiate password auth (for future use if needed)
|
|
11
|
-
*/
|
|
12
|
-
authenticateWithPassword(clientId: string, username: string, password: string): Promise<BrowserAuthTokens>;
|
|
13
9
|
}
|
|
14
10
|
//# sourceMappingURL=cognito-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cognito-client.d.ts","sourceRoot":"","sources":["../../src/auth/cognito-client.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAgC;;IAQ9C;;OAEG;IACG,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"cognito-client.d.ts","sourceRoot":"","sources":["../../src/auth/cognito-client.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAgC;;IAQ9C;;OAEG;IACG,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;CA4BxF"}
|
|
@@ -35,35 +35,5 @@ export class CognitoClient {
|
|
|
35
35
|
throw error;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
/**
|
|
39
|
-
* Initiate password auth (for future use if needed)
|
|
40
|
-
*/
|
|
41
|
-
async authenticateWithPassword(clientId, username, password) {
|
|
42
|
-
const input = {
|
|
43
|
-
AuthFlow: 'USER_PASSWORD_AUTH',
|
|
44
|
-
ClientId: clientId,
|
|
45
|
-
AuthParameters: {
|
|
46
|
-
USERNAME: username,
|
|
47
|
-
PASSWORD: password,
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
try {
|
|
51
|
-
const command = new InitiateAuthCommand(input);
|
|
52
|
-
const response = await this.client.send(command);
|
|
53
|
-
if (!response.AuthenticationResult) {
|
|
54
|
-
throw new Error('No authentication result received');
|
|
55
|
-
}
|
|
56
|
-
return {
|
|
57
|
-
idToken: response.AuthenticationResult.IdToken,
|
|
58
|
-
accessToken: response.AuthenticationResult.AccessToken,
|
|
59
|
-
refreshToken: response.AuthenticationResult.RefreshToken,
|
|
60
|
-
expiresIn: response.AuthenticationResult.ExpiresIn,
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
catch (error) {
|
|
64
|
-
console.error('Failed to authenticate:', error);
|
|
65
|
-
throw error;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
38
|
}
|
|
69
39
|
//# sourceMappingURL=cognito-client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cognito-client.js","sourceRoot":"","sources":["../../src/auth/cognito-client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,mBAAmB,GAEpB,MAAM,2CAA2C,CAAC;AAGnD,MAAM,OAAO,aAAa;IAChB,MAAM,CAAgC;IAE9C;QACE,IAAI,CAAC,MAAM,GAAG,IAAI,6BAA6B,CAAC;YAC9C,MAAM,EAAE,WAAW;SACpB,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,aAAa,CAAC,QAAgB,EAAE,YAAoB;QACxD,MAAM,KAAK,GAA6B;YACtC,QAAQ,EAAE,oBAAoB;YAC9B,QAAQ,EAAE,QAAQ;YAClB,cAAc,EAAE;gBACd,aAAa,EAAE,YAAY;aAC5B;SACF,CAAC;QAEF,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,IAAI,mBAAmB,CAAC,KAAK,CAAC,CAAC;YAC/C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAEjD,IAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE,CAAC;gBACnC,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;YACvD,CAAC;YAED,OAAO;gBACL,OAAO,EAAE,QAAQ,CAAC,oBAAoB,CAAC,OAAQ;gBAC/C,WAAW,EAAE,QAAQ,CAAC,oBAAoB,CAAC,WAAY;gBACvD,YAAY,EAAE,YAAY,EAAE,+BAA+B;gBAC3D,SAAS,EAAE,QAAQ,CAAC,oBAAoB,CAAC,SAAU;aACpD,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;YAClD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;
|
|
1
|
+
{"version":3,"file":"cognito-client.js","sourceRoot":"","sources":["../../src/auth/cognito-client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,mBAAmB,GAEpB,MAAM,2CAA2C,CAAC;AAGnD,MAAM,OAAO,aAAa;IAChB,MAAM,CAAgC;IAE9C;QACE,IAAI,CAAC,MAAM,GAAG,IAAI,6BAA6B,CAAC;YAC9C,MAAM,EAAE,WAAW;SACpB,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,aAAa,CAAC,QAAgB,EAAE,YAAoB;QACxD,MAAM,KAAK,GAA6B;YACtC,QAAQ,EAAE,oBAAoB;YAC9B,QAAQ,EAAE,QAAQ;YAClB,cAAc,EAAE;gBACd,aAAa,EAAE,YAAY;aAC5B;SACF,CAAC;QAEF,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,IAAI,mBAAmB,CAAC,KAAK,CAAC,CAAC;YAC/C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAEjD,IAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE,CAAC;gBACnC,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;YACvD,CAAC;YAED,OAAO;gBACL,OAAO,EAAE,QAAQ,CAAC,oBAAoB,CAAC,OAAQ;gBAC/C,WAAW,EAAE,QAAQ,CAAC,oBAAoB,CAAC,WAAY;gBACvD,YAAY,EAAE,YAAY,EAAE,+BAA+B;gBAC3D,SAAS,EAAE,QAAQ,CAAC,oBAAoB,CAAC,SAAU;aACpD,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;YAClD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF"}
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAepE,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAY;IAEnC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;IAEhD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;;IAYtC,OAAO,CAAC,WAAW;IAyBnB,SAAS,IAAI,SAAS;CAGvB;;AAID,wBAA2C"}
|
package/dist/server.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import packageJson from '../package.json' with { type: 'json' };
|
|
2
3
|
import { SessionManager } from './auth/session-manager.js';
|
|
4
|
+
import { registerApiGatewayTools } from './tools/api-gateway/index.js';
|
|
5
|
+
import { registerDataStoreTools } from './tools/data-stores/index.js';
|
|
3
6
|
import { registerAutomationTools } from './tools/automations/index.js';
|
|
4
7
|
import { registerMonitoringTools } from './tools/monitoring/index.js';
|
|
8
|
+
import { registerPackageTools } from './tools/packages/index.js';
|
|
5
9
|
import { registerSessionTools } from './tools/session/index.js';
|
|
10
|
+
import { registerSystemTools } from './tools/systems/index.js';
|
|
6
11
|
import { registerTenantTools } from './tools/tenants/index.js';
|
|
7
12
|
import { ApiClient } from './utils/api-client.js';
|
|
8
13
|
import { MCPError } from './utils/error-handler.js';
|
|
@@ -13,7 +18,7 @@ export class TunnelHubMCPServer {
|
|
|
13
18
|
constructor() {
|
|
14
19
|
this.server = new McpServer({
|
|
15
20
|
name: 'tunnelhub-mcp-server',
|
|
16
|
-
version:
|
|
21
|
+
version: packageJson.version,
|
|
17
22
|
});
|
|
18
23
|
this.sessionManager = new SessionManager();
|
|
19
24
|
this.apiClient = new ApiClient();
|
|
@@ -34,6 +39,10 @@ export class TunnelHubMCPServer {
|
|
|
34
39
|
};
|
|
35
40
|
registerSessionTools(this.server, context);
|
|
36
41
|
registerTenantTools(this.server, context);
|
|
42
|
+
registerPackageTools(this.server, context);
|
|
43
|
+
registerSystemTools(this.server, context);
|
|
44
|
+
registerApiGatewayTools(this.server, context);
|
|
45
|
+
registerDataStoreTools(this.server, context);
|
|
37
46
|
registerAutomationTools(this.server, context);
|
|
38
47
|
registerMonitoringTools(this.server, context);
|
|
39
48
|
}
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,MAAM,OAAO,kBAAkB;IACZ,MAAM,CAAY;IAElB,cAAc,CAAiB;IAE/B,SAAS,CAAY;IAEtC;QACE,IAAI,CAAC,MAAM,GAAG,IAAI,SAAS,CAAC;YAC1B,IAAI,EAAE,sBAAsB;YAC5B,OAAO,EAAE,OAAO;
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,WAAW,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,MAAM,OAAO,kBAAkB;IACZ,MAAM,CAAY;IAElB,cAAc,CAAiB;IAE/B,SAAS,CAAY;IAEtC;QACE,IAAI,CAAC,MAAM,GAAG,IAAI,SAAS,CAAC;YAC1B,IAAI,EAAE,sBAAsB;YAC5B,OAAO,EAAE,WAAW,CAAC,OAAO;SAC7B,CAAC,CAAC;QACH,IAAI,CAAC,cAAc,GAAG,IAAI,cAAc,EAAE,CAAC;QAC3C,IAAI,CAAC,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC;QACjC,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAEO,WAAW;QACjB,MAAM,OAAO,GAAgB;YAC3B,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,UAAU,EAAE,KAAK,IAAI,EAAE;gBACrB,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,iBAAiB,EAAE,CAAC;gBAClE,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,CAAC;oBAC1B,MAAM,IAAI,QAAQ,CAAC,+CAA+C,EAAE,eAAe,CAAC,CAAC;gBACvF,CAAC;gBAED,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;gBAC/C,OAAO,WAAW,CAAC,OAAO,CAAC;YAC7B,CAAC;SACF,CAAC;QAEF,oBAAoB,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC3C,mBAAmB,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC1C,oBAAoB,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC3C,mBAAmB,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC1C,uBAAuB,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC9C,sBAAsB,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC7C,uBAAuB,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC9C,uBAAuB,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChD,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF;AAED,MAAM,eAAe,GAAG,IAAI,kBAAkB,EAAE,CAAC;AAEjD,eAAe,eAAe,CAAC,SAAS,EAAE,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
export declare function registerApiGatewayTools(
|
|
2
|
+
export declare function registerApiGatewayTools(server: McpServer, context: unknown): void;
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/api-gateway/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/api-gateway/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAsgBzE,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAajF"}
|
|
@@ -1,9 +1,451 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import LZString from 'lz-string';
|
|
2
|
+
import { ApiGatewayAllLogsParamsSchema, ApiGatewayIdParamsSchema, ApiGatewayListParamsSchema, ApiGatewayLogIdParamsSchema, ApiGatewayLogListParamsSchema, ApiKeyListParamsSchema, AuthClientIdParamsSchema, AuthClientListParamsSchema, AuthResourceServerListParamsSchema, UsagePlanListParamsSchema, } from '../../types/mcp.js';
|
|
3
|
+
import { errorResult, requireSession, textResult } from '../../utils/error-handler.js';
|
|
4
|
+
function extractItems(response) {
|
|
5
|
+
if (Array.isArray(response)) {
|
|
6
|
+
return response;
|
|
7
|
+
}
|
|
8
|
+
if (response && typeof response === 'object' && Array.isArray(response.data)) {
|
|
9
|
+
return response.data || [];
|
|
10
|
+
}
|
|
11
|
+
return [];
|
|
12
|
+
}
|
|
13
|
+
function summarizeApiGateway(item) {
|
|
14
|
+
return [
|
|
15
|
+
`API Gateway ID: ${item.id}`,
|
|
16
|
+
`Name: ${item.name || 'n/a'}`,
|
|
17
|
+
`Type: ${item.type || 'n/a'}`,
|
|
18
|
+
`Package: ${item.packageId || 'n/a'}`,
|
|
19
|
+
`Description: ${item.description || 'n/a'}`,
|
|
20
|
+
`Repository URL: ${item.repositoryUrl || 'n/a'}`,
|
|
21
|
+
`Stages: ${item.stages?.length ?? 0}`,
|
|
22
|
+
`Usage Plans: ${item.usagePlans?.length ?? 0}`,
|
|
23
|
+
`Created At: ${item.createdAt || 'n/a'}`,
|
|
24
|
+
`Updated At: ${item.updatedAt || 'n/a'}`,
|
|
25
|
+
].join('\n');
|
|
26
|
+
}
|
|
27
|
+
function summarizeApiGatewayList(items) {
|
|
28
|
+
if (items.length === 0) {
|
|
29
|
+
return 'No API Gateways found.';
|
|
30
|
+
}
|
|
31
|
+
return items
|
|
32
|
+
.slice(0, 15)
|
|
33
|
+
.map((item) => `${item.name || item.id} | ${item.type || 'n/a'} | package=${item.packageId || 'n/a'} | ${item.id}`)
|
|
34
|
+
.join('\n');
|
|
35
|
+
}
|
|
36
|
+
function summarizeApiKeyList(items) {
|
|
37
|
+
if (items.length === 0) {
|
|
38
|
+
return 'No API keys found.';
|
|
39
|
+
}
|
|
40
|
+
return items
|
|
41
|
+
.slice(0, 15)
|
|
42
|
+
.map((item) => `${item.name || item.id || 'n/a'} | enabled=${String(item.enabled ?? 'n/a')} | ${item.id || 'n/a'}`)
|
|
43
|
+
.join('\n');
|
|
44
|
+
}
|
|
45
|
+
function summarizeUsagePlanList(items) {
|
|
46
|
+
if (items.length === 0) {
|
|
47
|
+
return 'No usage plans found.';
|
|
48
|
+
}
|
|
49
|
+
return items
|
|
50
|
+
.slice(0, 15)
|
|
51
|
+
.map((item) => `${item.name || item.id || 'n/a'} | ${item.description || 'n/a'} | keys=${item.apiKeys?.length ?? 0}`)
|
|
52
|
+
.join('\n');
|
|
53
|
+
}
|
|
54
|
+
function summarizeAuthClient(item) {
|
|
55
|
+
return [
|
|
56
|
+
`Client ID: ${item.clientId}`,
|
|
57
|
+
`Description: ${item.description || 'n/a'}`,
|
|
58
|
+
`Status: ${item.status || 'n/a'}`,
|
|
59
|
+
`Allowed Scopes: ${item.allowedScopes?.join(', ') || 'n/a'}`,
|
|
60
|
+
`Access Token Validity: ${String(item.accessTokenValidity ?? 'n/a')}`,
|
|
61
|
+
`ID Token Validity: ${String(item.idTokenValidity ?? 'n/a')}`,
|
|
62
|
+
`Refresh Token Validity: ${String(item.refreshTokenValidity ?? 'n/a')}`,
|
|
63
|
+
`Issue Refresh Token: ${String(item.issueRefreshToken ?? 'n/a')}`,
|
|
64
|
+
`Created At: ${item.createdAt || 'n/a'}`,
|
|
65
|
+
].join('\n');
|
|
66
|
+
}
|
|
67
|
+
function summarizeAuthClientList(items) {
|
|
68
|
+
if (items.length === 0) {
|
|
69
|
+
return 'No auth clients found.';
|
|
70
|
+
}
|
|
71
|
+
return items
|
|
72
|
+
.slice(0, 15)
|
|
73
|
+
.map((item) => `${item.description || item.clientId} | ${item.status || 'n/a'} | ${item.clientId}`)
|
|
74
|
+
.join('\n');
|
|
75
|
+
}
|
|
76
|
+
function summarizeAuthResourceServerList(items) {
|
|
77
|
+
if (items.length === 0) {
|
|
78
|
+
return 'No auth resource servers found.';
|
|
79
|
+
}
|
|
80
|
+
return items
|
|
81
|
+
.slice(0, 15)
|
|
82
|
+
.map((item) => `${item.Name || item.Identifier || 'n/a'} | scopes=${item.Scopes?.length ?? 0} | ${item.Identifier || 'n/a'}`)
|
|
83
|
+
.join('\n');
|
|
84
|
+
}
|
|
85
|
+
function summarizeApiGatewayLog(item) {
|
|
86
|
+
return [
|
|
87
|
+
`Log ID: ${item.uuid}`,
|
|
88
|
+
`API Gateway ID: ${item.apiId}`,
|
|
89
|
+
`Status: ${item.status || 'n/a'}`,
|
|
90
|
+
`HTTP Method: ${item.httpMethod || 'n/a'}`,
|
|
91
|
+
`Path: ${item.path || 'n/a'}`,
|
|
92
|
+
`Resource: ${item.resource || 'n/a'}`,
|
|
93
|
+
`Source IP: ${item.sourceIp || 'n/a'}`,
|
|
94
|
+
`Created At: ${item.createdAt || 'n/a'}`,
|
|
95
|
+
`Start Time: ${item.startTime || 'n/a'}`,
|
|
96
|
+
`End Time: ${item.endTime || 'n/a'}`,
|
|
97
|
+
`HTTP Status Code: ${String(item.rawResponse?.statusCode ?? 'n/a')}`,
|
|
98
|
+
].join('\n');
|
|
99
|
+
}
|
|
100
|
+
function summarizeApiGatewayLogList(items) {
|
|
101
|
+
if (items.length === 0) {
|
|
102
|
+
return 'No API Gateway logs found.';
|
|
103
|
+
}
|
|
104
|
+
return items
|
|
105
|
+
.slice(0, 15)
|
|
106
|
+
.map((item) => `${item.uuid} | ${item.status || 'n/a'} | ${item.httpMethod || 'n/a'} ${item.path || item.resource || 'n/a'} | ${item.createdAt || 'n/a'}`)
|
|
107
|
+
.join('\n');
|
|
108
|
+
}
|
|
109
|
+
function decodeCompressedPayload(payload) {
|
|
110
|
+
if (!payload) {
|
|
111
|
+
return undefined;
|
|
112
|
+
}
|
|
113
|
+
const decompressed = LZString.decompressFromUTF16(payload);
|
|
114
|
+
if (!decompressed || decompressed === 'null') {
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
try {
|
|
118
|
+
return JSON.parse(JSON.parse(decompressed));
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
try {
|
|
122
|
+
return JSON.parse(decompressed);
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
return decompressed;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
function stringifyPayload(payload) {
|
|
130
|
+
if (payload === undefined) {
|
|
131
|
+
return 'n/a';
|
|
132
|
+
}
|
|
133
|
+
if (typeof payload === 'string') {
|
|
134
|
+
return payload;
|
|
135
|
+
}
|
|
136
|
+
try {
|
|
137
|
+
return JSON.stringify(payload, null, 2);
|
|
138
|
+
}
|
|
139
|
+
catch {
|
|
140
|
+
return String(payload);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
const listApiGatewaysTool = {
|
|
144
|
+
name: 'list_api_gateways_tunnelhub',
|
|
145
|
+
schema: {
|
|
146
|
+
title: 'List API Gateways',
|
|
147
|
+
description: 'List API Gateway definitions from api-gateway-service using the current environment.',
|
|
148
|
+
inputSchema: ApiGatewayListParamsSchema,
|
|
149
|
+
annotations: {
|
|
150
|
+
readOnlyHint: true,
|
|
151
|
+
destructiveHint: false,
|
|
152
|
+
idempotentHint: true,
|
|
153
|
+
openWorldHint: false,
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
handler: async (params, context) => {
|
|
157
|
+
try {
|
|
158
|
+
const session = await requireSession(context);
|
|
159
|
+
context.apiClient.setSession(session);
|
|
160
|
+
const apiClient = context.apiClient;
|
|
161
|
+
const response = await apiClient.listApiGateways(params);
|
|
162
|
+
const items = extractItems(response);
|
|
163
|
+
return textResult(`API Gateways:\n\n${summarizeApiGatewayList(items)}\n\nReturned: ${items.length}`, {
|
|
164
|
+
apiGateways: items,
|
|
165
|
+
rawResponse: response,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
catch (error) {
|
|
169
|
+
return errorResult(error);
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
const getApiGatewayTool = {
|
|
174
|
+
name: 'get_api_gateway_tunnelhub',
|
|
175
|
+
schema: {
|
|
176
|
+
title: 'Get API Gateway',
|
|
177
|
+
description: 'Get read-only details for one API Gateway by id.',
|
|
178
|
+
inputSchema: ApiGatewayIdParamsSchema,
|
|
179
|
+
annotations: {
|
|
180
|
+
readOnlyHint: true,
|
|
181
|
+
destructiveHint: false,
|
|
182
|
+
idempotentHint: true,
|
|
183
|
+
openWorldHint: false,
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
handler: async (params, context) => {
|
|
187
|
+
try {
|
|
188
|
+
const session = await requireSession(context);
|
|
189
|
+
context.apiClient.setSession(session);
|
|
190
|
+
const apiClient = context.apiClient;
|
|
191
|
+
const item = await apiClient.getApiGateway(params.apiGatewayId);
|
|
192
|
+
return textResult(`API Gateway details:\n\n${summarizeApiGateway(item)}`, item);
|
|
193
|
+
}
|
|
194
|
+
catch (error) {
|
|
195
|
+
return errorResult(error);
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
};
|
|
199
|
+
const listApiKeysTool = {
|
|
200
|
+
name: 'list_api_keys_tunnelhub',
|
|
201
|
+
schema: {
|
|
202
|
+
title: 'List API Keys',
|
|
203
|
+
description: 'List API keys from api-gateway-service using the current environment. Sensitive values may be included by backend.',
|
|
204
|
+
inputSchema: ApiKeyListParamsSchema,
|
|
205
|
+
annotations: {
|
|
206
|
+
readOnlyHint: true,
|
|
207
|
+
destructiveHint: false,
|
|
208
|
+
idempotentHint: true,
|
|
209
|
+
openWorldHint: false,
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
handler: async (params, context) => {
|
|
213
|
+
try {
|
|
214
|
+
const session = await requireSession(context);
|
|
215
|
+
context.apiClient.setSession(session);
|
|
216
|
+
const apiClient = context.apiClient;
|
|
217
|
+
const response = await apiClient.listApiKeys(params);
|
|
218
|
+
const items = extractItems(response);
|
|
219
|
+
return textResult(`API Keys:\n\n${summarizeApiKeyList(items)}\n\nReturned: ${items.length}\nNote: backend responses may include actual API key values.`, {
|
|
220
|
+
apiKeys: items,
|
|
221
|
+
rawResponse: response,
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
catch (error) {
|
|
225
|
+
return errorResult(error);
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
};
|
|
229
|
+
const listUsagePlansTool = {
|
|
230
|
+
name: 'list_usage_plans_tunnelhub',
|
|
231
|
+
schema: {
|
|
232
|
+
title: 'List Usage Plans',
|
|
233
|
+
description: 'List API Gateway usage plans from api-gateway-service using the current environment.',
|
|
234
|
+
inputSchema: UsagePlanListParamsSchema,
|
|
235
|
+
annotations: {
|
|
236
|
+
readOnlyHint: true,
|
|
237
|
+
destructiveHint: false,
|
|
238
|
+
idempotentHint: true,
|
|
239
|
+
openWorldHint: false,
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
handler: async (params, context) => {
|
|
243
|
+
try {
|
|
244
|
+
const session = await requireSession(context);
|
|
245
|
+
context.apiClient.setSession(session);
|
|
246
|
+
const apiClient = context.apiClient;
|
|
247
|
+
const response = await apiClient.listUsagePlans(params);
|
|
248
|
+
const items = extractItems(response);
|
|
249
|
+
return textResult(`Usage Plans:\n\n${summarizeUsagePlanList(items)}\n\nReturned: ${items.length}`, {
|
|
250
|
+
usagePlans: items,
|
|
251
|
+
rawResponse: response,
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
catch (error) {
|
|
255
|
+
return errorResult(error);
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
};
|
|
259
|
+
const listAuthClientsTool = {
|
|
260
|
+
name: 'list_auth_clients_tunnelhub',
|
|
261
|
+
schema: {
|
|
262
|
+
title: 'List Auth Clients',
|
|
263
|
+
description: 'List API auth clients from api-gateway-service using the current environment.',
|
|
264
|
+
inputSchema: AuthClientListParamsSchema,
|
|
265
|
+
annotations: {
|
|
266
|
+
readOnlyHint: true,
|
|
267
|
+
destructiveHint: false,
|
|
268
|
+
idempotentHint: true,
|
|
269
|
+
openWorldHint: false,
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
handler: async (params, context) => {
|
|
273
|
+
try {
|
|
274
|
+
const session = await requireSession(context);
|
|
275
|
+
context.apiClient.setSession(session);
|
|
276
|
+
const apiClient = context.apiClient;
|
|
277
|
+
const response = await apiClient.listAuthClients(params);
|
|
278
|
+
const items = extractItems(response);
|
|
279
|
+
return textResult(`Auth clients:\n\n${summarizeAuthClientList(items)}\n\nReturned: ${items.length}`, {
|
|
280
|
+
authClients: items,
|
|
281
|
+
rawResponse: response,
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
catch (error) {
|
|
285
|
+
return errorResult(error);
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
};
|
|
289
|
+
const getAuthClientTool = {
|
|
290
|
+
name: 'get_auth_client_tunnelhub',
|
|
291
|
+
schema: {
|
|
292
|
+
title: 'Get Auth Client',
|
|
293
|
+
description: 'Get read-only details for one API auth client by client id.',
|
|
294
|
+
inputSchema: AuthClientIdParamsSchema,
|
|
295
|
+
annotations: {
|
|
296
|
+
readOnlyHint: true,
|
|
297
|
+
destructiveHint: false,
|
|
298
|
+
idempotentHint: true,
|
|
299
|
+
openWorldHint: false,
|
|
300
|
+
},
|
|
301
|
+
},
|
|
302
|
+
handler: async (params, context) => {
|
|
303
|
+
try {
|
|
304
|
+
const session = await requireSession(context);
|
|
305
|
+
context.apiClient.setSession(session);
|
|
306
|
+
const apiClient = context.apiClient;
|
|
307
|
+
const item = await apiClient.getAuthClient(params.clientId);
|
|
308
|
+
return textResult(`Auth client details:\n\n${summarizeAuthClient(item)}`, item);
|
|
309
|
+
}
|
|
310
|
+
catch (error) {
|
|
311
|
+
return errorResult(error);
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
};
|
|
315
|
+
const listAuthResourceServersTool = {
|
|
316
|
+
name: 'list_auth_resource_servers_tunnelhub',
|
|
317
|
+
schema: {
|
|
318
|
+
title: 'List Auth Resource Servers',
|
|
319
|
+
description: 'List Cognito resource servers exposed by api-gateway-service.',
|
|
320
|
+
inputSchema: AuthResourceServerListParamsSchema,
|
|
321
|
+
annotations: {
|
|
322
|
+
readOnlyHint: true,
|
|
323
|
+
destructiveHint: false,
|
|
324
|
+
idempotentHint: true,
|
|
325
|
+
openWorldHint: false,
|
|
326
|
+
},
|
|
327
|
+
},
|
|
328
|
+
handler: async (params, context) => {
|
|
329
|
+
try {
|
|
330
|
+
const session = await requireSession(context);
|
|
331
|
+
context.apiClient.setSession(session);
|
|
332
|
+
const apiClient = context.apiClient;
|
|
333
|
+
const response = await apiClient.listAuthResourceServers(params);
|
|
334
|
+
const items = extractItems(response);
|
|
335
|
+
return textResult(`Auth resource servers:\n\n${summarizeAuthResourceServerList(items)}\n\nReturned: ${items.length}`, {
|
|
336
|
+
resourceServers: items,
|
|
337
|
+
rawResponse: response,
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
catch (error) {
|
|
341
|
+
return errorResult(error);
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
};
|
|
345
|
+
const listApiGatewayLogsTool = {
|
|
346
|
+
name: 'list_api_gateway_logs_tunnelhub',
|
|
347
|
+
schema: {
|
|
348
|
+
title: 'List API Gateway Logs',
|
|
349
|
+
description: 'List logs for one API Gateway by id.',
|
|
350
|
+
inputSchema: ApiGatewayLogListParamsSchema,
|
|
351
|
+
annotations: {
|
|
352
|
+
readOnlyHint: true,
|
|
353
|
+
destructiveHint: false,
|
|
354
|
+
idempotentHint: true,
|
|
355
|
+
openWorldHint: false,
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
handler: async (params, context) => {
|
|
359
|
+
try {
|
|
360
|
+
const session = await requireSession(context);
|
|
361
|
+
context.apiClient.setSession(session);
|
|
362
|
+
const apiClient = context.apiClient;
|
|
363
|
+
const { apiGatewayId, ...listParams } = params;
|
|
364
|
+
const response = await apiClient.listApiGatewayLogs(apiGatewayId, listParams);
|
|
365
|
+
const items = extractItems(response);
|
|
366
|
+
return textResult(`API Gateway logs for ${apiGatewayId}:\n\n${summarizeApiGatewayLogList(items)}\n\nReturned: ${items.length}`, {
|
|
367
|
+
logs: items,
|
|
368
|
+
rawResponse: response,
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
catch (error) {
|
|
372
|
+
return errorResult(error);
|
|
373
|
+
}
|
|
374
|
+
},
|
|
375
|
+
};
|
|
376
|
+
const getApiGatewayLogTool = {
|
|
377
|
+
name: 'get_api_gateway_log_tunnelhub',
|
|
378
|
+
schema: {
|
|
379
|
+
title: 'Get API Gateway Log',
|
|
380
|
+
description: 'Get one API Gateway log entry and decode compressed request and response payloads when possible.',
|
|
381
|
+
inputSchema: ApiGatewayLogIdParamsSchema,
|
|
382
|
+
annotations: {
|
|
383
|
+
readOnlyHint: true,
|
|
384
|
+
destructiveHint: false,
|
|
385
|
+
idempotentHint: true,
|
|
386
|
+
openWorldHint: false,
|
|
387
|
+
},
|
|
388
|
+
},
|
|
389
|
+
handler: async (params, context) => {
|
|
390
|
+
try {
|
|
391
|
+
const session = await requireSession(context);
|
|
392
|
+
context.apiClient.setSession(session);
|
|
393
|
+
const apiClient = context.apiClient;
|
|
394
|
+
const item = await apiClient.getApiGatewayLog(params.apiGatewayId, params.timestamp, params.logId);
|
|
395
|
+
const decodedRequestPayload = decodeCompressedPayload(item.requestPayload);
|
|
396
|
+
const decodedResponsePayload = decodeCompressedPayload(item.responsePayload);
|
|
397
|
+
return textResult(`API Gateway log details:\n\n${summarizeApiGatewayLog(item)}\n\nDecoded request payload:\n${stringifyPayload(decodedRequestPayload)}\n\nDecoded response payload:\n${stringifyPayload(decodedResponsePayload)}`, {
|
|
398
|
+
...item,
|
|
399
|
+
decodedRequestPayload,
|
|
400
|
+
decodedResponsePayload,
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
catch (error) {
|
|
404
|
+
return errorResult(error);
|
|
405
|
+
}
|
|
406
|
+
},
|
|
407
|
+
};
|
|
408
|
+
const listAllApiGatewayLogsTool = {
|
|
409
|
+
name: 'list_all_api_gateway_logs_tunnelhub',
|
|
410
|
+
schema: {
|
|
411
|
+
title: 'List All API Gateway Logs',
|
|
412
|
+
description: 'List API Gateway logs across the current environment for a required date range.',
|
|
413
|
+
inputSchema: ApiGatewayAllLogsParamsSchema,
|
|
414
|
+
annotations: {
|
|
415
|
+
readOnlyHint: true,
|
|
416
|
+
destructiveHint: false,
|
|
417
|
+
idempotentHint: true,
|
|
418
|
+
openWorldHint: false,
|
|
419
|
+
},
|
|
420
|
+
},
|
|
421
|
+
handler: async (params, context) => {
|
|
422
|
+
try {
|
|
423
|
+
const session = await requireSession(context);
|
|
424
|
+
context.apiClient.setSession(session);
|
|
425
|
+
const apiClient = context.apiClient;
|
|
426
|
+
const response = await apiClient.listAllApiGatewayLogs(params);
|
|
427
|
+
const items = extractItems(response);
|
|
428
|
+
return textResult(`API Gateway logs:\n\n${summarizeApiGatewayLogList(items)}\n\nReturned: ${items.length}`, {
|
|
429
|
+
logs: items,
|
|
430
|
+
rawResponse: response,
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
catch (error) {
|
|
434
|
+
return errorResult(error);
|
|
435
|
+
}
|
|
436
|
+
},
|
|
437
|
+
};
|
|
438
|
+
export function registerApiGatewayTools(server, context) {
|
|
439
|
+
const toolContext = context;
|
|
440
|
+
server.registerTool(listApiGatewaysTool.name, listApiGatewaysTool.schema, (params) => listApiGatewaysTool.handler(params, toolContext));
|
|
441
|
+
server.registerTool(getApiGatewayTool.name, getApiGatewayTool.schema, (params) => getApiGatewayTool.handler(params, toolContext));
|
|
442
|
+
server.registerTool(listApiKeysTool.name, listApiKeysTool.schema, (params) => listApiKeysTool.handler(params, toolContext));
|
|
443
|
+
server.registerTool(listUsagePlansTool.name, listUsagePlansTool.schema, (params) => listUsagePlansTool.handler(params, toolContext));
|
|
444
|
+
server.registerTool(listAuthClientsTool.name, listAuthClientsTool.schema, (params) => listAuthClientsTool.handler(params, toolContext));
|
|
445
|
+
server.registerTool(getAuthClientTool.name, getAuthClientTool.schema, (params) => getAuthClientTool.handler(params, toolContext));
|
|
446
|
+
server.registerTool(listAuthResourceServersTool.name, listAuthResourceServersTool.schema, (params) => listAuthResourceServersTool.handler(params, toolContext));
|
|
447
|
+
server.registerTool(listApiGatewayLogsTool.name, listApiGatewayLogsTool.schema, (params) => listApiGatewayLogsTool.handler(params, toolContext));
|
|
448
|
+
server.registerTool(getApiGatewayLogTool.name, getApiGatewayLogTool.schema, (params) => getApiGatewayLogTool.handler(params, toolContext));
|
|
449
|
+
server.registerTool(listAllApiGatewayLogsTool.name, listAllApiGatewayLogsTool.schema, (params) => listAllApiGatewayLogsTool.handler(params, toolContext));
|
|
8
450
|
}
|
|
9
451
|
//# sourceMappingURL=index.js.map
|