Instana WatsonX Wrapper v2.0.0
A WatsonX-compatible MCP server wrapper for Instana monitoring with comprehensive read-only tools.
Overview
This wrapper solves the WatsonX MCP client bug that auto-parses JSON string parameters. It provides 11 essential read-only tools for monitoring infrastructure, events, dashboards, and websites.
The Problem
WatsonX's MCP client has a bug where it:
- Auto-parses JSON strings to objects
- Removes parameter name wrappers
- Breaks the MCP protocol specification
This makes the official mcp-instana package incompatible with WatsonX.
The Solution
This wrapper:
- Accepts parameters as objects (what WatsonX sends)
- Calls Instana REST API directly
- Returns properly formatted results
- Provides 11 essential read-only tools
Features
✅ 11 Read-Only Tools
Infrastructure Analysis
analyze_infrastructure- Query metrics for hosts, databases, JVMs, etc.
Event Monitoring
get_event- Get specific event by IDget_issues- Get issue eventsget_incidents- Get incident eventsget_changes- Get change eventsget_kubernetes_info_events- Get Kubernetes events
Dashboard Management
get_custom_dashboards- List all custom dashboardsget_custom_dashboard- Get specific dashboard by ID
Website Monitoring
get_websites- List all monitored websitesget_website- Get specific website by IDget_website_beacons- Get website performance beacons
✅ WatsonX Compatible
- Works with WatsonX Orchestrator Cloud
- No JSON string parsing issues
- Simple object parameters
- Reliable and predictable
✅ Production Ready
- Direct REST API calls (no SDK dependency issues)
- Proper error handling
- Type hints throughout
- Comprehensive documentation
Installation
Option 1: From PyPI (Recommended)
pip install instana-watsonx-wrapper
Option 2: From Source
git clone <repository-url>
cd instana-watsonx-wrapper
pip install -e .
Quick Start
1. Set Environment Variables
export INSTANA_BASE_URL="https://your-instance.instana.io"
export INSTANA_API_TOKEN="your_api_token"
2. Run the Server
python -m instana_watsonx_wrapper.server
3. Import to WatsonX
- Go to WatsonX Orchestrator Cloud
- Navigate to Connections → Add Connection
- Select MCP Server
- Configure:
- Name: Instana Monitoring
- Command:
python -m instana_watsonx_wrapper.server - Environment Variables:
INSTANA_BASE_URL: Your Instana URLINSTANA_API_TOKEN: Your API token
4. Test with Agent
Create an agent and add the Instana toolkit. Test with:
"List all databases on server t3992-dev1-db-node01-par01-dev"
Tool Reference
1. analyze_infrastructure
Query infrastructure metrics from Instana.
Parameters:
entity_type(required): Entity type (e.g., "db2Database", "host", "jvmRuntimePlatform")metrics(required): List of metric namesaggregation(required): Aggregation type ("mean", "sum", "max", "min")filters(optional): List of filters with name/value pairsgroup_by(optional): List of tag names to group bytime_range(optional): Time range string (e.g., "1h", "24h", "7d")order_by(optional): Metric name to order byorder_direction(optional): Sort direction ("ASC" or "DESC")
Example:
{
"entity_type": "db2Database",
"metrics": ["databases.status", "databases.connectionsCount"],
"aggregation": "mean",
"filters": [{"name": "host.name", "value": "server1"}],
"group_by": ["db2.name"],
"time_range": "7d"
}
2. get_event
Get a specific event by ID.
Parameters:
event_id(required): Event ID
Example:
{
"event_id": "abc123"
}
3. get_issues
Get issue events from Instana.
Parameters:
from_time(optional): Start timestamp in millisecondsto_time(optional): End timestamp in millisecondstime_range(optional): Natural language time range (e.g., "1h", "24h", "7d")max_events(optional): Maximum events to return (default: 50)
Example:
{
"time_range": "24h",
"max_events": 100
}
4. get_incidents
Get incident events from Instana.
Parameters: Same as get_issues
5. get_changes
Get change events from Instana.
Parameters: Same as get_issues
6. get_kubernetes_info_events
Get Kubernetes info events from Instana.
Parameters: Same as get_issues
7. get_custom_dashboards
Get all custom dashboards.
Parameters: None
8. get_custom_dashboard
Get a specific custom dashboard by ID.
Parameters:
dashboard_id(required): Dashboard ID
Example:
{
"dashboard_id": "dashboard123"
}
9. get_websites
Get all monitored websites.
Parameters: None
10. get_website
Get a specific website by ID.
Parameters:
website_id(required): Website ID
Example:
{
"website_id": "website123"
}
11. get_website_beacons
Get website performance beacons.
Parameters:
website_name(optional): Website name to filter bybeacon_type(optional): Beacon type (default: "PAGELOAD")time_range(optional): Time range string (default: "1h")
Example:
{
"website_name": "my-app",
"beacon_type": "PAGELOAD",
"time_range": "24h"
}
Common Use Cases
Monitor Database Health
"Show me the status and connection count for all databases on server X over the last 7 days"
Agent will use:
{
"entity_type": "db2Database",
"metrics": ["databases.status", "databases.connectionsCount"],
"aggregation": "mean",
"filters": [{"name": "host.name", "value": "server-x"}],
"group_by": ["db2.name"],
"time_range": "7d"
}
Check Recent Incidents
"Show me all incidents from the last 24 hours"
Agent will use:
{
"time_range": "24h"
}
Monitor Website Performance
"Show me page load beacons for my-app website in the last hour"
Agent will use:
{
"website_name": "my-app",
"beacon_type": "PAGELOAD",
"time_range": "1h"
}
Comparison with Official Package
| Aspect | Official mcp-instana | This Wrapper |
|---|---|---|
| WatsonX | ❌ Broken (parameter bug) | ✅ Works |
| Tools | 46+ tools | 11 essential read tools |
| Complexity | High (SDK dependencies) | Low (direct REST API) |
| Maintenance | Complex | Simple |
| Use Case | All operations | Read-only monitoring |
| Dependencies | instana-python-sdk | requests only |
Troubleshooting
Connection Issues
Problem: "Missing required environment variables"
Solution: Ensure both environment variables are set:
export INSTANA_BASE_URL="https://your-instance.instana.io"
export INSTANA_API_TOKEN="your_api_token"
API Errors
Problem: "401 Unauthorized"
Solution: Verify your API token has the correct permissions in Instana.
Time Range Issues
Problem: No data returned
Solution: Try different time ranges:
- Use "7d" for databases (they update less frequently)
- Use "1h" for real-time metrics
- Use "24h" for events
Development
Running Tests
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
Building Package
# Install build tools
pip install build twine
# Build package
python -m build
# Upload to PyPI
python -m twine upload dist/*
Architecture
WatsonX Agent
↓
↓ (sends object parameters)
↓
Instana WatsonX Wrapper
↓
↓ (converts to REST API calls)
↓
Instana REST API
↓
↓ (returns JSON)
↓
WatsonX Agent (receives formatted results)
Version History
v2.0.0 (Current)
- Added 10 new read-only tools
- Infrastructure analysis
- Event monitoring (issues, incidents, changes, Kubernetes)
- Dashboard management
- Website monitoring
- Direct REST API calls (no SDK dependency)
v1.0.1
- Fixed tool name bug
- Single tool: analyze_infrastructure_elicitation
v1.0.0
- Initial release
- Single tool with wrong name
License
MIT License
Support
For issues and questions:
- Check the troubleshooting section
- Review the tool reference
- Test with the official Instana API documentation
- Submit bug reports with detailed error messages
Contributing
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Add tests for new features
- Submit a pull request
Acknowledgments
- Built to work around WatsonX MCP client limitations
- Uses Instana REST API directly for reliability
- Designed for production DB2 DBA monitoring workflows
Metadata
Release files for instana-watsonx-wrapper 2.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| instana_watsonx_wrapper-2.0.6.tar.gz | 17.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| instana_watsonx_wrapper-2.0.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.5 kB
Release files / instana_watsonx_wrapper-2.0.6.tar.gz
| Download URL | instana_watsonx_wrapper-2.0.6.tar.gz |
|---|---|
| Size | 17.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
418dff5521db350491f335cbb55dd0cfebe504b50854c5d883ab700133b3d882
|
|
BLAKE2b-256 checksum How to use checksums |
0200da961e0f39b480ef5118ee421899418b34caf134439461812098f01bd78d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.0b1
|
Release files / instana_watsonx_wrapper-2.0.6-py3-none-any.whl
| Download URL | instana_watsonx_wrapper-2.0.6-py3-none-any.whl |
|---|---|
| Size | 9.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9856e85d6fc5bd9cdcd11b6fe5de1fd573bbdc3e92f13e6a00f82f3e42d9317a
|
|
BLAKE2b-256 checksum How to use checksums |
edd43eb588273b8bb468ceb559422e9ac0ed9febf95f1d5addb1e75ecc1162f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.0b1
|
Security for instana-watsonx-wrapper 2.0.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.