mcp-instana 0.2.1__py3-none-any.whl → 0.3.1__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.1.dist-info}/METADATA +69 -40
- {mcp_instana-0.2.1.dist-info → mcp_instana-0.3.1.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.1.dist-info}/WHEEL +0 -0
- {mcp_instana-0.2.1.dist-info → mcp_instana-0.3.1.dist-info}/entry_points.txt +0 -0
- {mcp_instana-0.2.1.dist-info → mcp_instana-0.3.1.dist-info}/licenses/LICENSE.md +0 -0
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mcp-instana
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.1
|
|
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
|
|
7
7
|
License-File: LICENSE.md
|
|
8
8
|
Requires-Python: >=3.10
|
|
9
9
|
Requires-Dist: fastmcp==2.10.3
|
|
10
|
-
Requires-Dist: instana-client==1.0.
|
|
10
|
+
Requires-Dist: instana-client==1.0.1
|
|
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
|
|
@@ -23,6 +24,7 @@ Description-Content-Type: text/markdown
|
|
|
23
24
|
|
|
24
25
|
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
|
25
26
|
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
|
27
|
+
<!-- mcp-name: io.github.instana/mcp-instana -->
|
|
26
28
|
**Table of Contents**
|
|
27
29
|
|
|
28
30
|
- [MCP Server for IBM Instana](#mcp-server-for-ibm-instana)
|
|
@@ -77,6 +79,10 @@ Description-Content-Type: text/markdown
|
|
|
77
79
|
- [**Basic Usage**](#basic-usage)
|
|
78
80
|
- [**Environment Variables**](#environment-variables)
|
|
79
81
|
- [**Docker Compose Example**](#docker-compose-example)
|
|
82
|
+
- [Multi-Architecture Support](#multi-architecture-support)
|
|
83
|
+
- [**Supported Architectures**](#supported-architectures)
|
|
84
|
+
- [**Benefits of Multi-Architecture Images**](#benefits-of-multi-architecture-images)
|
|
85
|
+
- [**How It Works**](#how-it-works)
|
|
80
86
|
- [Docker Security Features](#docker-security-features)
|
|
81
87
|
- [**Security Best Practices Implemented**](#security-best-practices-implemented)
|
|
82
88
|
- [**Image Size Optimization**](#image-size-optimization)
|
|
@@ -1023,16 +1029,40 @@ The project uses a **two-file dependency management strategy**:
|
|
|
1023
1029
|
#### **Prerequisites**
|
|
1024
1030
|
- Docker installed and running
|
|
1025
1031
|
- Access to the project source code
|
|
1032
|
+
- Docker BuildKit for multi-architecture builds (enabled by default in recent Docker versions)
|
|
1026
1033
|
|
|
1027
1034
|
#### **Build Command**
|
|
1035
|
+
|
|
1036
|
+
**Single Architecture Build (Default):**
|
|
1028
1037
|
```bash
|
|
1029
|
-
# Build
|
|
1030
|
-
docker build -t mcp-instana .
|
|
1038
|
+
# Build for your local architecture (automatic detection)
|
|
1039
|
+
docker build -t mcp-instana:latest .
|
|
1031
1040
|
|
|
1032
1041
|
# Build with a specific tag
|
|
1033
1042
|
docker build -t mcp-instana:v1.0.0 .
|
|
1034
1043
|
```
|
|
1035
1044
|
|
|
1045
|
+
**Multi-Architecture Build:**
|
|
1046
|
+
```bash
|
|
1047
|
+
# Set up Docker BuildKit builder if you haven't already
|
|
1048
|
+
docker buildx create --name multiarch --driver docker-container --use
|
|
1049
|
+
|
|
1050
|
+
# Build and push a multi-architecture image to a registry
|
|
1051
|
+
docker buildx build --platform linux/amd64,linux/arm64 -t username/mcp-instana:latest --push .
|
|
1052
|
+
```
|
|
1053
|
+
|
|
1054
|
+
**Using the Helper Script:**
|
|
1055
|
+
```bash
|
|
1056
|
+
# Make the script executable
|
|
1057
|
+
chmod +x build_multiarch.sh
|
|
1058
|
+
|
|
1059
|
+
# Build for local architecture
|
|
1060
|
+
./build_multiarch.sh
|
|
1061
|
+
|
|
1062
|
+
# Build and push multi-architecture image
|
|
1063
|
+
./build_multiarch.sh --registry username/ --push
|
|
1064
|
+
```
|
|
1065
|
+
|
|
1036
1066
|
#### **What the Build Does**
|
|
1037
1067
|
1. **Multi-stage build** for optimal size and security
|
|
1038
1068
|
2. **Builder stage**: Installs only runtime dependencies from `pyproject-runtime.toml`
|
|
@@ -1044,27 +1074,14 @@ docker build -t mcp-instana:v1.0.0 .
|
|
|
1044
1074
|
|
|
1045
1075
|
#### **Basic Usage**
|
|
1046
1076
|
```bash
|
|
1047
|
-
# Run
|
|
1048
|
-
docker run -p 8080:8080
|
|
1049
|
-
-e INSTANA_API_TOKEN=your_instana_token \
|
|
1050
|
-
-e INSTANA_BASE_URL=https://your-instana-instance.instana.io \
|
|
1051
|
-
mcp-instana
|
|
1077
|
+
# Run the container (no credentials needed in the container)
|
|
1078
|
+
docker run -p 8080:8080 mcp-instana
|
|
1052
1079
|
|
|
1053
1080
|
# Run with custom port
|
|
1054
|
-
docker run -p 8081:8080
|
|
1055
|
-
-e INSTANA_API_TOKEN=your_instana_token \
|
|
1056
|
-
-e INSTANA_BASE_URL=https://your-instana-instance.instana.io \
|
|
1057
|
-
mcp-instana
|
|
1081
|
+
docker run -p 8081:8080 mcp-instana
|
|
1058
1082
|
```
|
|
1059
1083
|
|
|
1060
|
-
#### **Environment Variables**
|
|
1061
|
-
The container requires the following environment variables:
|
|
1062
1084
|
|
|
1063
|
-
| Variable | Description | Example |
|
|
1064
|
-
|----------|-------------|---------|
|
|
1065
|
-
| `INSTANA_API_TOKEN` | Your Instana API token | `your_instana_token` |
|
|
1066
|
-
| `INSTANA_BASE_URL` | Your Instana instance URL | `https://your-instana-instance.instana.io` |
|
|
1067
|
-
| `PORT` | Server port (optional, defaults to 8080) | `8080` |
|
|
1068
1085
|
|
|
1069
1086
|
#### **Docker Compose Example**
|
|
1070
1087
|
```yaml
|
|
@@ -1074,9 +1091,6 @@ services:
|
|
|
1074
1091
|
build: .
|
|
1075
1092
|
ports:
|
|
1076
1093
|
- "8080:8080"
|
|
1077
|
-
environment:
|
|
1078
|
-
- INSTANA_API_TOKEN=${INSTANA_API_TOKEN}
|
|
1079
|
-
- INSTANA_BASE_URL=${INSTANA_BASE_URL}
|
|
1080
1094
|
restart: unless-stopped
|
|
1081
1095
|
healthcheck:
|
|
1082
1096
|
test: ["CMD", "python", "-c", "import requests; requests.get('http://127.0.0.1:8080/health', timeout=5)"]
|
|
@@ -1086,15 +1100,35 @@ services:
|
|
|
1086
1100
|
start_period: 40s
|
|
1087
1101
|
```
|
|
1088
1102
|
|
|
1103
|
+
### Multi-Architecture Support
|
|
1104
|
+
|
|
1105
|
+
The Docker image supports multiple processor architectures, making it portable across different environments:
|
|
1106
|
+
|
|
1107
|
+
#### **Supported Architectures**
|
|
1108
|
+
- ✅ **amd64/x86_64**: Standard Intel/AMD processors (Windows, Linux, most cloud VMs)
|
|
1109
|
+
- ✅ **arm64/aarch64**: Apple Silicon (M1/M2/M3), AWS Graviton, Raspberry Pi 4, etc.
|
|
1110
|
+
|
|
1111
|
+
#### **Benefits of Multi-Architecture Images**
|
|
1112
|
+
- **Cross-Platform Compatibility**: Run the same image on any supported architecture
|
|
1113
|
+
- **Seamless Deployment**: No need to build different images for different environments
|
|
1114
|
+
- **CI/CD Simplification**: Build once, deploy anywhere
|
|
1115
|
+
- **Cloud Flexibility**: Switch between cloud providers and instance types without rebuilding images
|
|
1116
|
+
|
|
1117
|
+
#### **How It Works**
|
|
1118
|
+
1. The multi-architecture image is a "manifest list" containing images for each architecture
|
|
1119
|
+
2. When you pull the image, Docker automatically selects the correct architecture for your system
|
|
1120
|
+
3. The image runs natively on your architecture without emulation, ensuring optimal performance
|
|
1121
|
+
|
|
1089
1122
|
### Docker Security Features
|
|
1090
1123
|
|
|
1091
1124
|
#### **Security Best Practices Implemented**
|
|
1092
1125
|
- ✅ **Non-root user**: Container runs as `mcpuser` (not root)
|
|
1093
|
-
- ✅ **No
|
|
1126
|
+
- ✅ **No secrets in container**: Credentials are passed via HTTP headers from clients, not stored in the container
|
|
1094
1127
|
- ✅ **Minimal dependencies**: Only 20 essential runtime dependencies
|
|
1095
1128
|
- ✅ **Multi-stage build**: Build tools don't make it to final image
|
|
1096
1129
|
- ✅ **Health checks**: Built-in container health monitoring
|
|
1097
1130
|
- ✅ **Optimized base image**: Uses `python:3.11-slim`
|
|
1131
|
+
- ✅ **Multi-architecture support**: Run natively on any supported platform
|
|
1098
1132
|
|
|
1099
1133
|
#### **Image Size Optimization**
|
|
1100
1134
|
- **Original approach**: 95+ dependencies → ~1-2GB+ image
|
|
@@ -1134,11 +1168,12 @@ docker exec -it <container_id> /bin/bash
|
|
|
1134
1168
|
### Production Deployment
|
|
1135
1169
|
|
|
1136
1170
|
#### **Recommended Production Setup**
|
|
1137
|
-
1. **
|
|
1138
|
-
2. **
|
|
1139
|
-
3. **
|
|
1140
|
-
4. **
|
|
1141
|
-
5. **
|
|
1171
|
+
1. **Run container without credentials** - The container runs in Streamable HTTP mode, so no Instana credentials are needed in the container
|
|
1172
|
+
2. **Configure clients with credentials** - Pass Instana credentials via HTTP headers from MCP clients (Claude Desktop, GitHub Copilot, etc.)
|
|
1173
|
+
3. **Set up proper logging** and monitoring
|
|
1174
|
+
4. **Configure health checks** for container orchestration
|
|
1175
|
+
5. **Use container orchestration** (Kubernetes, Docker Swarm, etc.)
|
|
1176
|
+
6. **Implement proper backup** and disaster recovery
|
|
1142
1177
|
|
|
1143
1178
|
#### **Kubernetes Example**
|
|
1144
1179
|
```yaml
|
|
@@ -1161,14 +1196,6 @@ spec:
|
|
|
1161
1196
|
image: mcp-instana:latest
|
|
1162
1197
|
ports:
|
|
1163
1198
|
- containerPort: 8080
|
|
1164
|
-
env:
|
|
1165
|
-
- name: INSTANA_API_TOKEN
|
|
1166
|
-
valueFrom:
|
|
1167
|
-
secretKeyRef:
|
|
1168
|
-
name: instana-secrets
|
|
1169
|
-
key: api-token
|
|
1170
|
-
- name: INSTANA_BASE_URL
|
|
1171
|
-
value: "https://your-instana-instance.instana.io"
|
|
1172
1199
|
livenessProbe:
|
|
1173
1200
|
httpGet:
|
|
1174
1201
|
path: /health
|
|
@@ -1193,9 +1220,11 @@ spec:
|
|
|
1193
1220
|
docker logs <container_id>
|
|
1194
1221
|
|
|
1195
1222
|
# Common issues:
|
|
1196
|
-
# 1.
|
|
1197
|
-
# 2.
|
|
1198
|
-
# 3.
|
|
1223
|
+
# 1. Port already in use
|
|
1224
|
+
# 2. Invalid container image
|
|
1225
|
+
# 3. Missing dependencies
|
|
1226
|
+
|
|
1227
|
+
# Credentials are passed via HTTP headers from the MCP client
|
|
1199
1228
|
```
|
|
1200
1229
|
|
|
1201
1230
|
#### **Connection Issues**
|
|
@@ -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.1.dist-info/METADATA,sha256=ihXkPTCUrBqJJ_hqtIBfi7rSfb-3xuEiQLn_-LhSwL8,48596
|
|
56
|
+
mcp_instana-0.3.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
57
|
+
mcp_instana-0.3.1.dist-info/entry_points.txt,sha256=p1aZ9Ks0aJKpoIy6Mk-08cGYAfkXMNbwYIlokm513A4,140
|
|
58
|
+
mcp_instana-0.3.1.dist-info/licenses/LICENSE.md,sha256=Ox7lseFP2kBRXBjsLweW1jLmWiCyrKjwF8ZUvCbKd70,11310
|
|
59
|
+
mcp_instana-0.3.1.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
|
"""
|