Skip to content

Conversation

@yiyuan-he
Copy link
Contributor

Fixes

Summary

Adding new get_enablement_guide MCP tool. The goal of this tool is to fetch the appropriate enablement guide for AI Assistants to correctly follow Application Signals enablement steps. Currently, these AI-friendly enablement guides will be hosted in this MCP repo. Long-term, we aim to replace our public documentation entirely with these new enablement guides.

Changes

  • Added get_enablement_guide tool in enablement_tools.py
  • Created enablement_guides/templates/ directory structure for markdown guides
  • Added placeholder EC2 + Python enablement guide for testing purposes
  • Avoided registering this tool since it is not yet ready for release
  • Added unit tests covering validation, error cases, and successful guide fetching

User experience

Before:
Users had to manually feed relevant pieces of the enablement docs in small chunks to AI Assistants because the public documentation is not AI-friendly. Feeding the entire documentation to the AI assistant led to poor and inconsistent enablement results.

After:
With a single query like:

Enable Application Signals for my Python Flask Application running on EC2. My infrastructure code is in <iac_directory> and my app code is in <app_directory>.

The AI assistant will now automatically retrieve the relevant enablement guide based on the context and follow the enablement instructions. The end result is customers will have AI-generated changes to their IaC code that they can deploy and start seeing Application Signals telemetry.

Checklist

If your change doesn't seem to apply, please leave them unchecked.

  • I have reviewed the contributing guidelines
  • I have performed a self-review of this change
  • Changes have been tested
  • Changes are documented

Is this a breaking change? (N)

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.

Copilot AI review requested due to automatic review settings October 24, 2025 22:58
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 a new get_enablement_guide MCP tool to help AI assistants automatically retrieve and follow Application Signals enablement instructions. The tool accepts platform, language, and directory paths as inputs, validates them, and returns an AI-friendly enablement guide with context-specific instructions.

Key Changes:

  • Introduces the get_enablement_guide function with parameter validation and path resolution
  • Creates directory structure for storing platform/language-specific enablement guides
  • Implements comprehensive test coverage for validation, error handling, and successful guide retrieval

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
awslabs/cloudwatch_appsignals_mcp_server/enablement_tools.py Core implementation of the get_enablement_guide function with validation logic and template loading
tests/test_enablement_tools.py Unit tests covering invalid inputs, missing directories, and successful guide fetching
enablement_guides/templates/ec2/ec2-python-enablement.md Placeholder markdown file for EC2+Python enablement guide

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 96 to 113
context = f"""# Application Signals Enablement Guide

## Context

**Platform:** {platform}
**Language:** {language}
**IaC Directory (absolute path):** `{iac_full_path}`
**Application Directory (absolute path):** `{app_full_path}`

## Instructions

1. Use the ABSOLUTE PATHS above when reading and writing files
2. **IMPORTANT:** Only modify the IaC code or Dockerfiles. Actual application code should not be modified.
Read application files if needed to understand the setup, but do not modify them.
3. Follow the step-by-step enablement guide below to enable Application Signals

---
"""
Copy link

Copilot AI Oct 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The multi-line string has inconsistent leading whitespace that will be included in the output. Lines 98-112 have 8 spaces of indentation that will appear in the final string. Either use textwrap.dedent() to remove leading whitespace, or align the string content to the left margin of the triple quotes.

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Oct 24, 2025

Codecov Report

❌ Patch coverage is 93.61702% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.50%. Comparing base (040bf7f) to head (73a3cfb).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...oudwatch_appsignals_mcp_server/enablement_tools.py 93.61% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1585   +/-   ##
=======================================
  Coverage   89.50%   89.50%           
=======================================
  Files         725      726    +1     
  Lines       51174    51221   +47     
  Branches     8193     8200    +7     
=======================================
+ Hits        45801    45845   +44     
- Misses       3461     3464    +3     
  Partials     1912     1912           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yiyuan-he yiyuan-he force-pushed the get-enablement-guide-tool-setup branch from bd78c95 to 4e63eb4 Compare October 27, 2025 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To triage

Development

Successfully merging this pull request may close these issues.

1 participant