mcp-instana 0.2.1__py3-none-any.whl → 0.3.0__py3-none-any.whl
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.
- {mcp_instana-0.2.1.dist-info → mcp_instana-0.3.0.dist-info}/METADATA +2 -1
- {mcp_instana-0.2.1.dist-info → mcp_instana-0.3.0.dist-info}/RECORD +29 -29
- src/application/application_alert_config.py +45 -12
- src/application/application_analyze.py +28 -6
- src/application/application_catalog.py +11 -2
- src/application/application_global_alert_config.py +60 -21
- src/application/application_metrics.py +20 -4
- src/application/application_resources.py +20 -4
- src/application/application_settings.py +111 -35
- src/application/application_topology.py +22 -14
- src/automation/action_catalog.py +165 -188
- src/automation/action_history.py +21 -6
- src/core/server.py +7 -1
- src/core/utils.py +42 -5
- src/event/events_tools.py +30 -7
- src/infrastructure/infrastructure_analyze.py +18 -4
- src/infrastructure/infrastructure_catalog.py +72 -16
- src/infrastructure/infrastructure_metrics.py +5 -1
- src/infrastructure/infrastructure_resources.py +30 -11
- src/infrastructure/infrastructure_topology.py +10 -2
- src/log/log_alert_configuration.py +106 -31
- src/settings/custom_dashboard_tools.py +30 -7
- src/website/website_analyze.py +10 -2
- src/website/website_catalog.py +14 -3
- src/website/website_configuration.py +54 -13
- src/website/website_metrics.py +10 -2
- {mcp_instana-0.2.1.dist-info → mcp_instana-0.3.0.dist-info}/WHEEL +0 -0
- {mcp_instana-0.2.1.dist-info → mcp_instana-0.3.0.dist-info}/entry_points.txt +0 -0
- {mcp_instana-0.2.1.dist-info → mcp_instana-0.3.0.dist-info}/licenses/LICENSE.md +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mcp-instana
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: MCP server for Instana
|
|
5
5
|
Author-email: Elina Priyadarshinee <Elina.priyadarshinee1@ibm.com>, Guangya Liu <gyliu@ibm.com>, Isabell Sippli <ischwert@de.ibm.com>, Jay Sharma <Jay.Sharma3@ibm.com>, Madhu Tadiparthi <madhu.tadiparthi@ibm.com>, Riya Kumari <Riya.Kumari3@ibm.com>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -8,6 +8,7 @@ License-File: LICENSE.md
|
|
|
8
8
|
Requires-Python: >=3.10
|
|
9
9
|
Requires-Dist: fastmcp==2.10.3
|
|
10
10
|
Requires-Dist: instana-client==1.0.0
|
|
11
|
+
Requires-Dist: mcp
|
|
11
12
|
Requires-Dist: pydantic==2.11.7
|
|
12
13
|
Requires-Dist: python-dotenv==1.1.0
|
|
13
14
|
Requires-Dist: requests==2.32.4
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
src/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
src/application/__init__.py,sha256=cfWHjA5NzAvL0jcekaIO3NTe5DRtznYRqg9_8hVwSzc,37
|
|
3
|
-
src/application/application_alert_config.py,sha256=
|
|
4
|
-
src/application/application_analyze.py,sha256=
|
|
5
|
-
src/application/application_catalog.py,sha256=
|
|
6
|
-
src/application/application_global_alert_config.py,sha256=
|
|
7
|
-
src/application/application_metrics.py,sha256=
|
|
8
|
-
src/application/application_resources.py,sha256=
|
|
9
|
-
src/application/application_settings.py,sha256=
|
|
10
|
-
src/application/application_topology.py,sha256=
|
|
11
|
-
src/automation/action_catalog.py,sha256=
|
|
12
|
-
src/automation/action_history.py,sha256=
|
|
3
|
+
src/application/application_alert_config.py,sha256=dbYGzUNZdfcEp_-zLLLm8_AfJZHoSPamLp4eHNYQ42I,31196
|
|
4
|
+
src/application/application_analyze.py,sha256=EXOaGRn8wEoFUltAmAnzFRiTrkLzh7c_RHdP5Nj2-Hk,26947
|
|
5
|
+
src/application/application_catalog.py,sha256=MVjU1CyYf6NSeCt2o0aTlNDAKeMUY3vr-wDOprnt2D8,6540
|
|
6
|
+
src/application/application_global_alert_config.py,sha256=HqBlLLhMmpwy8pJlz9SDkHJ6w1vHH0LD7_LX4YWe7uk,31684
|
|
7
|
+
src/application/application_metrics.py,sha256=swuoMk6fWNbW-IzivxJv8C7CgJie66u9d0JvtZ2jU4Y,15476
|
|
8
|
+
src/application/application_resources.py,sha256=USbIrPnkokUBOiack7EChOTH2vqJM2D0EF-9MjGbn5w,18279
|
|
9
|
+
src/application/application_settings.py,sha256=UZHZwY3GNW4JMl1Q6gGtGCE4iYERR7ijK0hslCYBMTo,76210
|
|
10
|
+
src/application/application_topology.py,sha256=WinVNHSSTF771vq5hl2GxTLm3bdpehAQJ1AMumfy7M0,4870
|
|
11
|
+
src/automation/action_catalog.py,sha256=jivR73riqBt-MGDnhSoEsshG7bHk7JpxvVuRx7FCtOA,17493
|
|
12
|
+
src/automation/action_history.py,sha256=aMHUd5RLMrgdDvJXv0x6dkUA7I_35O0A89RPhFUfORI,16494
|
|
13
13
|
src/core/__init__.py,sha256=gZdGV4TVETqe3XV-_lzQMw0IgyTTCqYYgP3PH9YdWbU,30
|
|
14
|
-
src/core/server.py,sha256
|
|
15
|
-
src/core/utils.py,sha256=
|
|
14
|
+
src/core/server.py,sha256=WvkxAWYBiKdo3mdxoc6v_9SCO8Ij6hS2vCSMSlIvbTY,25022
|
|
15
|
+
src/core/utils.py,sha256=vB2ArNkOy0YIHk8Xv8nYHGEeTpw79pStJz6HL2aHWK8,11527
|
|
16
16
|
src/event/__init__.py,sha256=ru-xCHU9xksGf9aJslvI37-6SI2yoBOpsoaED-vbaaQ,31
|
|
17
|
-
src/event/events_tools.py,sha256=
|
|
17
|
+
src/event/events_tools.py,sha256=R17EYk1jUUIQl5706idtOKzLWWNLchv2fRd-U8S1Uno,42775
|
|
18
18
|
src/infrastructure/__init__.py,sha256=xZuRO1Zb2iPyO5G3PRM90dfesaFheL7DMSSJMujtLVk,40
|
|
19
|
-
src/infrastructure/infrastructure_analyze.py,sha256=
|
|
20
|
-
src/infrastructure/infrastructure_catalog.py,sha256=
|
|
21
|
-
src/infrastructure/infrastructure_metrics.py,sha256=
|
|
22
|
-
src/infrastructure/infrastructure_resources.py,sha256=
|
|
23
|
-
src/infrastructure/infrastructure_topology.py,sha256=
|
|
19
|
+
src/infrastructure/infrastructure_analyze.py,sha256=eBo9Rq7DRzsIKup4LR-ar_1g4kr_IPWeKcHMb-w1hLA,29455
|
|
20
|
+
src/infrastructure/infrastructure_catalog.py,sha256=rE_ySS-MHDwGc_msat6XsxKolgYbduZSnPp4adXFQKM,29827
|
|
21
|
+
src/infrastructure/infrastructure_metrics.py,sha256=he_KAadNp5VAWdDM65ZuDavHOZvwOX4tEuXJYwXjm78,7081
|
|
22
|
+
src/infrastructure/infrastructure_resources.py,sha256=gFxjzGbUdlFXVjbuWKUxC0NEuwkPsZNkrWhnZ2Zd2t0,29297
|
|
23
|
+
src/infrastructure/infrastructure_topology.py,sha256=mVz9jrpjstDNh_iUxZfGo912Ze5I3zH3XlapFIwm_3A,14830
|
|
24
24
|
src/log/__init__.py,sha256=NwPZccMqR5aR6PrISe760gkABtpg7zpbwOK-uMPB-_Y,29
|
|
25
|
-
src/log/log_alert_configuration.py,sha256
|
|
25
|
+
src/log/log_alert_configuration.py,sha256=-8ORRo889n4X4GalwhTQa9uHU4JuERy2OfnhP7k6LOM,18430
|
|
26
26
|
src/prompts/__init__.py,sha256=oXt7rf_EASRtgL43lKRgH8xhX6abJ3fhpHfarIlkFog,405
|
|
27
27
|
src/prompts/application/__init__.py,sha256=9F3sMZpDkAiWi7oQDTd5OM1KBWIdCi2GQCTZlafcIGA,44
|
|
28
28
|
src/prompts/application/application_alerts.py,sha256=1-SRn2mnd8BlT8vXLp7XmcEKUBOo7OxIHQOMCPP7BfQ,1853
|
|
@@ -46,14 +46,14 @@ src/prompts/website/website_catalog.py,sha256=bUIOMuKxtbTFaIrLpDL7soAvsINU9BJJcj
|
|
|
46
46
|
src/prompts/website/website_configuration.py,sha256=d10veq4PwwPuJLxDpZUaObaOZZs2IIOBb-2-_nDNjm0,3694
|
|
47
47
|
src/prompts/website/website_metrics.py,sha256=bJ5A7QuCdDsBiN0byFpTWl2Ir-qIc7mXuQyn80Px83E,1172
|
|
48
48
|
src/settings/__init__.py,sha256=GD1pD_OLXbsJkNfMobByAV04HRKDknrJPyXUkMjZhvc,34
|
|
49
|
-
src/settings/custom_dashboard_tools.py,sha256=
|
|
49
|
+
src/settings/custom_dashboard_tools.py,sha256=HRYqkscf6rZVaGAFLzP5gUYN-aRkpmrRVv-Hq5-UHVo,17739
|
|
50
50
|
src/website/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
51
|
-
src/website/website_analyze.py,sha256=
|
|
52
|
-
src/website/website_catalog.py,sha256=
|
|
53
|
-
src/website/website_configuration.py,sha256=
|
|
54
|
-
src/website/website_metrics.py,sha256=
|
|
55
|
-
mcp_instana-0.
|
|
56
|
-
mcp_instana-0.
|
|
57
|
-
mcp_instana-0.
|
|
58
|
-
mcp_instana-0.
|
|
59
|
-
mcp_instana-0.
|
|
51
|
+
src/website/website_analyze.py,sha256=0VyK8f-9vW1LzZ70b7IxKzwqSL2bWw8wDFSOCx2pEr4,21347
|
|
52
|
+
src/website/website_catalog.py,sha256=Z21urtdTf8sU2SZiCwGq5OyPLaswS9lw12TCD9pS__4,7127
|
|
53
|
+
src/website/website_configuration.py,sha256=hBHSFgj6GXOfLvlq8p-tBU4KFQc99uS167DBz4cjjK0,35926
|
|
54
|
+
src/website/website_metrics.py,sha256=6McxbVYZq5i61Ml3QcVeHS86y2rCIPzdDuUDOxNtnMM,10954
|
|
55
|
+
mcp_instana-0.3.0.dist-info/METADATA,sha256=pBBWf3CzWNzeHE-5yRbEVJZ3ZV5EW2w34sVepEmiyjc,47089
|
|
56
|
+
mcp_instana-0.3.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
57
|
+
mcp_instana-0.3.0.dist-info/entry_points.txt,sha256=p1aZ9Ks0aJKpoIy6Mk-08cGYAfkXMNbwYIlokm513A4,140
|
|
58
|
+
mcp_instana-0.3.0.dist-info/licenses/LICENSE.md,sha256=Ox7lseFP2kBRXBjsLweW1jLmWiCyrKjwF8ZUvCbKd70,11310
|
|
59
|
+
mcp_instana-0.3.0.dist-info/RECORD,,
|
|
@@ -7,6 +7,11 @@ This module provides application alert configuration tools for Instana monitorin
|
|
|
7
7
|
import logging
|
|
8
8
|
from typing import Any, Dict, List, Optional, Union
|
|
9
9
|
|
|
10
|
+
from mcp.types import ToolAnnotations
|
|
11
|
+
|
|
12
|
+
from src.core.utils import BaseInstanaClient, register_as_tool, with_header_auth
|
|
13
|
+
from src.prompts import mcp
|
|
14
|
+
|
|
10
15
|
# Import the necessary classes from the SDK
|
|
11
16
|
try:
|
|
12
17
|
from instana_client.api.application_alert_configuration_api import (
|
|
@@ -18,8 +23,6 @@ except ImportError:
|
|
|
18
23
|
logger.error("Failed to import application alert configuration API", exc_info=True)
|
|
19
24
|
raise
|
|
20
25
|
|
|
21
|
-
from src.core.utils import BaseInstanaClient, register_as_tool, with_header_auth
|
|
22
|
-
|
|
23
26
|
# Configure logger for this module
|
|
24
27
|
logger = logging.getLogger(__name__)
|
|
25
28
|
|
|
@@ -30,7 +33,10 @@ class ApplicationAlertMCPTools(BaseInstanaClient):
|
|
|
30
33
|
"""Initialize the Application Alert MCP tools client."""
|
|
31
34
|
super().__init__(read_token=read_token, base_url=base_url)
|
|
32
35
|
|
|
33
|
-
@register_as_tool
|
|
36
|
+
@register_as_tool(
|
|
37
|
+
title="Find Application Alert Config",
|
|
38
|
+
annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False)
|
|
39
|
+
)
|
|
34
40
|
@with_header_auth(ApplicationAlertConfigurationApi)
|
|
35
41
|
async def find_application_alert_config(self,
|
|
36
42
|
id: str,
|
|
@@ -78,7 +84,10 @@ class ApplicationAlertMCPTools(BaseInstanaClient):
|
|
|
78
84
|
return {"error": f"Failed to get application alert config: {e!s}"}
|
|
79
85
|
|
|
80
86
|
|
|
81
|
-
@register_as_tool
|
|
87
|
+
@register_as_tool(
|
|
88
|
+
title="Find Application Alert Config Versions",
|
|
89
|
+
annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False)
|
|
90
|
+
)
|
|
82
91
|
@with_header_auth(ApplicationAlertConfigurationApi)
|
|
83
92
|
async def find_application_alert_config_versions(self,
|
|
84
93
|
id: str,
|
|
@@ -126,7 +135,10 @@ class ApplicationAlertMCPTools(BaseInstanaClient):
|
|
|
126
135
|
logger.error(f"Error in find_application_alert_config_versions: {e}", exc_info=True)
|
|
127
136
|
return {"error": f"Failed to get application alert config versions: {e!s}"}
|
|
128
137
|
|
|
129
|
-
@register_as_tool
|
|
138
|
+
@register_as_tool(
|
|
139
|
+
title="Get Application Alert Configs",
|
|
140
|
+
annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False)
|
|
141
|
+
)
|
|
130
142
|
@with_header_auth(ApplicationAlertConfigurationApi)
|
|
131
143
|
async def get_application_alert_configs(self,
|
|
132
144
|
application_id: Optional[str] = None,
|
|
@@ -173,7 +185,10 @@ class ApplicationAlertMCPTools(BaseInstanaClient):
|
|
|
173
185
|
logger.error(f"Error in get_application_alert_configs: {e}", exc_info=True)
|
|
174
186
|
return {"error": f"Failed to get application alert configs: {e!s}"}
|
|
175
187
|
|
|
176
|
-
@register_as_tool
|
|
188
|
+
@register_as_tool(
|
|
189
|
+
title="Delete Application Alert Config",
|
|
190
|
+
annotations=ToolAnnotations(readOnlyHint=False, destructiveHint=True)
|
|
191
|
+
)
|
|
177
192
|
@with_header_auth(ApplicationAlertConfigurationApi)
|
|
178
193
|
async def delete_application_alert_config(self,
|
|
179
194
|
id: str,
|
|
@@ -214,7 +229,10 @@ class ApplicationAlertMCPTools(BaseInstanaClient):
|
|
|
214
229
|
logger.error(f"Error in delete_application_alert_config: {e}", exc_info=True)
|
|
215
230
|
return {"error": f"Failed to delete application alert config: {e!s}"}
|
|
216
231
|
|
|
217
|
-
@register_as_tool
|
|
232
|
+
@register_as_tool(
|
|
233
|
+
title="Enable Application Alert Config",
|
|
234
|
+
annotations=ToolAnnotations(readOnlyHint=False, destructiveHint=False)
|
|
235
|
+
)
|
|
218
236
|
@with_header_auth(ApplicationAlertConfigurationApi)
|
|
219
237
|
async def enable_application_alert_config(self,
|
|
220
238
|
id: str,
|
|
@@ -259,7 +277,10 @@ class ApplicationAlertMCPTools(BaseInstanaClient):
|
|
|
259
277
|
logger.error(f"Error in enable_application_alert_config: {e}", exc_info=True)
|
|
260
278
|
return {"error": f"Failed to enable application alert config: {e!s}"}
|
|
261
279
|
|
|
262
|
-
@register_as_tool
|
|
280
|
+
@register_as_tool(
|
|
281
|
+
title="Disable Application Alert Config",
|
|
282
|
+
annotations=ToolAnnotations(readOnlyHint=False, destructiveHint=False)
|
|
283
|
+
)
|
|
263
284
|
@with_header_auth(ApplicationAlertConfigurationApi)
|
|
264
285
|
async def disable_application_alert_config(self,
|
|
265
286
|
id: str,
|
|
@@ -304,7 +325,10 @@ class ApplicationAlertMCPTools(BaseInstanaClient):
|
|
|
304
325
|
logger.error(f"Error in disable_application_alert_config: {e}", exc_info=True)
|
|
305
326
|
return {"error": f"Failed to disable application alert config: {e!s}"}
|
|
306
327
|
|
|
307
|
-
@register_as_tool
|
|
328
|
+
@register_as_tool(
|
|
329
|
+
title="Restore Application Alert Config",
|
|
330
|
+
annotations=ToolAnnotations(readOnlyHint=False, destructiveHint=False)
|
|
331
|
+
)
|
|
308
332
|
@with_header_auth(ApplicationAlertConfigurationApi)
|
|
309
333
|
async def restore_application_alert_config(self,
|
|
310
334
|
id: str,
|
|
@@ -354,7 +378,10 @@ class ApplicationAlertMCPTools(BaseInstanaClient):
|
|
|
354
378
|
logger.error(f"Error in restore_application_alert_config: {e}", exc_info=True)
|
|
355
379
|
return {"error": f"Failed to restore application alert config: {e!s}"}
|
|
356
380
|
|
|
357
|
-
@register_as_tool
|
|
381
|
+
@register_as_tool(
|
|
382
|
+
title="Update Application Alert Config Baseline",
|
|
383
|
+
annotations=ToolAnnotations(readOnlyHint=False, destructiveHint=False)
|
|
384
|
+
)
|
|
358
385
|
@with_header_auth(ApplicationAlertConfigurationApi)
|
|
359
386
|
async def update_application_alert_config_baseline(self,
|
|
360
387
|
id: str,
|
|
@@ -399,7 +426,10 @@ class ApplicationAlertMCPTools(BaseInstanaClient):
|
|
|
399
426
|
logger.error(f"Error in update_application_alert_config_baseline: {e}", exc_info=True)
|
|
400
427
|
return {"error": f"Failed to update application alert config baseline: {e!s}"}
|
|
401
428
|
|
|
402
|
-
@register_as_tool
|
|
429
|
+
@register_as_tool(
|
|
430
|
+
title="Create Application Alert Config",
|
|
431
|
+
annotations=ToolAnnotations(readOnlyHint=False, destructiveHint=False)
|
|
432
|
+
)
|
|
403
433
|
@with_header_auth(ApplicationAlertConfigurationApi)
|
|
404
434
|
async def create_application_alert_config(self,
|
|
405
435
|
payload: Union[Dict[str, Any], str],
|
|
@@ -521,7 +551,10 @@ class ApplicationAlertMCPTools(BaseInstanaClient):
|
|
|
521
551
|
logger.error(f"Error in create_application_alert_config: {e}", exc_info=True)
|
|
522
552
|
return {"error": f"Failed to create application alert config: {e!s}"}
|
|
523
553
|
|
|
524
|
-
@register_as_tool
|
|
554
|
+
@register_as_tool(
|
|
555
|
+
title="Update Application Alert Config",
|
|
556
|
+
annotations=ToolAnnotations(readOnlyHint=False, destructiveHint=False)
|
|
557
|
+
)
|
|
525
558
|
@with_header_auth(ApplicationAlertConfigurationApi)
|
|
526
559
|
async def update_application_alert_config(self,
|
|
527
560
|
id: str,
|
|
@@ -7,6 +7,10 @@ This module provides application analyze tool functionality for Instana monitori
|
|
|
7
7
|
import logging
|
|
8
8
|
from typing import Any, Dict, List, Optional, Union
|
|
9
9
|
|
|
10
|
+
from mcp.types import ToolAnnotations
|
|
11
|
+
|
|
12
|
+
from src.prompts import mcp
|
|
13
|
+
|
|
10
14
|
# Import the necessary classes from the SDK
|
|
11
15
|
try:
|
|
12
16
|
from instana_client.api.application_analyze_api import ApplicationAnalyzeApi
|
|
@@ -50,7 +54,10 @@ class ApplicationAnalyzeMCPTools(BaseInstanaClient):
|
|
|
50
54
|
logger.error(f"Error initializing ApplicationAnalyzeApi: {e}", exc_info=True)
|
|
51
55
|
raise
|
|
52
56
|
|
|
53
|
-
@register_as_tool
|
|
57
|
+
@register_as_tool(
|
|
58
|
+
title="Get Call Details",
|
|
59
|
+
annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False)
|
|
60
|
+
)
|
|
54
61
|
@with_header_auth(ApplicationAnalyzeApi)
|
|
55
62
|
async def get_call_details(
|
|
56
63
|
self,
|
|
@@ -97,7 +104,10 @@ class ApplicationAnalyzeMCPTools(BaseInstanaClient):
|
|
|
97
104
|
logger.error(f"Error getting call details: {e}", exc_info=True)
|
|
98
105
|
return {"error": f"Failed to get call details: {e!s}"}
|
|
99
106
|
|
|
100
|
-
@register_as_tool
|
|
107
|
+
@register_as_tool(
|
|
108
|
+
title="Get Trace Details",
|
|
109
|
+
annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False)
|
|
110
|
+
)
|
|
101
111
|
@with_header_auth(ApplicationAnalyzeApi)
|
|
102
112
|
async def get_trace_details(
|
|
103
113
|
self,
|
|
@@ -159,7 +169,10 @@ class ApplicationAnalyzeMCPTools(BaseInstanaClient):
|
|
|
159
169
|
return {"error": f"Failed to get trace details: {e!s}"}
|
|
160
170
|
|
|
161
171
|
|
|
162
|
-
@register_as_tool
|
|
172
|
+
@register_as_tool(
|
|
173
|
+
title="Get All Traces",
|
|
174
|
+
annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False)
|
|
175
|
+
)
|
|
163
176
|
@with_header_auth(ApplicationAnalyzeApi)
|
|
164
177
|
async def get_all_traces(
|
|
165
178
|
self,
|
|
@@ -287,7 +300,10 @@ class ApplicationAnalyzeMCPTools(BaseInstanaClient):
|
|
|
287
300
|
logger.error(f"Error in get_traces: {e}")
|
|
288
301
|
return {"error": f"Failed to get traces: {e!s}"}
|
|
289
302
|
|
|
290
|
-
@register_as_tool
|
|
303
|
+
@register_as_tool(
|
|
304
|
+
title="Get Grouped Trace Metrics",
|
|
305
|
+
annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False)
|
|
306
|
+
)
|
|
291
307
|
@with_header_auth(ApplicationAnalyzeApi)
|
|
292
308
|
async def get_grouped_trace_metrics(
|
|
293
309
|
self,
|
|
@@ -431,7 +447,10 @@ class ApplicationAnalyzeMCPTools(BaseInstanaClient):
|
|
|
431
447
|
logger.error(f"Error in get_grouped_trace_metrics: {e}")
|
|
432
448
|
return {"error": f"Failed to get grouped trace metrics: {e!s}"}
|
|
433
449
|
|
|
434
|
-
@register_as_tool
|
|
450
|
+
@register_as_tool(
|
|
451
|
+
title="Get Grouped Calls Metrics",
|
|
452
|
+
annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False)
|
|
453
|
+
)
|
|
435
454
|
@with_header_auth(ApplicationAnalyzeApi)
|
|
436
455
|
async def get_grouped_calls_metrics(
|
|
437
456
|
self,
|
|
@@ -585,7 +604,10 @@ class ApplicationAnalyzeMCPTools(BaseInstanaClient):
|
|
|
585
604
|
return {"error": f"Failed to get grouped call: {e!s}"}
|
|
586
605
|
|
|
587
606
|
|
|
588
|
-
@register_as_tool
|
|
607
|
+
@register_as_tool(
|
|
608
|
+
title="Get Correlated Traces",
|
|
609
|
+
annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False)
|
|
610
|
+
)
|
|
589
611
|
@with_header_auth(ApplicationAnalyzeApi)
|
|
590
612
|
async def get_correlated_traces(
|
|
591
613
|
self,
|
|
@@ -11,11 +11,14 @@ import traceback
|
|
|
11
11
|
from datetime import datetime, timedelta
|
|
12
12
|
from typing import Any, Dict, Optional
|
|
13
13
|
|
|
14
|
+
from mcp.types import ToolAnnotations
|
|
15
|
+
|
|
14
16
|
from src.core.utils import (
|
|
15
17
|
BaseInstanaClient,
|
|
16
18
|
register_as_tool,
|
|
17
19
|
with_header_auth,
|
|
18
20
|
)
|
|
21
|
+
from src.prompts import mcp
|
|
19
22
|
|
|
20
23
|
try:
|
|
21
24
|
from instana_client.api.application_catalog_api import (
|
|
@@ -38,7 +41,10 @@ class ApplicationCatalogMCPTools(BaseInstanaClient):
|
|
|
38
41
|
"""Initialize the Application Catalog MCP tools client."""
|
|
39
42
|
super().__init__(read_token=read_token, base_url=base_url)
|
|
40
43
|
|
|
41
|
-
@register_as_tool
|
|
44
|
+
@register_as_tool(
|
|
45
|
+
title="Get Application Tag Catalog",
|
|
46
|
+
annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False)
|
|
47
|
+
)
|
|
42
48
|
@with_header_auth(ApplicationCatalogApi)
|
|
43
49
|
async def get_application_tag_catalog(self,
|
|
44
50
|
use_case: Optional[str] = None,
|
|
@@ -106,7 +112,10 @@ class ApplicationCatalogMCPTools(BaseInstanaClient):
|
|
|
106
112
|
return {"error": f"Failed to get application catalog: {e!s}"}
|
|
107
113
|
|
|
108
114
|
|
|
109
|
-
@register_as_tool
|
|
115
|
+
@register_as_tool(
|
|
116
|
+
title="Get Application Metric Catalog",
|
|
117
|
+
annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False)
|
|
118
|
+
)
|
|
110
119
|
@with_header_auth(ApplicationCatalogApi)
|
|
111
120
|
async def get_application_metric_catalog(self, ctx=None, api_client=None) -> Dict[str, Any]:
|
|
112
121
|
"""
|
|
@@ -7,6 +7,11 @@ This module provides application alert configuration tools for Instana monitorin
|
|
|
7
7
|
import logging
|
|
8
8
|
from typing import Any, Dict, List, Optional, Union
|
|
9
9
|
|
|
10
|
+
from mcp.types import ToolAnnotations
|
|
11
|
+
|
|
12
|
+
from src.core.utils import BaseInstanaClient, register_as_tool, with_header_auth
|
|
13
|
+
from src.prompts import mcp
|
|
14
|
+
|
|
10
15
|
# Import the necessary classes from the SDK
|
|
11
16
|
try:
|
|
12
17
|
from instana_client.api.global_application_alert_configuration_api import (
|
|
@@ -18,8 +23,6 @@ except ImportError:
|
|
|
18
23
|
logger.error("Failed to import application alert configuration API", exc_info=True)
|
|
19
24
|
raise
|
|
20
25
|
|
|
21
|
-
from src.core.utils import BaseInstanaClient, register_as_tool, with_header_auth
|
|
22
|
-
|
|
23
26
|
# Configure logger for this module
|
|
24
27
|
logger = logging.getLogger(__name__)
|
|
25
28
|
|
|
@@ -30,12 +33,15 @@ class ApplicationGlobalAlertMCPTools(BaseInstanaClient):
|
|
|
30
33
|
"""Initialize the Application Alert MCP tools client."""
|
|
31
34
|
super().__init__(read_token=read_token, base_url=base_url)
|
|
32
35
|
|
|
33
|
-
@register_as_tool
|
|
36
|
+
@register_as_tool(
|
|
37
|
+
title="Find Active Global Application Alert Configs",
|
|
38
|
+
annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False)
|
|
39
|
+
)
|
|
34
40
|
@with_header_auth(GlobalApplicationAlertConfigurationApi)
|
|
35
41
|
async def find_active_global_application_alert_configs(self,
|
|
36
42
|
application_id: str,
|
|
37
43
|
alert_ids: Optional[List[str]] = None,
|
|
38
|
-
ctx=None, api_client=None) -> Dict[str, Any]:
|
|
44
|
+
ctx=None, api_client=None) -> List[Dict[str, Any]]:
|
|
39
45
|
"""
|
|
40
46
|
Get All Global Smart Alert Configuration.
|
|
41
47
|
|
|
@@ -57,7 +63,7 @@ class ApplicationGlobalAlertMCPTools(BaseInstanaClient):
|
|
|
57
63
|
|
|
58
64
|
# Validate required parameters
|
|
59
65
|
if not application_id:
|
|
60
|
-
return {"error": "application_id is required"}
|
|
66
|
+
return [{"error": "application_id is required"}]
|
|
61
67
|
|
|
62
68
|
# Call the find_active_global_application_alert_configs method from the SDK
|
|
63
69
|
logger.debug(f"Calling find_active_global_application_alert_configs with application_id={application_id}, alert_ids={alert_ids}")
|
|
@@ -66,21 +72,33 @@ class ApplicationGlobalAlertMCPTools(BaseInstanaClient):
|
|
|
66
72
|
alert_ids=alert_ids
|
|
67
73
|
)
|
|
68
74
|
|
|
69
|
-
# Convert the result to a
|
|
70
|
-
if
|
|
71
|
-
|
|
75
|
+
# Convert the result to a list format
|
|
76
|
+
if isinstance(result, list):
|
|
77
|
+
# If it's already a list, convert each item to dict if needed
|
|
78
|
+
result_list = []
|
|
79
|
+
for item in result:
|
|
80
|
+
if hasattr(item, 'to_dict'):
|
|
81
|
+
result_list.append(item.to_dict())
|
|
82
|
+
else:
|
|
83
|
+
result_list.append(item)
|
|
84
|
+
elif hasattr(result, 'to_dict'):
|
|
85
|
+
# If it's a single object, wrap it in a list
|
|
86
|
+
result_list = [result.to_dict()]
|
|
72
87
|
else:
|
|
73
|
-
# If it's already a dict or
|
|
74
|
-
|
|
88
|
+
# If it's already a dict or other format, wrap it in a list
|
|
89
|
+
result_list = [result] if result else []
|
|
75
90
|
|
|
76
|
-
logger.debug(f"Result from find_active_global_application_alert_configs: {
|
|
77
|
-
return
|
|
91
|
+
logger.debug(f"Result from find_active_global_application_alert_configs: {result_list}")
|
|
92
|
+
return result_list
|
|
78
93
|
except Exception as e:
|
|
79
94
|
logger.error(f"Error in find_active_global_application_alert_configs: {e}", exc_info=True)
|
|
80
|
-
return {"error": f"Failed to get active global application alert config: {e!s}"}
|
|
95
|
+
return [{"error": f"Failed to get active global application alert config: {e!s}"}]
|
|
81
96
|
|
|
82
97
|
|
|
83
|
-
@register_as_tool
|
|
98
|
+
@register_as_tool(
|
|
99
|
+
title="Find Global Application Alert Config Versions",
|
|
100
|
+
annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False)
|
|
101
|
+
)
|
|
84
102
|
@with_header_auth(GlobalApplicationAlertConfigurationApi)
|
|
85
103
|
async def find_global_application_alert_config_versions(self,
|
|
86
104
|
id: str,
|
|
@@ -128,7 +146,10 @@ class ApplicationGlobalAlertMCPTools(BaseInstanaClient):
|
|
|
128
146
|
logger.error(f"Error in find_global_application_alert_config_versions: {e}", exc_info=True)
|
|
129
147
|
return {"error": f"Failed to get global application alert config versions: {e!s}"}
|
|
130
148
|
|
|
131
|
-
@register_as_tool
|
|
149
|
+
@register_as_tool(
|
|
150
|
+
title="Find Global Application Alert Config",
|
|
151
|
+
annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False)
|
|
152
|
+
)
|
|
132
153
|
@with_header_auth(GlobalApplicationAlertConfigurationApi)
|
|
133
154
|
async def find_global_application_alert_config(self,
|
|
134
155
|
id: Optional[str] = None,
|
|
@@ -174,7 +195,10 @@ class ApplicationGlobalAlertMCPTools(BaseInstanaClient):
|
|
|
174
195
|
logger.error(f"Error in find_global_application_alert_config: {e}", exc_info=True)
|
|
175
196
|
return {"error": f"Failed to get global application alert configs: {e!s}"}
|
|
176
197
|
|
|
177
|
-
@register_as_tool
|
|
198
|
+
@register_as_tool(
|
|
199
|
+
title="Delete Global Application Alert Config",
|
|
200
|
+
annotations=ToolAnnotations(readOnlyHint=False, destructiveHint=True)
|
|
201
|
+
)
|
|
178
202
|
@with_header_auth(GlobalApplicationAlertConfigurationApi)
|
|
179
203
|
async def delete_global_application_alert_config(self,
|
|
180
204
|
id: str,
|
|
@@ -215,7 +239,10 @@ class ApplicationGlobalAlertMCPTools(BaseInstanaClient):
|
|
|
215
239
|
logger.error(f"Error in delete_global_application_alert_config: {e}", exc_info=True)
|
|
216
240
|
return {"error": f"Failed to delete global application alert config: {e!s}"}
|
|
217
241
|
|
|
218
|
-
@register_as_tool
|
|
242
|
+
@register_as_tool(
|
|
243
|
+
title="Enable Global Application Alert Config",
|
|
244
|
+
annotations=ToolAnnotations(readOnlyHint=False, destructiveHint=False)
|
|
245
|
+
)
|
|
219
246
|
@with_header_auth(GlobalApplicationAlertConfigurationApi)
|
|
220
247
|
async def enable_global_application_alert_config(self,
|
|
221
248
|
id: str,
|
|
@@ -260,7 +287,10 @@ class ApplicationGlobalAlertMCPTools(BaseInstanaClient):
|
|
|
260
287
|
logger.error(f"Error in enable_global_application_alert_config: {e}", exc_info=True)
|
|
261
288
|
return {"error": f"Failed to enable global application alert config: {e!s}"}
|
|
262
289
|
|
|
263
|
-
@register_as_tool
|
|
290
|
+
@register_as_tool(
|
|
291
|
+
title="Disable Global Application Alert Config",
|
|
292
|
+
annotations=ToolAnnotations(readOnlyHint=False, destructiveHint=False)
|
|
293
|
+
)
|
|
264
294
|
@with_header_auth(GlobalApplicationAlertConfigurationApi)
|
|
265
295
|
async def disable_global_application_alert_config(self,
|
|
266
296
|
id: str,
|
|
@@ -305,7 +335,10 @@ class ApplicationGlobalAlertMCPTools(BaseInstanaClient):
|
|
|
305
335
|
logger.error(f"Error in disable_global_application_alert_config: {e}", exc_info=True)
|
|
306
336
|
return {"error": f"Failed to disable global application alert config: {e!s}"}
|
|
307
337
|
|
|
308
|
-
@register_as_tool
|
|
338
|
+
@register_as_tool(
|
|
339
|
+
title="Restore Global Application Alert Config",
|
|
340
|
+
annotations=ToolAnnotations(readOnlyHint=False, destructiveHint=False)
|
|
341
|
+
)
|
|
309
342
|
@with_header_auth(GlobalApplicationAlertConfigurationApi)
|
|
310
343
|
async def restore_global_application_alert_config(self,
|
|
311
344
|
id: str,
|
|
@@ -355,7 +388,10 @@ class ApplicationGlobalAlertMCPTools(BaseInstanaClient):
|
|
|
355
388
|
logger.error(f"Error in restore_global_application_alert_config: {e}", exc_info=True)
|
|
356
389
|
return {"error": f"Failed to restore global application alert config: {e!s}"}
|
|
357
390
|
|
|
358
|
-
@register_as_tool
|
|
391
|
+
@register_as_tool(
|
|
392
|
+
title="Create Global Application Alert Config",
|
|
393
|
+
annotations=ToolAnnotations(readOnlyHint=False, destructiveHint=False)
|
|
394
|
+
)
|
|
359
395
|
@with_header_auth(GlobalApplicationAlertConfigurationApi)
|
|
360
396
|
async def create_global_application_alert_config(self,
|
|
361
397
|
payload: Union[Dict[str, Any], str],
|
|
@@ -497,7 +533,10 @@ class ApplicationGlobalAlertMCPTools(BaseInstanaClient):
|
|
|
497
533
|
logger.error(f"Error in create_global_application_alert_config: {e}", exc_info=True)
|
|
498
534
|
return {"error": f"Failed to create global application alert config: {e!s}"}
|
|
499
535
|
|
|
500
|
-
@register_as_tool
|
|
536
|
+
@register_as_tool(
|
|
537
|
+
title="Update Global Application Alert Config",
|
|
538
|
+
annotations=ToolAnnotations(readOnlyHint=False, destructiveHint=False)
|
|
539
|
+
)
|
|
501
540
|
@with_header_auth(GlobalApplicationAlertConfigurationApi)
|
|
502
541
|
async def update_global_application_alert_config(self,
|
|
503
542
|
id: str,
|
|
@@ -8,6 +8,10 @@ import logging
|
|
|
8
8
|
from datetime import datetime
|
|
9
9
|
from typing import Any, Dict, List, Optional
|
|
10
10
|
|
|
11
|
+
from mcp.types import ToolAnnotations
|
|
12
|
+
|
|
13
|
+
from src.prompts import mcp
|
|
14
|
+
|
|
11
15
|
# Import the necessary classes from the SDK
|
|
12
16
|
try:
|
|
13
17
|
from instana_client.api.application_metrics_api import (
|
|
@@ -37,7 +41,10 @@ class ApplicationMetricsMCPTools(BaseInstanaClient):
|
|
|
37
41
|
"""Initialize the Application Metrics MCP tools client."""
|
|
38
42
|
super().__init__(read_token=read_token, base_url=base_url)
|
|
39
43
|
|
|
40
|
-
@register_as_tool
|
|
44
|
+
@register_as_tool(
|
|
45
|
+
title="Get Application Data Metrics V2",
|
|
46
|
+
annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False)
|
|
47
|
+
)
|
|
41
48
|
@with_header_auth(ApplicationMetricsApi)
|
|
42
49
|
async def get_application_data_metrics_v2(self,
|
|
43
50
|
metrics: Optional[List[Dict[str, Any]]] = None,
|
|
@@ -121,7 +128,10 @@ class ApplicationMetricsMCPTools(BaseInstanaClient):
|
|
|
121
128
|
logger.error(f"Error in get_application_data_metrics_v2: {e}", exc_info=True)
|
|
122
129
|
return {"error": f"Failed to get application data metrics: {e!s}"}
|
|
123
130
|
|
|
124
|
-
@register_as_tool
|
|
131
|
+
@register_as_tool(
|
|
132
|
+
title="Get Application Metrics",
|
|
133
|
+
annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False)
|
|
134
|
+
)
|
|
125
135
|
@with_header_auth(ApplicationMetricsApi)
|
|
126
136
|
async def get_application_metrics(self,
|
|
127
137
|
application_ids: Optional[List[str]] = None,
|
|
@@ -199,7 +209,10 @@ class ApplicationMetricsMCPTools(BaseInstanaClient):
|
|
|
199
209
|
logger.error(f"Error in get_application_metrics: {e}", exc_info=True)
|
|
200
210
|
return {"error": f"Failed to get application metrics: {e!s}"}
|
|
201
211
|
|
|
202
|
-
@register_as_tool
|
|
212
|
+
@register_as_tool(
|
|
213
|
+
title="Get Endpoints Metrics",
|
|
214
|
+
annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False)
|
|
215
|
+
)
|
|
203
216
|
@with_header_auth(ApplicationMetricsApi)
|
|
204
217
|
async def get_endpoints_metrics(self,
|
|
205
218
|
endpoint_ids: Optional[List[str]] = None,
|
|
@@ -277,7 +290,10 @@ class ApplicationMetricsMCPTools(BaseInstanaClient):
|
|
|
277
290
|
logger.error(f"Error in get_endpoints_metrics: {e}", exc_info=True)
|
|
278
291
|
return {"error": f"Failed to get endpoints metrics: {e!s}"}
|
|
279
292
|
|
|
280
|
-
@register_as_tool
|
|
293
|
+
@register_as_tool(
|
|
294
|
+
title="Get Services Metrics",
|
|
295
|
+
annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False)
|
|
296
|
+
)
|
|
281
297
|
@with_header_auth(ApplicationMetricsApi)
|
|
282
298
|
async def get_services_metrics(self,
|
|
283
299
|
service_ids: Optional[List[str]] = None,
|
|
@@ -8,6 +8,10 @@ import logging
|
|
|
8
8
|
from datetime import datetime
|
|
9
9
|
from typing import Any, Dict, List, Optional
|
|
10
10
|
|
|
11
|
+
from mcp.types import ToolAnnotations
|
|
12
|
+
|
|
13
|
+
from src.prompts import mcp
|
|
14
|
+
|
|
11
15
|
# Import the necessary classes from the SDK
|
|
12
16
|
try:
|
|
13
17
|
from instana_client.api.application_resources_api import (
|
|
@@ -32,7 +36,10 @@ class ApplicationResourcesMCPTools(BaseInstanaClient):
|
|
|
32
36
|
"""Initialize the Application Resources MCP tools client."""
|
|
33
37
|
super().__init__(read_token=read_token, base_url=base_url)
|
|
34
38
|
|
|
35
|
-
@register_as_tool
|
|
39
|
+
@register_as_tool(
|
|
40
|
+
title="Get Application Endpoints",
|
|
41
|
+
annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False)
|
|
42
|
+
)
|
|
36
43
|
@with_header_auth(ApplicationResourcesApi)
|
|
37
44
|
async def get_application_endpoints(self,
|
|
38
45
|
name_filter: Optional[str] = None,
|
|
@@ -99,7 +106,10 @@ class ApplicationResourcesMCPTools(BaseInstanaClient):
|
|
|
99
106
|
logger.error(f"Error in get_application_endpoints: {e}", exc_info=True)
|
|
100
107
|
return {"error": f"Failed to get application endpoints: {e!s}"}
|
|
101
108
|
|
|
102
|
-
@register_as_tool
|
|
109
|
+
@register_as_tool(
|
|
110
|
+
title="Get Application Services",
|
|
111
|
+
annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False)
|
|
112
|
+
)
|
|
103
113
|
@with_header_auth(ApplicationResourcesApi)
|
|
104
114
|
async def get_application_services(self,
|
|
105
115
|
name_filter: Optional[str] = None,
|
|
@@ -203,7 +213,10 @@ class ApplicationResourcesMCPTools(BaseInstanaClient):
|
|
|
203
213
|
return {"error": f"Failed to get application services: {e!s}"}
|
|
204
214
|
|
|
205
215
|
|
|
206
|
-
@register_as_tool
|
|
216
|
+
@register_as_tool(
|
|
217
|
+
title="Get Applications",
|
|
218
|
+
annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False)
|
|
219
|
+
)
|
|
207
220
|
@with_header_auth(ApplicationResourcesApi)
|
|
208
221
|
async def get_applications(self,
|
|
209
222
|
name_filter: Optional[str] = None,
|
|
@@ -282,7 +295,10 @@ class ApplicationResourcesMCPTools(BaseInstanaClient):
|
|
|
282
295
|
return [f"Error: Failed to get applications: {e!s}"]
|
|
283
296
|
|
|
284
297
|
|
|
285
|
-
@register_as_tool
|
|
298
|
+
@register_as_tool(
|
|
299
|
+
title="Get Services",
|
|
300
|
+
annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False)
|
|
301
|
+
)
|
|
286
302
|
@with_header_auth(ApplicationResourcesApi)
|
|
287
303
|
async def get_services(self,
|
|
288
304
|
name_filter: Optional[str] = None,
|