-
Notifications
You must be signed in to change notification settings - Fork 40
Added feature/send email #108
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
Added feature/send email #108
Conversation
dynatrace-agent-rules/rules/reference/DynatraceEmailFormatting.md
Outdated
Show resolved
Hide resolved
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 pull request introduces comprehensive email sending functionality to the Dynatrace MCP server, enabling users to send email notifications via the Dynatrace Email API. The feature includes support for multiple recipients, formatted content, and specialized templates for incident and security alerts.
- Added
send_email
tool with validation, error handling, and support for TO/CC/BCC recipients - Created extensive integration tests covering various email scenarios and error conditions
- Added comprehensive documentation including email formatting reference and usage examples
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
src/index.ts | Adds send_email tool registration with schema validation and OAuth client configuration |
src/capabilities/send-email.ts | Implements core email sending logic with comprehensive error handling and response formatting |
integration-tests/send-email.integration.test.ts | Provides extensive test coverage for email functionality including incident/security templates |
integration-tests/README.md | Updates documentation with new test suite details and required OAuth scopes |
dynatrace-agent-rules/rules/reference/DynatraceEmailFormatting.md | Adds comprehensive email formatting reference with templates and best practices |
dynatrace-agent-rules/rules/README.md | Updates rule count and documentation references |
README.md | Adds email scope and usage examples |
CHANGELOG.md | Documents new email feature and OAuth scope |
.husky/pre-commit | Improves robustness and cross-platform compatibility |
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.
Thank you for your contribution.
I like the idea, but I do see some structural weaknesses in this PR:
- Some generated documentation is common knowledge for JS/TS Devs, we don't need it
- The husky/pre-commit script has changed, I don't quite understand why and what you are trying to achieve with this
- The
notificationSettingsUrl
parameter for the send-email tool and API endpoint is not needed for this use-case, please remove it - The integration-test for send-email, while having good intentions, is not ideal. I'm clarifying with our team internally on whether we can/should do that.
Changes Pushed:
|
Introduces the send_email capability for sending emails via the Dynatrace Email API, supporting multiple recipients (TO, CC, BCC), subject, body content, and notification settings URL. Adds OAuth scope documentation, a comprehensive email formatting reference, integration tests for email functionality, and updates relevant documentation and rule references.
This commit refines markdown formatting and code examples in DynatraceEmailFormatting.md, clarifies integration test documentation, and makes minor whitespace and formatting adjustments in send-email integration tests and implementation. It also condenses the Zod schema definition for the send_email capability in src/index.ts for improved readability.
…igurable tests - Remove notificationSettingsUrl parameter from email requests - Convert sendEmail function to return structured EmailSendResult instead of formatted string - Add 10 recipient limit validation with clear error messages - Make integration test email addresses configurable to prevent spam - Remove HTML content type support, keep only plain text - Simplify integration test documentation - Restore husky pre-commit script to standard format - Update email formatting reference docs to remove removed constraints - Fix platform-specific User-Agent tests to use dynamic matchers
5474d1a
to
4a19f87
Compare
- Integrated all infrastructure changes from main branch - Added Grail budget tracking with reset_grail_budget tool - Added telemetry via Dynatrace OpenKit - Added server.json for MCP registry - Preserved send_email tool functionality with proper integration - Resolved merge conflicts in CHANGELOG.md and src/index.ts - Both send_email and reset_grail_budget tools now available
Resolves all merge conflicts and addresses PR reviewer feedback: - Integrated latest main branch infrastructure (grail budget tracker, telemetry, server.json) - Resolved CHANGELOG.md merge conflict with proper email tool documentation - Resolved src/index.ts merge conflict preserving both send_email and reset_grail_budget tools - Removed git update-index --again from .husky/pre-commit as requested by reviewer - All tests passing, build successful
Resolved the comments that were mentioned. @christian-kreuzberger-dtx - Please review this and let me know if any changes are required. |
- Add send_email tool for Dynatrace Email API integration - Support multiple recipients (TO, CC, BCC) with 10 recipient limit - Add comprehensive email formatting documentation and AI agent rules - Update OAuth scopes documentation for email:emails:send requirement - Add integration tests for email functionality - Update README with email examples and usage instructions - Maintain full compatibility with parent repository structure - All existing functionality preserved unchanged
Pushed the changes and fixed the affected |
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.
LGTM
04fbe19
into
dynatrace-oss:main
This pull request introduces a new email sending capability to the Dynatrace MCP server, allowing users and automated workflows to send emails via the Dynatrace Email API. It includes a new
send_email
tool with support for multiple recipients, formatted content, incident and security alert templates, and comprehensive integration tests. The documentation has been updated to reflect these changes, including required OAuth scopes, usage examples, and new rule file references.New Email Sending Functionality:
send_email
tool to the server, enabling email notifications via the Dynatrace Email API with support for TO, CC, BCC recipients, subject, body (plain text or HTML), and optional notification settings URL. The functionality is exposed as a tool with schema validation and is available for use in workflows and automations. [1] [2] [3]src/capabilities/send-email.ts
, including request/response types, error handling, and support for reporting invalid or rejected destinations.Testing and Integration:
integration-tests/send-email.integration.test.ts
covering plain text emails, formatted content, multiple recipients, incident and security alert templates, notification settings URL, and error handling for authentication and invalid addresses.integration-tests/README.md
to document the new test suite, required OAuth scopes, and test execution instructions. [1] [2]Documentation and Rule Files:
README.md
with the newemail:emails:send
OAuth scope, example usage for sending email notifications, and clarified scope requirements. [1] [2]Developer Experience:
.husky/pre-commit
script to be more robust and cross-platform, checking for Node.js project presence before running npm commands.