Skip to content

Conversation

@christian-kreuzberger-dtx
Copy link
Collaborator

Vibe-coded by copilot with grok code fast 1

  • Added Davis Analyzers tools

@github-actions
Copy link

github-actions bot commented Oct 29, 2025

📦 Package.json Changes Detected

This PR modifies package.json. Please review the following changes carefully, and tick the following checklist boxes:

Checklist for Reviewers

  • Verify that new and/or updated dependencies are necessary and from trusted sources
  • Review any script changes for (security) implications
  • Verify whether a new version should be released after merging the PR

Package.json Diff

diff --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.

@MrManny MrManny requested a review from Copilot November 4, 2025 13:25
Copy link
Contributor

Copilot AI left a 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_analyzers and execute_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

Comment on lines +42 to +47
generalParameters: {
timeframe: {
startTime: 'now-1h',
endTime: 'now',
},
},
Copy link

Copilot AI Nov 4, 2025

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.

Suggested change
generalParameters: {
timeframe: {
startTime: 'now-1h',
endTime: 'now',
},
},

Copilot uses AI. Check for mistakes.
Comment on lines +5 to +12
### 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
Copy link

Copilot AI Nov 4, 2025

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.

Copilot generated this review using guidance from repository custom instructions.
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'),
Copy link

Copilot AI Nov 4, 2025

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.

Suggested change
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.'
),

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants