Skip to content

Commit 30d0748

Browse files
bryankthompsonweb-flowclaude
authored
feat: Add MCP tool annotations for LLM guidance (#279)
Add title and hint annotations to all 11 internal tools to help LLMs understand tool behavior and make safer decisions about tool usage. Tool Annotations Added: **Read-Only Tools (7 tools):** - az_monitoring - Azure Monitor metrics/health/logs - az_network_resources - VNet/NSG/subnet info - get_aks_vmss_info - VMSS configuration - list_detectors - List AKS diagnostic detectors - run_detector - Execute AKS detector analysis - run_detectors_by_category - Run detector categories - az_advisor_recommendation - Azure Advisor recommendations **Destructive Tools (4 tools):** - az_aks_operations - Create/delete/scale AKS clusters - az_fleet - Multi-cluster fleet management - az_compute_operations - VM/VMSS operations - inspektor_gadget_observability - Deploy/undeploy eBPF monitoring Uses mark3labs/mcp-go annotation functions: - WithTitleAnnotation() - Human-readable tool names - WithReadOnlyHintAnnotation(true) - Safe read operations - WithDestructiveHintAnnotation(true) - State-modifying operations 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: triepod-ai <noreply@github.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent cde1144 commit 30d0748

File tree

9 files changed

+22
-0
lines changed

9 files changed

+22
-0
lines changed

internal/components/advisor/registry.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ func RegisterAdvisorRecommendationTool() mcp.Tool {
1111
return mcp.NewTool(
1212
"az_advisor_recommendation",
1313
mcp.WithDescription("Retrieve and manage Azure Advisor recommendations for AKS clusters"),
14+
mcp.WithTitleAnnotation("Azure Advisor Recommendations"),
15+
mcp.WithReadOnlyHintAnnotation(true),
1416
mcp.WithString("operation",
1517
mcp.Description("Operation to perform: list or report"),
1618
mcp.Required(),

internal/components/azaks/registry.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ func RegisterAzAksOperations(cfg *config.ConfigData) mcp.Tool {
102102

103103
return mcp.NewTool("az_aks_operations",
104104
mcp.WithDescription(description),
105+
mcp.WithTitleAnnotation("AKS Operations"),
106+
mcp.WithDestructiveHintAnnotation(true),
105107
mcp.WithString("operation",
106108
mcp.Required(),
107109
mcp.Description("The operation to perform"),

internal/components/compute/azcommands.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ func RegisterAzComputeOperations(cfg *config.ConfigData) mcp.Tool {
8484

8585
return mcp.NewTool("az_compute_operations",
8686
mcp.WithDescription(description),
87+
mcp.WithTitleAnnotation("Azure Compute Operations"),
88+
mcp.WithDestructiveHintAnnotation(true),
8789
mcp.WithString("operation",
8890
mcp.Required(),
8991
mcp.Description("Operation to perform. Common operations: list, show, start, stop, restart, deallocate, scale, etc."),

internal/components/compute/registry.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ func RegisterAKSVMSSInfoTool() mcp.Tool {
1111
return mcp.NewTool(
1212
"get_aks_vmss_info",
1313
mcp.WithDescription("Get detailed VMSS configuration for a specific node pool or all node pools in the AKS cluster (provides low-level VMSS settings not available in az aks nodepool show). Leave node_pool_name empty to get info for all node pools."),
14+
mcp.WithTitleAnnotation("Get AKS VMSS Info"),
15+
mcp.WithReadOnlyHintAnnotation(true),
1416
mcp.WithString("subscription_id",
1517
mcp.Description("Azure Subscription ID"),
1618
mcp.Required(),

internal/components/detectors/registry.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ func RegisterListDetectorsTool() mcp.Tool {
1111
return mcp.NewTool(
1212
"list_detectors",
1313
mcp.WithDescription("List all available AKS cluster detectors"),
14+
mcp.WithTitleAnnotation("List Detectors"),
15+
mcp.WithReadOnlyHintAnnotation(true),
1416
mcp.WithString("cluster_resource_id",
1517
mcp.Description("AKS cluster resource ID"),
1618
mcp.Required(),
@@ -23,6 +25,8 @@ func RegisterRunDetectorTool() mcp.Tool {
2325
return mcp.NewTool(
2426
"run_detector",
2527
mcp.WithDescription("Run a specific AKS detector"),
28+
mcp.WithTitleAnnotation("Run Detector"),
29+
mcp.WithReadOnlyHintAnnotation(true),
2630
mcp.WithString("cluster_resource_id",
2731
mcp.Description("AKS cluster resource ID"),
2832
mcp.Required(),
@@ -47,6 +51,8 @@ func RegisterRunDetectorsByCategoryTool() mcp.Tool {
4751
return mcp.NewTool(
4852
"run_detectors_by_category",
4953
mcp.WithDescription("Run all detectors in a specific category"),
54+
mcp.WithTitleAnnotation("Run Detectors By Category"),
55+
mcp.WithReadOnlyHintAnnotation(true),
5056
mcp.WithString("cluster_resource_id",
5157
mcp.Description("AKS cluster resource ID"),
5258
mcp.Required(),

internal/components/fleet/registry.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ Examples:
3333

3434
return mcp.NewTool("az_fleet",
3535
mcp.WithDescription(description),
36+
mcp.WithTitleAnnotation("Azure Fleet"),
37+
mcp.WithDestructiveHintAnnotation(true),
3638
mcp.WithString("operation",
3739
mcp.Required(),
3840
mcp.Description("The operation to perform. Valid values: list, show, create, update, delete, start, stop, get-credentials"),

internal/components/inspektorgadget/registry.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ func RegisterInspektorGadgetTool() mcp.Tool {
2828
"namespace, pod, container, selector,"+strings.Join(getGadgetParamsKeys(), ", ")+". "+
2929
"Example: "+
3030
"{'action': 'run', 'filter_params': {'namespace': 'default', 'selector': 'app=myapp', 'observe_dns.unsuccessful_only': true}}"),
31+
mcp.WithTitleAnnotation("Inspektor Gadget Observability"),
32+
mcp.WithDestructiveHintAnnotation(true),
3133
mcp.WithString("action",
3234
mcp.Required(),
3335
mcp.Description("Action to perform on the gadget: "+

internal/components/monitor/registry.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ control_plane_logs:
100100

101101
return mcp.NewTool("az_monitoring",
102102
mcp.WithDescription(description),
103+
mcp.WithTitleAnnotation("Azure Monitoring"),
104+
mcp.WithReadOnlyHintAnnotation(true),
103105
mcp.WithString("operation",
104106
mcp.Required(),
105107
mcp.Description("The monitoring operation to perform: 'metrics' (CPU/memory/network), 'resource_health' (cluster availability), 'app_insights' (telemetry analysis), 'diagnostics' (logging config), 'control_plane_logs' (Kubernetes logs like kube-apiserver, kube-audit, guard, etc.)"),

internal/components/network/registry.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ Examples:
3939

4040
return mcp.NewTool("az_network_resources",
4141
mcp.WithDescription(description),
42+
mcp.WithTitleAnnotation("Azure Network Resources"),
43+
mcp.WithReadOnlyHintAnnotation(true),
4244
mcp.WithString("resource_type",
4345
mcp.Required(),
4446
mcp.Description("The type of network resource to query"),

0 commit comments

Comments
 (0)