@sfdxy/anypoint-connect 0.13.0 → 0.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 +15 -10
- package/dist/analysis/LogAnalyzer.d.ts +1 -1
- package/dist/analysis/LogAnalyzer.d.ts.map +1 -1
- package/dist/analysis/LogAnalyzer.js +2 -2
- package/dist/analysis/LogAnalyzer.js.map +1 -1
- package/dist/analysis/error-grouper.js +1 -1
- package/dist/analysis/error-grouper.js.map +1 -1
- package/dist/analysis/{utils.d.ts → normalize.d.ts} +1 -1
- package/dist/analysis/normalize.d.ts.map +1 -0
- package/dist/analysis/{utils.js → normalize.js} +2 -2
- package/dist/analysis/normalize.js.map +1 -0
- package/dist/analysis/parser.js +14 -3
- package/dist/analysis/parser.js.map +1 -1
- package/dist/analysis/pattern-detector.js +1 -1
- package/dist/analysis/pattern-detector.js.map +1 -1
- package/dist/analysis/stats.js +1 -1
- package/dist/analysis/stats.js.map +1 -1
- package/dist/api/DesignCenterApi.d.ts +0 -20
- package/dist/api/DesignCenterApi.d.ts.map +1 -1
- package/dist/api/DesignCenterApi.js +0 -22
- package/dist/api/DesignCenterApi.js.map +1 -1
- package/dist/api/ExchangeApi.d.ts +1 -1
- package/dist/api/ExchangeApi.d.ts.map +1 -1
- package/dist/api/ExchangeApi.js +3 -1
- package/dist/api/ExchangeApi.js.map +1 -1
- package/dist/api/MonitoringApi.d.ts +137 -93
- package/dist/api/MonitoringApi.d.ts.map +1 -1
- package/dist/api/MonitoringApi.js +471 -204
- package/dist/api/MonitoringApi.js.map +1 -1
- package/dist/auth/FileStore.js +1 -1
- package/dist/auth/FileStore.js.map +1 -1
- package/dist/cli.js +2 -2
- package/dist/cli.js.map +1 -1
- package/dist/client/AnypointClient.d.ts +1 -1
- package/dist/client/AnypointClient.d.ts.map +1 -1
- package/dist/client/AnypointClient.js +2 -2
- package/dist/client/AnypointClient.js.map +1 -1
- package/dist/commands/api.d.ts.map +1 -1
- package/dist/commands/api.js +36 -28
- package/dist/commands/api.js.map +1 -1
- package/dist/commands/apps.js +2 -2
- package/dist/commands/apps.js.map +1 -1
- package/dist/commands/auth.js +1 -1
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/config.js +1 -1
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/deploy.d.ts +5 -1
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +53 -81
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/design-center.d.ts +1 -1
- package/dist/commands/design-center.d.ts.map +1 -1
- package/dist/commands/design-center.js +36 -25
- package/dist/commands/design-center.js.map +1 -1
- package/dist/commands/monitor.d.ts +5 -6
- package/dist/commands/monitor.d.ts.map +1 -1
- package/dist/commands/monitor.js +210 -230
- package/dist/commands/monitor.js.map +1 -1
- package/dist/commands/shared.d.ts +2 -0
- package/dist/commands/shared.d.ts.map +1 -1
- package/dist/commands/shared.js +16 -1
- package/dist/commands/shared.js.map +1 -1
- package/dist/{utils/config.d.ts → config/profiles.d.ts} +1 -1
- package/dist/config/profiles.d.ts.map +1 -0
- package/dist/{utils/config.js → config/profiles.js} +1 -1
- package/dist/config/profiles.js.map +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/mcp/prompts.js +7 -7
- package/dist/mcp/prompts.js.map +1 -1
- package/dist/mcp/server.d.ts +14 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +60 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools/analysis.d.ts.map +1 -1
- package/dist/mcp/tools/analysis.js +8 -24
- package/dist/mcp/tools/analysis.js.map +1 -1
- package/dist/mcp/tools/anypoint-mq.d.ts.map +1 -1
- package/dist/mcp/tools/anypoint-mq.js +20 -52
- package/dist/mcp/tools/anypoint-mq.js.map +1 -1
- package/dist/mcp/tools/api-manager.d.ts.map +1 -1
- package/dist/mcp/tools/api-manager.js +29 -53
- package/dist/mcp/tools/api-manager.js.map +1 -1
- package/dist/mcp/tools/apps-deploy.d.ts +8 -0
- package/dist/mcp/tools/apps-deploy.d.ts.map +1 -0
- package/dist/mcp/tools/apps-deploy.js +386 -0
- package/dist/mcp/tools/apps-deploy.js.map +1 -0
- package/dist/mcp/tools/apps-lifecycle.d.ts +8 -0
- package/dist/mcp/tools/apps-lifecycle.d.ts.map +1 -0
- package/dist/mcp/tools/apps-lifecycle.js +275 -0
- package/dist/mcp/tools/apps-lifecycle.js.map +1 -0
- package/dist/mcp/tools/apps-read.d.ts +8 -0
- package/dist/mcp/tools/apps-read.d.ts.map +1 -0
- package/dist/mcp/tools/apps-read.js +251 -0
- package/dist/mcp/tools/apps-read.js.map +1 -0
- package/dist/mcp/tools/audit.d.ts.map +1 -1
- package/dist/mcp/tools/audit.js +9 -17
- package/dist/mcp/tools/audit.js.map +1 -1
- package/dist/mcp/tools/design-center.d.ts +2 -3
- package/dist/mcp/tools/design-center.d.ts.map +1 -1
- package/dist/mcp/tools/design-center.js +41 -185
- package/dist/mcp/tools/design-center.js.map +1 -1
- package/dist/mcp/tools/exchange.d.ts +1 -2
- package/dist/mcp/tools/exchange.d.ts.map +1 -1
- package/dist/mcp/tools/exchange.js +65 -296
- package/dist/mcp/tools/exchange.js.map +1 -1
- package/dist/mcp/tools/governance.d.ts +8 -0
- package/dist/mcp/tools/governance.d.ts.map +1 -0
- package/dist/mcp/tools/governance.js +59 -0
- package/dist/mcp/tools/governance.js.map +1 -0
- package/dist/mcp/tools/identity.d.ts.map +1 -1
- package/dist/mcp/tools/identity.js +15 -36
- package/dist/mcp/tools/identity.js.map +1 -1
- package/dist/mcp/tools/index.d.ts +4 -1
- package/dist/mcp/tools/index.d.ts.map +1 -1
- package/dist/mcp/tools/index.js +4 -1
- package/dist/mcp/tools/index.js.map +1 -1
- package/dist/mcp/tools/logs.d.ts.map +1 -1
- package/dist/mcp/tools/logs.js +6 -23
- package/dist/mcp/tools/logs.js.map +1 -1
- package/dist/mcp/tools/monitoring.d.ts +1 -2
- package/dist/mcp/tools/monitoring.d.ts.map +1 -1
- package/dist/mcp/tools/monitoring.js +78 -285
- package/dist/mcp/tools/monitoring.js.map +1 -1
- package/dist/mcp/tools/object-store.d.ts +1 -1
- package/dist/mcp/tools/object-store.d.ts.map +1 -1
- package/dist/mcp/tools/object-store.js +19 -59
- package/dist/mcp/tools/object-store.js.map +1 -1
- package/dist/mcp/tools/profile.d.ts.map +1 -1
- package/dist/mcp/tools/profile.js +15 -35
- package/dist/mcp/tools/profile.js.map +1 -1
- package/dist/mcp/tools/shared.d.ts +16 -0
- package/dist/mcp/tools/shared.d.ts.map +1 -1
- package/dist/mcp/tools/shared.js +12 -0
- package/dist/mcp/tools/shared.js.map +1 -1
- package/dist/mcp.d.ts +3 -11
- package/dist/mcp.d.ts.map +1 -1
- package/dist/mcp.js +4 -56
- package/dist/mcp.js.map +1 -1
- package/dist/safety/artifact.d.ts +13 -0
- package/dist/safety/artifact.d.ts.map +1 -0
- package/dist/safety/artifact.js +58 -0
- package/dist/safety/artifact.js.map +1 -0
- package/dist/safety/guards.d.ts +2 -2
- package/dist/safety/guards.d.ts.map +1 -1
- package/dist/safety/guards.js +4 -4
- package/dist/safety/guards.js.map +1 -1
- package/dist/utils/errors.d.ts +12 -0
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/errors.js +26 -0
- package/dist/utils/errors.js.map +1 -1
- package/dist/{api/DesignCenterWorkflow.d.ts → workflows/design-center.d.ts} +4 -4
- package/dist/workflows/design-center.d.ts.map +1 -0
- package/dist/{api/DesignCenterWorkflow.js → workflows/design-center.js} +1 -1
- package/dist/workflows/design-center.js.map +1 -0
- package/dist/workflows/jar-deployment.d.ts +119 -0
- package/dist/workflows/jar-deployment.d.ts.map +1 -0
- package/dist/workflows/jar-deployment.js +117 -0
- package/dist/workflows/jar-deployment.js.map +1 -0
- package/package.json +11 -2
- package/dist/analysis/utils.d.ts.map +0 -1
- package/dist/analysis/utils.js.map +0 -1
- package/dist/api/DesignCenterWorkflow.d.ts.map +0 -1
- package/dist/api/DesignCenterWorkflow.js.map +0 -1
- package/dist/api/index.d.ts +0 -13
- package/dist/api/index.d.ts.map +0 -1
- package/dist/api/index.js +0 -13
- package/dist/api/index.js.map +0 -1
- package/dist/mcp/tools/applications.d.ts +0 -4
- package/dist/mcp/tools/applications.d.ts.map +0 -1
- package/dist/mcp/tools/applications.js +0 -815
- package/dist/mcp/tools/applications.js.map +0 -1
- package/dist/utils/config.d.ts.map +0 -1
- package/dist/utils/config.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../../src/mcp/tools/identity.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../../src/mcp/tools/identity.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,UAAU,qBAAqB,CAAC,MAAiB,EAAE,MAAsB;IAC3E,MAAM,CAAC,YAAY,CACf,QAAQ,EACR;QACI,KAAK,EAAE,UAAU;QACjB,WAAW,EACP,4NAA4N;QAChO,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE;KACtC,EACD,KAAK,IAAI,EAAE;QACP,IAAI,CAAC;YACD,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,MAAM,EAAE,CAAC;YACjC,OAAO,OAAO,CAAC;gBACX,IAAI,EAAE,GAAG,EAAE,CAAC,SAAS,IAAI,EAAE,CAAC,QAAQ,EAAE;gBACtC,QAAQ,EAAE,EAAE,CAAC,QAAQ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C9B,kBAAkB,EAAE,CAAC,CAAC,kBAAkB;gBACxC,aAAa,EAAE,CAAC,CAAC,MAAM;aAC1B,CAAC;YAEF,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC;QAC5B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;IACL,CAAC,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -2,13 +2,16 @@
|
|
|
2
2
|
* MCP Tool Registrars — barrel export
|
|
3
3
|
*/
|
|
4
4
|
export { registerIdentityTools } from './identity.js';
|
|
5
|
-
export {
|
|
5
|
+
export { registerAppReadTools } from './apps-read.js';
|
|
6
|
+
export { registerAppLifecycleTools } from './apps-lifecycle.js';
|
|
7
|
+
export { registerAppDeployTools } from './apps-deploy.js';
|
|
6
8
|
export { registerLogTools } from './logs.js';
|
|
7
9
|
export { registerAnalysisTools } from './analysis.js';
|
|
8
10
|
export { registerMonitoringTools } from './monitoring.js';
|
|
9
11
|
export { registerExchangeTools } from './exchange.js';
|
|
10
12
|
export { registerApiManagerTools } from './api-manager.js';
|
|
11
13
|
export { registerDesignCenterTools } from './design-center.js';
|
|
14
|
+
export { registerGovernanceTools } from './governance.js';
|
|
12
15
|
export { registerProfileTools } from './profile.js';
|
|
13
16
|
export { registerAuditTools } from './audit.js';
|
|
14
17
|
export { registerAnypointMQTools } from './anypoint-mq.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/mcp/tools/index.js
CHANGED
|
@@ -2,13 +2,16 @@
|
|
|
2
2
|
* MCP Tool Registrars — barrel export
|
|
3
3
|
*/
|
|
4
4
|
export { registerIdentityTools } from './identity.js';
|
|
5
|
-
export {
|
|
5
|
+
export { registerAppReadTools } from './apps-read.js';
|
|
6
|
+
export { registerAppLifecycleTools } from './apps-lifecycle.js';
|
|
7
|
+
export { registerAppDeployTools } from './apps-deploy.js';
|
|
6
8
|
export { registerLogTools } from './logs.js';
|
|
7
9
|
export { registerAnalysisTools } from './analysis.js';
|
|
8
10
|
export { registerMonitoringTools } from './monitoring.js';
|
|
9
11
|
export { registerExchangeTools } from './exchange.js';
|
|
10
12
|
export { registerApiManagerTools } from './api-manager.js';
|
|
11
13
|
export { registerDesignCenterTools } from './design-center.js';
|
|
14
|
+
export { registerGovernanceTools } from './governance.js';
|
|
12
15
|
export { registerProfileTools } from './profile.js';
|
|
13
16
|
export { registerAuditTools } from './audit.js';
|
|
14
17
|
export { registerAnypointMQTools } from './anypoint-mq.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/mcp/tools/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/mcp/tools/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logs.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/logs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAIrE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"logs.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/logs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAIrE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,QA2FzE"}
|
package/dist/mcp/tools/logs.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* get_logs, download_logs
|
|
4
4
|
*/
|
|
5
5
|
import { z } from 'zod';
|
|
6
|
-
import { mcpError } from './shared.js';
|
|
6
|
+
import { mcpError, mcpText, resolveEnvironment, timeWindow } from './shared.js';
|
|
7
7
|
export function registerLogTools(server, client) {
|
|
8
8
|
server.registerTool('get_logs', {
|
|
9
9
|
title: 'Get Application Logs',
|
|
@@ -27,8 +27,7 @@ export function registerLogTools(server, client) {
|
|
|
27
27
|
annotations: { readOnlyHint: true },
|
|
28
28
|
}, async ({ appName, environment, lines, level, search }) => {
|
|
29
29
|
try {
|
|
30
|
-
const orgId = await client
|
|
31
|
-
const env = await client.accessManagement.resolveEnvironment(orgId, environment);
|
|
30
|
+
const { orgId, env } = await resolveEnvironment(client, environment);
|
|
32
31
|
const entries = await client.logs.getLogs(orgId, env.id, appName, {
|
|
33
32
|
limit: lines || 100,
|
|
34
33
|
level,
|
|
@@ -39,14 +38,7 @@ export function registerLogTools(server, client) {
|
|
|
39
38
|
level: e.priority,
|
|
40
39
|
message: e.message,
|
|
41
40
|
}));
|
|
42
|
-
return {
|
|
43
|
-
content: [
|
|
44
|
-
{
|
|
45
|
-
type: 'text',
|
|
46
|
-
text: JSON.stringify({ total: entries.length, entries: formatted }, null, 2),
|
|
47
|
-
},
|
|
48
|
-
],
|
|
49
|
-
};
|
|
41
|
+
return mcpText({ total: entries.length, entries: formatted });
|
|
50
42
|
}
|
|
51
43
|
catch (error) {
|
|
52
44
|
return mcpError(error);
|
|
@@ -66,10 +58,8 @@ export function registerLogTools(server, client) {
|
|
|
66
58
|
annotations: { readOnlyHint: true },
|
|
67
59
|
}, async ({ appName, environment, hoursBack, level }) => {
|
|
68
60
|
try {
|
|
69
|
-
const orgId = await client
|
|
70
|
-
const
|
|
71
|
-
const to = Date.now();
|
|
72
|
-
const from = to - hoursBack * 60 * 60 * 1000;
|
|
61
|
+
const { orgId, env } = await resolveEnvironment(client, environment);
|
|
62
|
+
const { from, to } = timeWindow(hoursBack);
|
|
73
63
|
const entries = await client.logs.getLogsForPeriod(orgId, env.id, appName, from, to, level);
|
|
74
64
|
const text = entries
|
|
75
65
|
.map((e) => {
|
|
@@ -77,14 +67,7 @@ export function registerLogTools(server, client) {
|
|
|
77
67
|
return `${ts} [${e.priority}] ${e.message}`;
|
|
78
68
|
})
|
|
79
69
|
.join('\n');
|
|
80
|
-
return
|
|
81
|
-
content: [
|
|
82
|
-
{
|
|
83
|
-
type: 'text',
|
|
84
|
-
text: text || 'No log entries found for the specified period.',
|
|
85
|
-
},
|
|
86
|
-
],
|
|
87
|
-
};
|
|
70
|
+
return mcpText(text || 'No log entries found for the specified period.');
|
|
88
71
|
}
|
|
89
72
|
catch (error) {
|
|
90
73
|
return mcpError(error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logs.js","sourceRoot":"","sources":["../../../src/mcp/tools/logs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,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AAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,MAAM,kBAAkB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;YAErE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;YAE3C,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;YAE5F,MAAM,IAAI,GAAG,OAAO;iBACf,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;gBACP,MAAM,EAAE,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,CAAC;gBAC/C,OAAO,GAAG,EAAE,KAAK,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;YAChD,CAAC,CAAC;iBACD,IAAI,CAAC,IAAI,CAAC,CAAC;YAEhB,OAAO,OAAO,CAAC,IAAI,IAAI,gDAAgD,CAAC,CAAC;QAC7E,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;IACL,CAAC,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* MCP Tool Registrar — Monitoring tools
|
|
3
|
-
* get_metrics,
|
|
4
|
-
* get_worker_metrics, compare_environments
|
|
3
|
+
* get_metrics, get_runtime_metrics, get_metrics_timeseries, raw_amql_query
|
|
5
4
|
*/
|
|
6
5
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
7
6
|
import type { AnypointClient } from '../../client/AnypointClient.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monitoring.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/monitoring.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"monitoring.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/monitoring.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAYrE,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,QA8IhF"}
|
|
@@ -1,86 +1,72 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* MCP Tool Registrar — Monitoring tools
|
|
3
|
-
* get_metrics,
|
|
4
|
-
* get_worker_metrics, compare_environments
|
|
3
|
+
* get_metrics, get_runtime_metrics, get_metrics_timeseries, raw_amql_query
|
|
5
4
|
*/
|
|
6
5
|
import { z } from 'zod';
|
|
7
|
-
import {
|
|
6
|
+
import { AMQL_MAX_LIMIT, GRANULARITIES, TIME_SERIES_SIGNALS } from '../../api/MonitoringApi.js';
|
|
7
|
+
import { mcpError, mcpText, resolveEnvironment, timeWindow } from './shared.js';
|
|
8
|
+
const hoursBackSchema = z
|
|
9
|
+
.number()
|
|
10
|
+
.positive()
|
|
11
|
+
.optional()
|
|
12
|
+
.describe('Time window in hours ending now (default: 24). Use 1 for recent activity, 168 for weekly trends.');
|
|
13
|
+
const appNameSchema = z.string().optional().describe('Limit to one application name. Omit for every app.');
|
|
8
14
|
export function registerMonitoringTools(server, client) {
|
|
9
15
|
server.registerTool('get_metrics', {
|
|
10
|
-
title: 'Get
|
|
11
|
-
description: '
|
|
16
|
+
title: 'Get Traffic Metrics',
|
|
17
|
+
description: 'Traffic, latency and failures from Anypoint Monitoring. Per app (default), per worker/replica, or per HTTP route: inbound request count, failed count and failure rate, average/min/max and p50/p75/p90/p95/p99 response time (ms), outbound call count/failures/average, and Mule message count/errors. Omit `environment` to compare every environment side by side. Use groupBy "worker" to spot an unhealthy or overloaded replica, and "route" to find which inbound or outbound route is failing.',
|
|
12
18
|
inputSchema: {
|
|
13
|
-
environment: z
|
|
14
|
-
hoursBack: z
|
|
15
|
-
.number()
|
|
16
|
-
.optional()
|
|
17
|
-
.describe('Time window in hours (default: 24). Use 1 for recent, 168 for weekly trends.'),
|
|
18
|
-
appName: z
|
|
19
|
+
environment: z
|
|
19
20
|
.string()
|
|
20
21
|
.optional()
|
|
21
|
-
.describe('
|
|
22
|
+
.describe('Environment name or ID. Omit to compare every environment.'),
|
|
23
|
+
hoursBack: hoursBackSchema,
|
|
24
|
+
appName: appNameSchema,
|
|
25
|
+
groupBy: z.enum(['app', 'worker', 'route']).optional().describe('Row grouping (default: "app").'),
|
|
22
26
|
},
|
|
23
27
|
annotations: { readOnlyHint: true },
|
|
24
|
-
}, async ({ environment, hoursBack, appName }) => {
|
|
28
|
+
}, async ({ environment, hoursBack, appName, groupBy = 'app' }) => {
|
|
25
29
|
try {
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
};
|
|
30
|
+
const { from, to, period } = timeWindow(hoursBack);
|
|
31
|
+
const resolved = environment ? await resolveEnvironment(client, environment) : undefined;
|
|
32
|
+
const orgId = resolved?.orgId ?? (await client.getDefaultOrgId());
|
|
33
|
+
const scope = { orgId, envId: resolved?.env.id, from, to, appName };
|
|
34
|
+
if (groupBy === 'route') {
|
|
35
|
+
return mcpText({
|
|
36
|
+
environment: resolved?.env.name ?? 'all',
|
|
37
|
+
period,
|
|
38
|
+
routes: await client.monitoring.getRouteMetrics(scope),
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return mcpText({
|
|
42
|
+
environment: resolved?.env.name ?? 'all',
|
|
43
|
+
period,
|
|
44
|
+
groupBy,
|
|
45
|
+
rows: await client.monitoring.getMetrics(scope, groupBy),
|
|
46
|
+
});
|
|
43
47
|
}
|
|
44
48
|
catch (error) {
|
|
45
49
|
return mcpError(error);
|
|
46
50
|
}
|
|
47
51
|
});
|
|
48
|
-
server.registerTool('
|
|
49
|
-
title: 'Get
|
|
50
|
-
description: '
|
|
52
|
+
server.registerTool('get_runtime_metrics', {
|
|
53
|
+
title: 'Get Runtime (JVM and Host) Metrics',
|
|
54
|
+
description: 'JVM and host health per worker/replica: total heap used (avg/peak) and committed; the old-generation pool with its limit and peak-to-limit ratio (the memory-pressure and leak signal); metaspace; old-generation GC collections and GC time inside the window; CPU count and physical RAM; system and process CPU load (avg/max); and average free physical memory. Memory sizes are bytes, CPU loads are 0–1 fractions, GC time is milliseconds.',
|
|
51
55
|
inputSchema: {
|
|
52
|
-
environment: z
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
hoursBack: z
|
|
56
|
-
.number()
|
|
57
|
-
.optional()
|
|
58
|
-
.describe('Time window in hours (default: 24). Use 1 for recent, 168 for weekly trends'),
|
|
59
|
-
appName: z
|
|
60
|
-
.string()
|
|
61
|
-
.optional()
|
|
62
|
-
.describe('Filter to a specific application name. Omit to get metrics for all apps'),
|
|
56
|
+
environment: z.string().describe('Environment name or ID'),
|
|
57
|
+
hoursBack: hoursBackSchema,
|
|
58
|
+
appName: appNameSchema,
|
|
63
59
|
},
|
|
64
60
|
annotations: { readOnlyHint: true },
|
|
65
61
|
}, async ({ environment, hoursBack, appName }) => {
|
|
66
62
|
try {
|
|
67
|
-
const orgId = await client
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
{
|
|
75
|
-
type: 'text',
|
|
76
|
-
text: JSON.stringify({
|
|
77
|
-
environment: env.name,
|
|
78
|
-
period: { from: new Date(from).toISOString(), to: new Date(to).toISOString() },
|
|
79
|
-
apps: metrics,
|
|
80
|
-
}, null, 2),
|
|
81
|
-
},
|
|
82
|
-
],
|
|
83
|
-
};
|
|
63
|
+
const { orgId, env } = await resolveEnvironment(client, environment);
|
|
64
|
+
const { from, to, period } = timeWindow(hoursBack);
|
|
65
|
+
return mcpText({
|
|
66
|
+
environment: env.name,
|
|
67
|
+
period,
|
|
68
|
+
workers: await client.monitoring.getRuntimeMetrics({ orgId, envId: env.id, from, to, appName }),
|
|
69
|
+
});
|
|
84
70
|
}
|
|
85
71
|
catch (error) {
|
|
86
72
|
return mcpError(error);
|
|
@@ -88,167 +74,24 @@ export function registerMonitoringTools(server, client) {
|
|
|
88
74
|
});
|
|
89
75
|
server.registerTool('get_metrics_timeseries', {
|
|
90
76
|
title: 'Get Metrics Time Series',
|
|
91
|
-
description: '
|
|
77
|
+
description: 'Bucketed metrics for trend and incident analysis. Signals: "traffic" (requests, failed, avg and p95 latency per app), "latency" (p50/p75/p90/p95/p99 per app), "memory" (heap, old-generation and metaspace bytes per worker), "cpu" (system/process CPU load and free physical memory per worker), "gc" (collections and GC milliseconds per bucket per worker, old-generation split out). Use "1m" or "5m" buckets for incident windows of a few hours and "1h"/"1d" for multi-day trends such as a rising old-generation baseline.',
|
|
92
78
|
inputSchema: {
|
|
93
|
-
environment: z
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
hoursBack: z
|
|
97
|
-
.number()
|
|
98
|
-
.optional()
|
|
99
|
-
.describe('Time window in hours (default: 24). Use 1 for recent, 168 for weekly trends'),
|
|
79
|
+
environment: z.string().describe('Environment name or ID'),
|
|
80
|
+
signal: z.enum(TIME_SERIES_SIGNALS).describe('Which signal to chart'),
|
|
81
|
+
hoursBack: hoursBackSchema,
|
|
100
82
|
granularity: z
|
|
101
|
-
.enum(
|
|
102
|
-
.optional()
|
|
103
|
-
.describe('Time bucket size (default: "1h"). Use "5m" for short windows, "1d" for weekly'),
|
|
104
|
-
appName: z
|
|
105
|
-
.string()
|
|
106
|
-
.optional()
|
|
107
|
-
.describe('Filter to a specific application name. Omit to get time series for all apps'),
|
|
108
|
-
},
|
|
109
|
-
annotations: { readOnlyHint: true },
|
|
110
|
-
}, async ({ environment, hoursBack, granularity, appName }) => {
|
|
111
|
-
try {
|
|
112
|
-
const orgId = await client.getDefaultOrgId();
|
|
113
|
-
const env = await client.accessManagement.resolveEnvironment(orgId, environment);
|
|
114
|
-
const to = Date.now();
|
|
115
|
-
const from = to - (hoursBack || 24) * 60 * 60 * 1000;
|
|
116
|
-
const granularityMap = {
|
|
117
|
-
'5m': 'PT5M',
|
|
118
|
-
'15m': 'PT15M',
|
|
119
|
-
'30m': 'PT30M',
|
|
120
|
-
'1h': 'PT1H',
|
|
121
|
-
'1d': 'P1D',
|
|
122
|
-
};
|
|
123
|
-
const g = granularityMap[granularity || '1h'];
|
|
124
|
-
const data = await client.monitoring.getTimeSeries(orgId, env.id, from, to, g, appName);
|
|
125
|
-
return {
|
|
126
|
-
content: [
|
|
127
|
-
{
|
|
128
|
-
type: 'text',
|
|
129
|
-
text: JSON.stringify({
|
|
130
|
-
environment: env.name,
|
|
131
|
-
period: { from: new Date(from).toISOString(), to: new Date(to).toISOString() },
|
|
132
|
-
granularity: granularity || '1h',
|
|
133
|
-
dataPoints: data,
|
|
134
|
-
}, null, 2),
|
|
135
|
-
},
|
|
136
|
-
],
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
catch (error) {
|
|
140
|
-
return mcpError(error);
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
server.registerTool('get_worker_metrics', {
|
|
144
|
-
title: 'Get Worker/Replica Metrics',
|
|
145
|
-
description: 'Fetches per-worker (per-replica) performance metrics: request count, average response time, max latency, and p95 for each worker ID. Use this to detect unhealthy replicas, identify load imbalance between workers, or pinpoint specific instances with elevated latency.',
|
|
146
|
-
inputSchema: {
|
|
147
|
-
environment: z
|
|
148
|
-
.string()
|
|
149
|
-
.describe('Environment name (e.g. "Development", "Production") or environment ID'),
|
|
150
|
-
hoursBack: z
|
|
151
|
-
.number()
|
|
152
|
-
.optional()
|
|
153
|
-
.describe('Time window in hours (default: 24). Use 1 for recent, 168 for weekly trends'),
|
|
154
|
-
appName: z
|
|
155
|
-
.string()
|
|
156
|
-
.optional()
|
|
157
|
-
.describe('Filter to a specific application name. Omit to get worker metrics for all apps'),
|
|
158
|
-
},
|
|
159
|
-
annotations: { readOnlyHint: true },
|
|
160
|
-
}, async ({ environment, hoursBack, appName }) => {
|
|
161
|
-
try {
|
|
162
|
-
const orgId = await client.getDefaultOrgId();
|
|
163
|
-
const env = await client.accessManagement.resolveEnvironment(orgId, environment);
|
|
164
|
-
const to = Date.now();
|
|
165
|
-
const from = to - (hoursBack || 24) * 60 * 60 * 1000;
|
|
166
|
-
const metrics = await client.monitoring.getWorkerMetrics(orgId, env.id, from, to, appName);
|
|
167
|
-
return {
|
|
168
|
-
content: [
|
|
169
|
-
{
|
|
170
|
-
type: 'text',
|
|
171
|
-
text: JSON.stringify({
|
|
172
|
-
environment: env.name,
|
|
173
|
-
period: { from: new Date(from).toISOString(), to: new Date(to).toISOString() },
|
|
174
|
-
workers: metrics,
|
|
175
|
-
}, null, 2),
|
|
176
|
-
},
|
|
177
|
-
],
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
catch (error) {
|
|
181
|
-
return mcpError(error);
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
server.registerTool('compare_env_performance', {
|
|
185
|
-
title: 'Compare Environment Performance',
|
|
186
|
-
description: 'Compares application response-time performance across all environments (Development, Sandbox, Production) without requiring an environment filter. Returns per-app, per-environment metrics including request count, average response time, p95, and p99 latency. Use this to validate that staging matches production behavior, spot environment-specific degradation, or baseline performance across the org.',
|
|
187
|
-
inputSchema: {
|
|
188
|
-
hoursBack: z
|
|
189
|
-
.number()
|
|
190
|
-
.optional()
|
|
191
|
-
.describe('Time window in hours (default: 24). Use 1 for recent, 168 for weekly trends'),
|
|
192
|
-
},
|
|
193
|
-
annotations: { readOnlyHint: true },
|
|
194
|
-
}, async ({ hoursBack }) => {
|
|
195
|
-
try {
|
|
196
|
-
const orgId = await client.getDefaultOrgId();
|
|
197
|
-
const to = Date.now();
|
|
198
|
-
const from = to - (hoursBack || 24) * 60 * 60 * 1000;
|
|
199
|
-
const metrics = await client.monitoring.getCrossEnvMetrics(orgId, from, to);
|
|
200
|
-
return {
|
|
201
|
-
content: [
|
|
202
|
-
{
|
|
203
|
-
type: 'text',
|
|
204
|
-
text: JSON.stringify({
|
|
205
|
-
period: { from: new Date(from).toISOString(), to: new Date(to).toISOString() },
|
|
206
|
-
environments: metrics,
|
|
207
|
-
}, null, 2),
|
|
208
|
-
},
|
|
209
|
-
],
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
catch (error) {
|
|
213
|
-
return mcpError(error);
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
|
-
server.registerTool('get_memory_metrics', {
|
|
217
|
-
title: 'Get JVM Memory Metrics',
|
|
218
|
-
description: 'Fetches JVM memory and infrastructure metrics per application: average heap used/committed, max heap, GC count and time, and thread count. Use this to identify memory pressure, potential leaks, or apps approaching heap limits. Queries the mulesoft.jvm datasource via AMQL.',
|
|
219
|
-
inputSchema: {
|
|
220
|
-
environment: z
|
|
221
|
-
.string()
|
|
222
|
-
.describe('Environment name (e.g. "Development", "Production") or environment ID'),
|
|
223
|
-
hoursBack: z
|
|
224
|
-
.number()
|
|
225
|
-
.optional()
|
|
226
|
-
.describe('Time window in hours (default: 24). Use 1 for recent, 168 for weekly trends'),
|
|
227
|
-
appName: z
|
|
228
|
-
.string()
|
|
83
|
+
.enum(GRANULARITIES)
|
|
229
84
|
.optional()
|
|
230
|
-
.describe('
|
|
85
|
+
.describe('Bucket size (default: "1h").'),
|
|
86
|
+
appName: appNameSchema,
|
|
231
87
|
},
|
|
232
88
|
annotations: { readOnlyHint: true },
|
|
233
|
-
}, async ({ environment, hoursBack, appName }) => {
|
|
89
|
+
}, async ({ environment, signal, hoursBack, granularity = '1h', appName }) => {
|
|
234
90
|
try {
|
|
235
|
-
const orgId = await client
|
|
236
|
-
const
|
|
237
|
-
const
|
|
238
|
-
|
|
239
|
-
const metrics = await client.monitoring.getMemoryMetrics(orgId, env.id, from, to, appName);
|
|
240
|
-
return {
|
|
241
|
-
content: [
|
|
242
|
-
{
|
|
243
|
-
type: 'text',
|
|
244
|
-
text: JSON.stringify({
|
|
245
|
-
environment: env.name,
|
|
246
|
-
period: { from: new Date(from).toISOString(), to: new Date(to).toISOString() },
|
|
247
|
-
apps: metrics,
|
|
248
|
-
}, null, 2),
|
|
249
|
-
},
|
|
250
|
-
],
|
|
251
|
-
};
|
|
91
|
+
const { orgId, env } = await resolveEnvironment(client, environment);
|
|
92
|
+
const { from, to, period } = timeWindow(hoursBack);
|
|
93
|
+
const points = await client.monitoring.getTimeSeries({ orgId, envId: env.id, from, to, appName }, signal, granularity);
|
|
94
|
+
return mcpText({ environment: env.name, period, signal, granularity, points });
|
|
252
95
|
}
|
|
253
96
|
catch (error) {
|
|
254
97
|
return mcpError(error);
|
|
@@ -256,82 +99,32 @@ export function registerMonitoringTools(server, client) {
|
|
|
256
99
|
});
|
|
257
100
|
server.registerTool('raw_amql_query', {
|
|
258
101
|
title: 'Execute Raw AMQL Query',
|
|
259
|
-
description:
|
|
102
|
+
description: `Runs a freeform AMQL query against Anypoint Monitoring when the other metric tools do not answer the question. Platform errors are returned as-is (they name the bad token or attribute). Always filter on "sub_org.id" and a "timestamp BETWEEN <fromMs> AND <toMs>" range; add "env.id" and "app.name" as needed.
|
|
103
|
+
Datasources:
|
|
104
|
+
- "mulesoft.app.inbound" / "mulesoft.app.outbound": requests, response_time, "response.status" ('FAILED'), "http.route" (outbound), "worker.id", "app.name", "env.name"
|
|
105
|
+
- "mulesoft.message": total_count, error_count
|
|
106
|
+
- "mulesoft.app.jvm.memory": usage, committed, init, "limit" (quote it; -1 = unbounded), "type" (heap|off-heap), "pool" (total-heap, tenured_gen, eden_space, survivor_space, metaspace, …)
|
|
107
|
+
- "mulesoft.app.jvm.gc": count and duration (ms) are CUMULATIVE per worker — use MAX − MIN, never SUM; filter or group by name (collector)
|
|
108
|
+
- "mulesoft.app.jvm.cpu": available_processors, total_physical_memory_size
|
|
109
|
+
- "mulesoft.app.memory": system_cpu_load, process_cpu_load, free_physical_memory_size (AVG only — MIN/MAX on memory sizes fail server-side)
|
|
110
|
+
- "mulesoft.entity": entity-level view keyed by "entity.id"/"entity.name" (no "app.name")
|
|
111
|
+
Syntax: COUNT, SUM, AVG, MIN, MAX, PERCENTILE(field, 0.95), LATEST(field), GROUP BY, ORDER BY, TIMESERIES PT1M|PT5M|PT15M|PT30M|PT1H|P1D. SELECT * is not supported; single-letter aliases such as h, d, t are reserved; escape quotes in string literals by doubling them. An in-query LIMIT is ignored — use the limit argument.`,
|
|
260
112
|
inputSchema: {
|
|
261
|
-
query: z
|
|
262
|
-
.string()
|
|
263
|
-
.describe('AMQL query string. Example: SELECT COUNT(requests) AS "count", AVG(response_time) AS "avg_rt", "app.name" FROM "mulesoft.app.inbound" WHERE "sub_org.id" = \'<orgId>\' AND timestamp BETWEEN <from> AND <to> GROUP BY "app.name"'),
|
|
113
|
+
query: z.string().describe('AMQL query string'),
|
|
264
114
|
limit: z
|
|
265
115
|
.number()
|
|
116
|
+
.int()
|
|
117
|
+
.positive()
|
|
118
|
+
.max(AMQL_MAX_LIMIT)
|
|
266
119
|
.optional()
|
|
267
|
-
.describe(
|
|
268
|
-
|
|
269
|
-
annotations: { readOnlyHint: true },
|
|
270
|
-
}, async ({ query, limit }) => {
|
|
271
|
-
try {
|
|
272
|
-
const data = await client.monitoring.search(query, limit || 200);
|
|
273
|
-
return {
|
|
274
|
-
content: [
|
|
275
|
-
{
|
|
276
|
-
type: 'text',
|
|
277
|
-
text: JSON.stringify({ rowCount: data.length, data }, null, 2),
|
|
278
|
-
},
|
|
279
|
-
],
|
|
280
|
-
};
|
|
281
|
-
}
|
|
282
|
-
catch (error) {
|
|
283
|
-
return mcpError(error);
|
|
284
|
-
}
|
|
285
|
-
});
|
|
286
|
-
server.registerTool('get_memory_timeseries', {
|
|
287
|
-
title: 'Get Memory Usage Time Series',
|
|
288
|
-
description: 'Fetches time-series JVM memory metrics for trending analysis. Returns timestamped buckets with average heap used, heap committed, and GC count per app. Use this to spot memory growth trends, correlate GC spikes with latency, or detect slow memory leaks over time.',
|
|
289
|
-
inputSchema: {
|
|
290
|
-
environment: z
|
|
291
|
-
.string()
|
|
292
|
-
.describe('Environment name (e.g. "Development", "Production") or environment ID'),
|
|
293
|
-
hoursBack: z
|
|
294
|
-
.number()
|
|
295
|
-
.optional()
|
|
296
|
-
.describe('Time window in hours (default: 24). Use 1 for recent, 168 for weekly trends'),
|
|
297
|
-
granularity: z
|
|
298
|
-
.enum(['5m', '15m', '30m', '1h', '1d'])
|
|
299
|
-
.optional()
|
|
300
|
-
.describe('Time bucket size (default: "1h"). Use "5m" for short windows, "1d" for weekly'),
|
|
301
|
-
appName: z
|
|
302
|
-
.string()
|
|
303
|
-
.optional()
|
|
304
|
-
.describe('Filter to a specific application name. Omit to get time series for all apps'),
|
|
120
|
+
.describe(`Rows per page (default: 200, max: ${AMQL_MAX_LIMIT})`),
|
|
121
|
+
offset: z.number().int().min(0).optional().describe('Row offset for paging (default: 0)'),
|
|
305
122
|
},
|
|
306
123
|
annotations: { readOnlyHint: true },
|
|
307
|
-
}, async ({
|
|
124
|
+
}, async ({ query, limit, offset }) => {
|
|
308
125
|
try {
|
|
309
|
-
const
|
|
310
|
-
|
|
311
|
-
const to = Date.now();
|
|
312
|
-
const from = to - (hoursBack || 24) * 60 * 60 * 1000;
|
|
313
|
-
const granularityMap = {
|
|
314
|
-
'5m': 'PT5M',
|
|
315
|
-
'15m': 'PT15M',
|
|
316
|
-
'30m': 'PT30M',
|
|
317
|
-
'1h': 'PT1H',
|
|
318
|
-
'1d': 'P1D',
|
|
319
|
-
};
|
|
320
|
-
const g = granularityMap[granularity || '1h'];
|
|
321
|
-
const data = await client.monitoring.getMemoryTimeSeries(orgId, env.id, from, to, g, appName);
|
|
322
|
-
return {
|
|
323
|
-
content: [
|
|
324
|
-
{
|
|
325
|
-
type: 'text',
|
|
326
|
-
text: JSON.stringify({
|
|
327
|
-
environment: env.name,
|
|
328
|
-
period: { from: new Date(from).toISOString(), to: new Date(to).toISOString() },
|
|
329
|
-
granularity: granularity || '1h',
|
|
330
|
-
dataPoints: data,
|
|
331
|
-
}, null, 2),
|
|
332
|
-
},
|
|
333
|
-
],
|
|
334
|
-
};
|
|
126
|
+
const data = await client.monitoring.search(query, { limit: limit ?? 200, offset });
|
|
127
|
+
return mcpText({ rowCount: data.length, data });
|
|
335
128
|
}
|
|
336
129
|
catch (error) {
|
|
337
130
|
return mcpError(error);
|