holmesgpt 0.14.2__py3-none-any.whl → 0.14.3a0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of holmesgpt might be problematic. Click here for more details.

Files changed (68) hide show
  1. holmes/__init__.py +1 -1
  2. holmes/common/env_vars.py +6 -0
  3. holmes/config.py +3 -6
  4. holmes/core/conversations.py +12 -2
  5. holmes/core/feedback.py +191 -0
  6. holmes/core/llm.py +16 -12
  7. holmes/core/models.py +101 -1
  8. holmes/core/supabase_dal.py +23 -9
  9. holmes/core/tool_calling_llm.py +197 -15
  10. holmes/core/tools.py +20 -7
  11. holmes/core/tools_utils/token_counting.py +13 -0
  12. holmes/core/tools_utils/tool_context_window_limiter.py +45 -23
  13. holmes/core/tools_utils/tool_executor.py +11 -6
  14. holmes/core/toolset_manager.py +5 -1
  15. holmes/core/truncation/dal_truncation_utils.py +23 -0
  16. holmes/interactive.py +146 -14
  17. holmes/plugins/prompts/_fetch_logs.jinja2 +3 -0
  18. holmes/plugins/runbooks/__init__.py +6 -1
  19. holmes/plugins/toolsets/__init__.py +11 -4
  20. holmes/plugins/toolsets/atlas_mongodb/mongodb_atlas.py +9 -20
  21. holmes/plugins/toolsets/azure_sql/tools/analyze_connection_failures.py +2 -3
  22. holmes/plugins/toolsets/azure_sql/tools/analyze_database_connections.py +2 -3
  23. holmes/plugins/toolsets/azure_sql/tools/analyze_database_health_status.py +6 -4
  24. holmes/plugins/toolsets/azure_sql/tools/analyze_database_performance.py +6 -4
  25. holmes/plugins/toolsets/azure_sql/tools/analyze_database_storage.py +2 -3
  26. holmes/plugins/toolsets/azure_sql/tools/get_active_alerts.py +6 -4
  27. holmes/plugins/toolsets/azure_sql/tools/get_slow_queries.py +2 -3
  28. holmes/plugins/toolsets/azure_sql/tools/get_top_cpu_queries.py +2 -3
  29. holmes/plugins/toolsets/azure_sql/tools/get_top_data_io_queries.py +2 -3
  30. holmes/plugins/toolsets/azure_sql/tools/get_top_log_io_queries.py +2 -3
  31. holmes/plugins/toolsets/bash/bash_toolset.py +4 -7
  32. holmes/plugins/toolsets/cilium.yaml +284 -0
  33. holmes/plugins/toolsets/datadog/toolset_datadog_general.py +5 -10
  34. holmes/plugins/toolsets/datadog/toolset_datadog_logs.py +1 -1
  35. holmes/plugins/toolsets/datadog/toolset_datadog_metrics.py +6 -13
  36. holmes/plugins/toolsets/datadog/toolset_datadog_rds.py +3 -6
  37. holmes/plugins/toolsets/datadog/toolset_datadog_traces.py +4 -9
  38. holmes/plugins/toolsets/git.py +14 -12
  39. holmes/plugins/toolsets/grafana/grafana_tempo_api.py +23 -42
  40. holmes/plugins/toolsets/grafana/toolset_grafana.py +2 -3
  41. holmes/plugins/toolsets/grafana/toolset_grafana_tempo.py +18 -36
  42. holmes/plugins/toolsets/internet/internet.py +2 -3
  43. holmes/plugins/toolsets/internet/notion.py +2 -3
  44. holmes/plugins/toolsets/investigator/core_investigation.py +7 -9
  45. holmes/plugins/toolsets/kafka.py +7 -18
  46. holmes/plugins/toolsets/logging_utils/logging_api.py +79 -3
  47. holmes/plugins/toolsets/mcp/toolset_mcp.py +2 -3
  48. holmes/plugins/toolsets/newrelic/__init__.py +0 -0
  49. holmes/plugins/toolsets/newrelic/new_relic_api.py +125 -0
  50. holmes/plugins/toolsets/newrelic/newrelic.jinja2 +41 -0
  51. holmes/plugins/toolsets/newrelic/newrelic.py +211 -0
  52. holmes/plugins/toolsets/opensearch/opensearch.py +5 -12
  53. holmes/plugins/toolsets/opensearch/opensearch_traces.py +3 -6
  54. holmes/plugins/toolsets/prometheus/prometheus.py +131 -97
  55. holmes/plugins/toolsets/rabbitmq/toolset_rabbitmq.py +3 -6
  56. holmes/plugins/toolsets/robusta/robusta.py +4 -9
  57. holmes/plugins/toolsets/runbook/runbook_fetcher.py +93 -13
  58. holmes/plugins/toolsets/servicenow/servicenow.py +5 -10
  59. holmes/utils/sentry_helper.py +1 -1
  60. holmes/utils/stream.py +22 -7
  61. holmes/version.py +34 -14
  62. {holmesgpt-0.14.2.dist-info → holmesgpt-0.14.3a0.dist-info}/METADATA +6 -8
  63. {holmesgpt-0.14.2.dist-info → holmesgpt-0.14.3a0.dist-info}/RECORD +66 -60
  64. holmes/core/tools_utils/data_types.py +0 -81
  65. holmes/plugins/toolsets/newrelic.py +0 -231
  66. {holmesgpt-0.14.2.dist-info → holmesgpt-0.14.3a0.dist-info}/LICENSE.txt +0 -0
  67. {holmesgpt-0.14.2.dist-info → holmesgpt-0.14.3a0.dist-info}/WHEEL +0 -0
  68. {holmesgpt-0.14.2.dist-info → holmesgpt-0.14.3a0.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,284 @@
1
+ toolsets:
2
+ cilium/core:
3
+ description: "Cilium CNI and Hubble network observability tools for troubleshooting network connectivity and security"
4
+ docs_url: "https://robusta-dev.github.io/holmesgpt/data-sources/builtin-toolsets/cilium/"
5
+ icon_url: "https://cilium.io/static/logo-dark-text.png"
6
+ llm_instructions: |
7
+ You have access to comprehensive Cilium and Hubble tools for debugging Kubernetes networking and security.
8
+ Use these tools to investigate:
9
+ - Network connectivity issues between pods/services
10
+ - Network policy violations
11
+ - Load balancing problems
12
+ - Network flows and traffic patterns
13
+ - Cilium component health and status
14
+
15
+ ALWAYS follow these troubleshooting steps:
16
+ 1. Check Cilium agent status and health, and attempt to remediate if broken.
17
+ 2. Use Hubble to observe network flows and identify blocked or dropped traffic
18
+ 3. Check network policies if traffic is being denied
19
+ 4. Examine Cilium endpoints and services for configuration issues
20
+ 5. Analyze BPF maps and load balancer state if needed
21
+ 6. Run connectivity tests ONLY as a last resort (they take 5+ minutes)
22
+
23
+ {% if tool_names|list|length > 0 %}
24
+ The following Cilium commands are available: {{ ", ".join(tool_names) }}
25
+ {% endif %}
26
+
27
+ ALWAYS provide specific actionable solutions based on the observed data rather than generic troubleshooting advice.
28
+ tags:
29
+ - cli
30
+ prerequisites:
31
+ - command: "cilium status"
32
+ config:
33
+ timeout: 300 # Default timeout in seconds - connectivity tests can take 5+ minutes to complete
34
+
35
+ tools:
36
+ # Cilium Status and Health
37
+ - name: "cilium_status"
38
+ description: "Display overall Cilium agent status and health"
39
+ command: "cilium status"
40
+
41
+ - name: "cilium_status_verbose"
42
+ description: "Display detailed Cilium agent status with verbose output"
43
+ command: "cilium status --verbose"
44
+
45
+ - name: "cilium_version"
46
+ description: "Show Cilium version information"
47
+ command: "cilium version"
48
+
49
+ - name: "cilium_config"
50
+ description: "Display current Cilium configuration"
51
+ command: "cilium config view"
52
+
53
+ # Connectivity Testing
54
+ - name: "cilium_connectivity_test"
55
+ description: "Run comprehensive connectivity tests to validate network functionality (SLOW: 5+ minutes - use as last resort)"
56
+ command: "timeout {{ config.timeout | default(600) }} cilium connectivity test --test-concurrency 1"
57
+
58
+ - name: "cilium_connectivity_test_namespace"
59
+ description: "Run connectivity tests in a specific namespace (SLOW: 5+ minutes - use as last resort)"
60
+ command: "timeout {{ config.timeout | default(600) }} cilium connectivity test --test-namespace {{ namespace }}"
61
+ args:
62
+ - name: "namespace"
63
+ type: "string"
64
+ description: "Kubernetes namespace to run connectivity tests in"
65
+
66
+ # Cluster and Node Information
67
+ - name: "cilium_clustermesh_status"
68
+ description: "Display cluster mesh status for multi-cluster networking"
69
+ command: "cilium clustermesh status"
70
+
71
+ # Features and Configuration
72
+ - name: "cilium_features_status"
73
+ description: "Report which features are enabled in Cilium agents"
74
+ command: "cilium features status"
75
+
76
+ # BGP Control Plane
77
+ - name: "cilium_bgp_peers"
78
+ description: "List BGP peers for nodes running Cilium (requires BGP enabled)"
79
+ command: "cilium bgp peers || echo 'BGP not enabled or not properly configured'"
80
+
81
+ - name: "cilium_bgp_routes"
82
+ description: "List BGP routes for nodes running Cilium (requires BGP enabled)"
83
+ command: "cilium bgp routes || echo 'BGP not enabled or not properly configured'"
84
+
85
+ # Encryption (requires Cilium 1.18+)
86
+ - name: "cilium_encryption_status"
87
+ description: "Show encryption status and configuration (requires Cilium 1.18+)"
88
+ command: "cilium encryption status || echo 'Encryption status not supported in this Cilium version'"
89
+
90
+ # System Diagnostics
91
+ - name: "cilium_sysdump"
92
+ description: "Collect system information for troubleshooting Cilium issues"
93
+ command: "cilium sysdump --output-filename cilium-sysdump-$(date +%Y%m%d-%H%M%S).zip"
94
+
95
+ # Installation and Upgrade
96
+ - name: "cilium_install_status"
97
+ description: "Check Cilium installation status in the cluster"
98
+ command: "cilium status --wait"
99
+
100
+ - name: "cilium_context"
101
+ description: "Display the current Kubernetes context configuration"
102
+ command: "cilium context"
103
+
104
+ # Multicast (only works if multicast is enabled)
105
+ - name: "cilium_multicast_groups"
106
+ description: "List multicast groups and their members (requires multicast enabled)"
107
+ command: "cilium multicast list group || echo 'Multicast not enabled in this cluster'"
108
+
109
+ hubble/observability:
110
+ description: "Hubble network observability tools for monitoring and troubleshooting network flows"
111
+ docs_url: "https://robusta-dev.github.io/holmesgpt/data-sources/builtin-toolsets/cilium/#hubble"
112
+ icon_url: "https://raw.githubusercontent.com/cilium/hubble/main/Documentation/images/hubble_logo.png"
113
+ llm_instructions: |
114
+ Use Hubble to observe and analyze network traffic flows in your Kubernetes cluster.
115
+
116
+ IMPORTANT: Hubble commands require a running Hubble server (hubble-relay) to be accessible.
117
+ If Hubble server is not available, these commands will fail with connection errors.
118
+ Use 'cilium hubble enable' to enable Hubble if needed.
119
+
120
+ Hubble provides deep visibility into:
121
+ - HTTP/gRPC/DNS traffic flows
122
+ - Network policy drops and allows
123
+ - Service-to-service communication patterns
124
+ - Security events and anomalies
125
+ - Cilium agent events and debug information
126
+
127
+ When troubleshooting with Hubble:
128
+ 1. Start with broad flow observations to understand traffic patterns
129
+ 2. Filter by specific pods, namespaces, or protocols as needed
130
+ 3. Look for dropped flows to identify policy issues
131
+ 4. Check DNS resolution problems
132
+ 5. Analyze L7 protocols for application-level issues
133
+ 6. Use policy verdicts to understand network policy behavior
134
+
135
+ Use time windows and limits to focus on recent events during incident investigation.
136
+ Note: Some advanced features like agent-events and debug-events may not be available in all Hubble versions.
137
+ tags:
138
+ - cli
139
+ prerequisites:
140
+ - command: "hubble version"
141
+ - command: "hubble status"
142
+ config:
143
+ timeout: 300 # Default timeout in seconds for potentially long-running commands
144
+
145
+ tools:
146
+ # Flow Observation
147
+ - name: "hubble_observe"
148
+ description: "Observe network flows in real-time (last 100 flows)"
149
+ command: "hubble observe --last 1000"
150
+ transformers:
151
+ - name: llm_summarize
152
+ config:
153
+ input_threshold: 1000
154
+ prompt: |
155
+ Summarize this hubble observe output focusing on
156
+ - Notable traffic patterns.
157
+ - Traffic drops of any kind, source, destingation, protocol, etc.
158
+ - Errors that might indicate network issues.
159
+
160
+ - name: "hubble_observe_namespace"
161
+ description: "Observe flows for a specific namespace"
162
+ command: "hubble observe --namespace {{ namespace }} --last 100"
163
+ args:
164
+ - name: "namespace"
165
+ type: "string"
166
+ description: "Kubernetes namespace to observe flows for"
167
+
168
+ - name: "hubble_observe_pod"
169
+ description: "Observe flows to/from a specific pod (format: namespace/pod-name)"
170
+ command: "hubble observe --pod {{ pod_name }} --last 100"
171
+ args:
172
+ - name: "pod_name"
173
+ type: "string"
174
+ description: "Pod name in format namespace/pod-name or just pod-name (defaults to 'default' namespace)"
175
+
176
+ - name: "hubble_observe_since"
177
+ description: "Observe flows since a specific time (e.g., '5m', '1h', '2023-01-01T10:00:00Z')"
178
+ command: "timeout {{ config.timeout | default(30) }} hubble observe --since {{ time_duration }}"
179
+ args:
180
+ - name: "time_duration"
181
+ type: "string"
182
+ description: "Time duration or timestamp (e.g., '5m', '1h', '2023-01-01T10:00:00Z')"
183
+
184
+ # Protocol-Specific Observation
185
+ - name: "hubble_observe_http"
186
+ description: "Observe HTTP traffic flows"
187
+ command: "hubble observe --protocol http --last 100"
188
+
189
+ - name: "hubble_observe_dns"
190
+ description: "Observe DNS queries and responses"
191
+ command: "hubble observe --protocol dns --last 100"
192
+
193
+ - name: "hubble_observe_grpc"
194
+ description: "Observe gRPC traffic flows"
195
+ command: "hubble observe --protocol grpc --last 100"
196
+
197
+ # Traffic Analysis
198
+ - name: "hubble_observe_drops"
199
+ description: "Show only dropped network flows (policy denials, etc.)"
200
+ command: "hubble observe --verdict DROPPED --last 100"
201
+
202
+ - name: "hubble_observe_forwarded"
203
+ description: "Show flows that were successfully forwarded"
204
+ command: "hubble observe --verdict FORWARDED --last 100"
205
+
206
+ - name: "hubble_observe_service"
207
+ description: "Observe flows to/from a specific service (format: namespace/service-name)"
208
+ command: "hubble observe --service {{ service_name }} --last 100"
209
+ args:
210
+ - name: "service_name"
211
+ type: "string"
212
+ description: "Service name in format namespace/service-name or just service-name (defaults to 'default' namespace)"
213
+
214
+ - name: "hubble_observe_port"
215
+ description: "Observe flows on a specific port"
216
+ command: "hubble observe --port {{ port }} --last 100"
217
+ args:
218
+ - name: "port"
219
+ type: "integer"
220
+ description: "Port number to filter flows by (e.g., 8080, 443)"
221
+
222
+ # Flow Filtering and Analysis
223
+ - name: "hubble_observe_from_pod"
224
+ description: "Observe flows originating from a specific pod (format: namespace/pod-name)"
225
+ command: "hubble observe --from-pod {{ namespace }}/{{ pod_name }} --last 100"
226
+ args:
227
+ - name: "namespace"
228
+ type: "string"
229
+ description: "Kubernetes namespace where the source pod is located"
230
+ - name: "pod_name"
231
+ type: "string"
232
+ description: "Name of the source pod"
233
+
234
+ - name: "hubble_observe_to_pod"
235
+ description: "Observe flows destined to a specific pod (format: namespace/pod-name)"
236
+ command: "hubble observe --to-pod {{ namespace }}/{{ pod_name }} --last 100"
237
+ args:
238
+ - name: "namespace"
239
+ type: "string"
240
+ description: "Kubernetes namespace where the destination pod is located"
241
+ - name: "pod_name"
242
+ type: "string"
243
+ description: "Name of the destination pod"
244
+
245
+ - name: "hubble_observe_between_namespaces"
246
+ description: "Observe flows between two specific namespaces"
247
+ command: "hubble observe --from-namespace {{ src_namespace }} --to-namespace {{ dst_namespace }} --last 100"
248
+ args:
249
+ - name: "src_namespace"
250
+ type: "string"
251
+ description: "Source namespace to filter flows from"
252
+ - name: "dst_namespace"
253
+ type: "string"
254
+ description: "Destination namespace to filter flows to"
255
+
256
+ - name: "hubble_observe_json"
257
+ description: "Output flow observations in JSON format for detailed analysis"
258
+ command: "hubble observe --output json --last 100"
259
+
260
+ # Status and Metrics
261
+ - name: "hubble_status"
262
+ description: "Display Hubble server status and configuration"
263
+ command: "hubble status"
264
+
265
+ - name: "hubble_list_nodes"
266
+ description: "List nodes available for flow observation"
267
+ command: "hubble list nodes"
268
+
269
+ - name: "hubble_observe_flows_summary"
270
+ description: "Get a summary of recent network flows with basic statistics"
271
+ command: "hubble observe --last 100 --output compact"
272
+
273
+ # Security and Policy Analysis
274
+ - name: "hubble_observe_security_events"
275
+ description: "Observe security-related network events and policy violations"
276
+ command: "hubble observe --verdict DROPPED --last 100"
277
+
278
+ - name: "hubble_observe_policy_verdicts"
279
+ description: "Show policy verdict events (allows and denies)"
280
+ command: "hubble observe --type policy-verdict --last 100"
281
+
282
+ - name: "hubble_observe_l7_traffic"
283
+ description: "Show L7 (application-layer) traffic flows"
284
+ command: "hubble observe --type l7 --last 100"
@@ -10,6 +10,7 @@ from urllib.parse import urlparse
10
10
  from holmes.core.tools import (
11
11
  CallablePrerequisite,
12
12
  Tool,
13
+ ToolInvokeContext,
13
14
  ToolParameter,
14
15
  Toolset,
15
16
  StructuredToolResult,
@@ -232,7 +233,7 @@ class DatadogGeneralToolset(Toolset):
232
233
  if not config:
233
234
  return (
234
235
  False,
235
- "Datadog general toolset requires configuration. Please provide: dd_api_key, dd_app_key, and site_api_url in your Holmes config. For more details, see https://holmesgpt.dev/data-sources/builtin-toolsets/datadog/",
236
+ "Missing config for dd_api_key, dd_app_key, or site_api_url. For details: https://holmesgpt.dev/data-sources/builtin-toolsets/datadog/",
236
237
  )
237
238
 
238
239
  try:
@@ -399,9 +400,7 @@ class DatadogAPIGet(BaseDatadogGeneralTool):
399
400
  description = params.get("description", "API call")
400
401
  return f"{toolset_name_for_one_liner(self.toolset.name)}: {description}"
401
402
 
402
- def _invoke(
403
- self, params: dict, user_approved: bool = False
404
- ) -> StructuredToolResult:
403
+ def _invoke(self, params: dict, context: ToolInvokeContext) -> StructuredToolResult:
405
404
  """Execute the GET request."""
406
405
  logging.info("=" * 60)
407
406
  logging.info("DatadogAPIGet Tool Invocation:")
@@ -567,9 +566,7 @@ class DatadogAPIPostSearch(BaseDatadogGeneralTool):
567
566
  description = params.get("description", "Search")
568
567
  return f"{toolset_name_for_one_liner(self.toolset.name)}: {description}"
569
568
 
570
- def _invoke(
571
- self, params: dict, user_approved: bool = False
572
- ) -> StructuredToolResult:
569
+ def _invoke(self, params: dict, context: ToolInvokeContext) -> StructuredToolResult:
573
570
  """Execute the POST search request."""
574
571
  logging.info("=" * 60)
575
572
  logging.info("DatadogAPIPostSearch Tool Invocation:")
@@ -699,9 +696,7 @@ class ListDatadogAPIResources(BaseDatadogGeneralTool):
699
696
  search = params.get("search_regex", "all")
700
697
  return f"{toolset_name_for_one_liner(self.toolset.name)}: List API Resources (search: {search})"
701
698
 
702
- def _invoke(
703
- self, params: dict, user_approved: bool = False
704
- ) -> StructuredToolResult:
699
+ def _invoke(self, params: dict, context: ToolInvokeContext) -> StructuredToolResult:
705
700
  """List available API resources."""
706
701
  search_regex = params.get("search_regex", "")
707
702
 
@@ -426,7 +426,7 @@ class DatadogLogsToolset(BasePodLoggingToolset):
426
426
  if not config:
427
427
  return (
428
428
  False,
429
- "Datadog logs toolset requires configuration. Please provide: dd_api_key, dd_app_key, and site_api_url in your Holmes config. For more details, see https://holmesgpt.dev/data-sources/builtin-toolsets/datadog/",
429
+ "Missing config for dd_api_key, dd_app_key, or site_api_url. For details: https://holmesgpt.dev/data-sources/builtin-toolsets/datadog/",
430
430
  )
431
431
 
432
432
  try:
@@ -6,6 +6,7 @@ from holmes.core.tools import (
6
6
  CallablePrerequisite,
7
7
  StructuredToolResult,
8
8
  Tool,
9
+ ToolInvokeContext,
9
10
  ToolParameter,
10
11
  StructuredToolResultStatus,
11
12
  Toolset,
@@ -75,9 +76,7 @@ class ListActiveMetrics(BaseDatadogMetricsTool):
75
76
  toolset=toolset,
76
77
  )
77
78
 
78
- def _invoke(
79
- self, params: dict, user_approved: bool = False
80
- ) -> StructuredToolResult:
79
+ def _invoke(self, params: dict, context: ToolInvokeContext) -> StructuredToolResult:
81
80
  if not self.toolset.dd_config:
82
81
  return StructuredToolResult(
83
82
  status=StructuredToolResultStatus.ERROR,
@@ -237,9 +236,7 @@ class QueryMetrics(BaseDatadogMetricsTool):
237
236
  toolset=toolset,
238
237
  )
239
238
 
240
- def _invoke(
241
- self, params: dict, user_approved: bool = False
242
- ) -> StructuredToolResult:
239
+ def _invoke(self, params: dict, context: ToolInvokeContext) -> StructuredToolResult:
243
240
  if not self.toolset.dd_config:
244
241
  return StructuredToolResult(
245
242
  status=StructuredToolResultStatus.ERROR,
@@ -433,9 +430,7 @@ class QueryMetricsMetadata(BaseDatadogMetricsTool):
433
430
  toolset=toolset,
434
431
  )
435
432
 
436
- def _invoke(
437
- self, params: dict, user_approved: bool = False
438
- ) -> StructuredToolResult:
433
+ def _invoke(self, params: dict, context: ToolInvokeContext) -> StructuredToolResult:
439
434
  if not self.toolset.dd_config:
440
435
  return StructuredToolResult(
441
436
  status=StructuredToolResultStatus.ERROR,
@@ -549,9 +544,7 @@ class ListMetricTags(BaseDatadogMetricsTool):
549
544
  toolset=toolset,
550
545
  )
551
546
 
552
- def _invoke(
553
- self, params: dict, user_approved: bool = False
554
- ) -> StructuredToolResult:
547
+ def _invoke(self, params: dict, context: ToolInvokeContext) -> StructuredToolResult:
555
548
  if not self.toolset.dd_config:
556
549
  return StructuredToolResult(
557
550
  status=StructuredToolResultStatus.ERROR,
@@ -680,7 +673,7 @@ class DatadogMetricsToolset(Toolset):
680
673
  if not config:
681
674
  return (
682
675
  False,
683
- "Datadog metrics toolset requires configuration. Please provide: dd_api_key, dd_app_key, and site_api_url in your Holmes config. For more details, see https://holmesgpt.dev/data-sources/builtin-toolsets/datadog/",
676
+ "Missing config for dd_api_key, dd_app_key, or site_api_url. For details: https://holmesgpt.dev/data-sources/builtin-toolsets/datadog/",
684
677
  )
685
678
 
686
679
  try:
@@ -9,6 +9,7 @@ from holmes.core.tools import (
9
9
  CallablePrerequisite,
10
10
  StructuredToolResult,
11
11
  Tool,
12
+ ToolInvokeContext,
12
13
  ToolParameter,
13
14
  StructuredToolResultStatus,
14
15
  Toolset,
@@ -92,9 +93,7 @@ class GenerateRDSPerformanceReport(BaseDatadogRDSTool):
92
93
  toolset=toolset,
93
94
  )
94
95
 
95
- def _invoke(
96
- self, params: dict, user_approved: bool = False
97
- ) -> StructuredToolResult:
96
+ def _invoke(self, params: dict, context: ToolInvokeContext) -> StructuredToolResult:
98
97
  if not self.toolset.dd_config:
99
98
  return StructuredToolResult(
100
99
  status=StructuredToolResultStatus.ERROR,
@@ -392,9 +391,7 @@ class GetTopWorstPerformingRDSInstances(BaseDatadogRDSTool):
392
391
  toolset=toolset,
393
392
  )
394
393
 
395
- def _invoke(
396
- self, params: dict, user_approved: bool = False
397
- ) -> StructuredToolResult:
394
+ def _invoke(self, params: dict, context: ToolInvokeContext) -> StructuredToolResult:
398
395
  if not self.toolset.dd_config:
399
396
  return StructuredToolResult(
400
397
  status=StructuredToolResultStatus.ERROR,
@@ -9,6 +9,7 @@ from typing import Any, Dict, Optional, Tuple
9
9
  from holmes.core.tools import (
10
10
  CallablePrerequisite,
11
11
  Tool,
12
+ ToolInvokeContext,
12
13
  ToolParameter,
13
14
  Toolset,
14
15
  StructuredToolResult,
@@ -210,9 +211,7 @@ class FetchDatadogTracesList(BaseDatadogTracesTool):
210
211
  filter_str = ", ".join(filters) if filters else "all"
211
212
  return f"{toolset_name_for_one_liner(self.toolset.name)}: Fetch Traces ({filter_str})"
212
213
 
213
- def _invoke(
214
- self, params: dict, user_approved: bool = False
215
- ) -> StructuredToolResult:
214
+ def _invoke(self, params: dict, context: ToolInvokeContext) -> StructuredToolResult:
216
215
  """Execute the tool to fetch traces."""
217
216
  if not self.toolset.dd_config:
218
217
  return StructuredToolResult(
@@ -376,9 +375,7 @@ class FetchDatadogTraceById(BaseDatadogTracesTool):
376
375
  trace_id = params.get("trace_id", "unknown")
377
376
  return f"{toolset_name_for_one_liner(self.toolset.name)}: Fetch Trace Details ({trace_id})"
378
377
 
379
- def _invoke(
380
- self, params: dict, user_approved: bool = False
381
- ) -> StructuredToolResult:
378
+ def _invoke(self, params: dict, context: ToolInvokeContext) -> StructuredToolResult:
382
379
  """Execute the tool to fetch trace details."""
383
380
  if not self.toolset.dd_config:
384
381
  return StructuredToolResult(
@@ -559,9 +556,7 @@ class FetchDatadogSpansByFilter(BaseDatadogTracesTool):
559
556
  filter_str = ", ".join(filters) if filters else "all"
560
557
  return f"{toolset_name_for_one_liner(self.toolset.name)}: Search Spans ({filter_str})"
561
558
 
562
- def _invoke(
563
- self, params: dict, user_approved: bool = False
564
- ) -> StructuredToolResult:
559
+ def _invoke(self, params: dict, context: ToolInvokeContext) -> StructuredToolResult:
565
560
  """Execute the tool to search spans."""
566
561
  if not self.toolset.dd_config:
567
562
  return StructuredToolResult(
@@ -4,7 +4,11 @@ import requests # type: ignore
4
4
  import os
5
5
  from typing import Any, Optional, Dict, List, Tuple
6
6
  from pydantic import BaseModel
7
- from holmes.core.tools import StructuredToolResult, StructuredToolResultStatus
7
+ from holmes.core.tools import (
8
+ StructuredToolResult,
9
+ StructuredToolResultStatus,
10
+ ToolInvokeContext,
11
+ )
8
12
 
9
13
  from holmes.core.tools import (
10
14
  Toolset,
@@ -250,7 +254,9 @@ class GitReadFileWithLineNumbers(Tool):
250
254
  )
251
255
 
252
256
  def _invoke(
253
- self, params: dict, user_approved: bool = False
257
+ self,
258
+ params: dict,
259
+ context: ToolInvokeContext,
254
260
  ) -> StructuredToolResult:
255
261
  filepath = params["filepath"]
256
262
  try:
@@ -296,7 +302,9 @@ class GitListFiles(Tool):
296
302
  )
297
303
 
298
304
  def _invoke(
299
- self, params: dict, user_approved: bool = False
305
+ self,
306
+ params: dict,
307
+ context: ToolInvokeContext,
300
308
  ) -> StructuredToolResult:
301
309
  try:
302
310
  headers = {"Authorization": f"token {self.toolset.git_credentials}"}
@@ -338,9 +346,7 @@ class GitListOpenPRs(Tool):
338
346
  toolset=toolset, # type: ignore
339
347
  )
340
348
 
341
- def _invoke(
342
- self, params: dict, user_approved: bool = False
343
- ) -> StructuredToolResult:
349
+ def _invoke(self, params: dict, context: ToolInvokeContext) -> StructuredToolResult:
344
350
  try:
345
351
  prs = self.toolset.list_open_prs()
346
352
  formatted = [
@@ -408,9 +414,7 @@ class GitExecuteChanges(Tool):
408
414
  toolset=toolset, # type: ignore
409
415
  )
410
416
 
411
- def _invoke(
412
- self, params: dict, user_approved: bool = False
413
- ) -> StructuredToolResult:
417
+ def _invoke(self, params: dict, context: ToolInvokeContext) -> StructuredToolResult:
414
418
  def error(msg: str) -> StructuredToolResult:
415
419
  return StructuredToolResult(
416
420
  status=StructuredToolResultStatus.ERROR,
@@ -628,9 +632,7 @@ class GitUpdatePR(Tool):
628
632
  toolset=toolset, # type: ignore
629
633
  )
630
634
 
631
- def _invoke(
632
- self, params: dict, user_approved: bool = False
633
- ) -> StructuredToolResult:
635
+ def _invoke(self, params: dict, context: ToolInvokeContext) -> StructuredToolResult:
634
636
  try:
635
637
  line = params["line"]
636
638
  filename = params["filename"]