-
Notifications
You must be signed in to change notification settings - Fork 57
feat: Added Davis Analyzers #234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
📦 Package.json Changes DetectedThis PR modifies Checklist for Reviewers
Package.json Diffdiff --git a/package.json b/package.json
index d7701aa..fba9b4d 100644
--- a/package.json
+++ b/package.json
@@ -48,6 +48,7 @@
"license": "MIT",
"dependencies": {
"@dynatrace-sdk/client-automation": "^5.3.0",
+ "@dynatrace-sdk/client-davis-analyzers": "^1.9.7",
"@dynatrace-sdk/client-davis-copilot": "^1.0.0",
"@dynatrace-sdk/client-platform-management-service": "^1.6.3",
"@dynatrace-sdk/client-query": "^1.18.1",
This comment was automatically generated by the PR Package.json Comment workflow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for Davis Analyzers to the Dynatrace MCP Server, enabling users to list and execute various types of analyzers (forecast, anomaly detection, correlation) programmatically.
Key changes:
- Introduces two new tools:
list_davis_analyzersandexecute_davis_analyzer - Adds required OAuth scopes for Davis Analyzer operations
- Implements a polling mechanism for long-running analyzer executions
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/index.ts | Adds import for Davis Analyzer capabilities, registers two new tools, and includes required OAuth scopes |
| src/capabilities/davis-analyzers.ts | Implements core Davis Analyzer functionality including listing and execution with polling support |
| package.json | Adds dependency on @dynatrace-sdk/client-davis-analyzers version ^1.9.7 |
| package-lock.json | Updates lock file with resolved version 1.9.8 of the Davis Analyzers client |
| README.md | Documents the two new OAuth scopes required for Davis Analyzer functionality |
| CHANGELOG.md | Documents the new tools and scopes in the Unreleased Changes section |
| generalParameters: { | ||
| timeframe: { | ||
| startTime: 'now-1h', | ||
| endTime: 'now', | ||
| }, | ||
| }, |
Copilot
AI
Nov 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hardcoded timeframe values in executeDavisAnalyzer will override any timeframe values passed in the input parameter due to object spreading order. The spread operator ...input should come before the generalParameters to allow the caller to override the defaults, or the default timeframe should be removed entirely since defaults are handled in the tool definition.
| generalParameters: { | |
| timeframe: { | |
| startTime: 'now-1h', | |
| endTime: 'now', | |
| }, | |
| }, |
| ### Tools | ||
|
|
||
| - Added `list_davis_analyzers` tool to list all available Davis Analyzers including forecast, anomaly detection, and correlation analyzers | ||
| - Added `execute_davis_analyzer` tool to execute Davis Analyzers with custom input parameters and timeframe configuration | ||
|
|
||
| ### Scopes |
Copilot
AI
Nov 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CHANGELOG.md should not use subheadings like '### Tools' and '### Scopes' according to the coding guidelines. All changes should be listed as bullet points directly under the version heading without subheadings.
| analyzerName: z | ||
| .string() | ||
| .describe('The name of the Davis Analyzer to execute (e.g., "dt.statistics.GenericForecastAnalyzer")'), | ||
| input: z.record(z.any()).optional().describe('Input parameters for the analyzer as a JSON object'), |
Copilot
AI
Nov 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using z.any() reduces type safety and makes it unclear what structure the input parameter should have. Consider using a more specific type or providing better documentation about the expected structure of the input parameters for different analyzer types.
| input: z.record(z.any()).optional().describe('Input parameters for the analyzer as a JSON object'), | |
| input: z | |
| .record(z.unknown()) | |
| .optional() | |
| .describe( | |
| 'Input parameters for the analyzer as a JSON object. The required fields and their types depend on the specific analyzer. Use the "list_davis_analyzers" tool to see available analyzers and their expected input parameters.' | |
| ), |
14624f8 to
827c871
Compare
408f238 to
12412fe
Compare
Vibe-coded by copilot with grok code fast 1