mcp-instana 0.1.1__py3-none-any.whl → 0.2.0__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.
Files changed (55) hide show
  1. {mcp_instana-0.1.1.dist-info → mcp_instana-0.2.0.dist-info}/METADATA +459 -138
  2. mcp_instana-0.2.0.dist-info/RECORD +59 -0
  3. src/application/application_analyze.py +373 -160
  4. src/application/application_catalog.py +3 -1
  5. src/application/application_global_alert_config.py +653 -0
  6. src/application/application_metrics.py +6 -2
  7. src/application/application_resources.py +3 -1
  8. src/application/application_settings.py +966 -370
  9. src/application/application_topology.py +6 -2
  10. src/automation/action_catalog.py +416 -0
  11. src/automation/action_history.py +338 -0
  12. src/core/server.py +159 -9
  13. src/core/utils.py +2 -2
  14. src/event/events_tools.py +602 -275
  15. src/infrastructure/infrastructure_analyze.py +7 -3
  16. src/infrastructure/infrastructure_catalog.py +3 -1
  17. src/infrastructure/infrastructure_metrics.py +6 -2
  18. src/infrastructure/infrastructure_resources.py +7 -5
  19. src/infrastructure/infrastructure_topology.py +5 -3
  20. src/prompts/__init__.py +16 -0
  21. src/prompts/application/__init__.py +1 -0
  22. src/prompts/application/application_alerts.py +54 -0
  23. src/prompts/application/application_catalog.py +26 -0
  24. src/prompts/application/application_metrics.py +57 -0
  25. src/prompts/application/application_resources.py +26 -0
  26. src/prompts/application/application_settings.py +75 -0
  27. src/prompts/application/application_topology.py +30 -0
  28. src/prompts/events/__init__.py +1 -0
  29. src/prompts/events/events_tools.py +161 -0
  30. src/prompts/infrastructure/infrastructure_analyze.py +72 -0
  31. src/prompts/infrastructure/infrastructure_catalog.py +53 -0
  32. src/prompts/infrastructure/infrastructure_metrics.py +45 -0
  33. src/prompts/infrastructure/infrastructure_resources.py +74 -0
  34. src/prompts/infrastructure/infrastructure_topology.py +38 -0
  35. src/prompts/settings/__init__.py +0 -0
  36. src/prompts/settings/custom_dashboard.py +157 -0
  37. src/prompts/website/__init__.py +1 -0
  38. src/prompts/website/website_analyze.py +35 -0
  39. src/prompts/website/website_catalog.py +40 -0
  40. src/prompts/website/website_configuration.py +105 -0
  41. src/prompts/website/website_metrics.py +34 -0
  42. src/settings/__init__.py +1 -0
  43. src/settings/custom_dashboard_tools.py +417 -0
  44. src/website/__init__.py +0 -0
  45. src/website/website_analyze.py +433 -0
  46. src/website/website_catalog.py +171 -0
  47. src/website/website_configuration.py +770 -0
  48. src/website/website_metrics.py +241 -0
  49. mcp_instana-0.1.1.dist-info/RECORD +0 -30
  50. src/prompts/mcp_prompts.py +0 -900
  51. src/prompts/prompt_loader.py +0 -29
  52. src/prompts/prompt_registry.json +0 -21
  53. {mcp_instana-0.1.1.dist-info → mcp_instana-0.2.0.dist-info}/WHEEL +0 -0
  54. {mcp_instana-0.1.1.dist-info → mcp_instana-0.2.0.dist-info}/entry_points.txt +0 -0
  55. {mcp_instana-0.1.1.dist-info → mcp_instana-0.2.0.dist-info}/licenses/LICENSE.md +0 -0
@@ -1,900 +0,0 @@
1
- import sys
2
- from collections import defaultdict
3
-
4
- prompts = {}
5
-
6
- def debug_print(*args, **kwargs):
7
- """Print debug information to stderr instead of stdout"""
8
- print(*args, file=sys.stderr, **kwargs)
9
-
10
- def prompt(name, description="", category="", arguments=None):
11
- if arguments is None:
12
- arguments = []
13
-
14
- def decorator(fn):
15
- prompts[name] = {
16
- "function": fn,
17
- "description": description,
18
- "category": category,
19
- "arguments": arguments
20
- }
21
- return fn
22
-
23
- return decorator
24
-
25
-
26
- # ----------------------------
27
- # Application Alerts Prompts
28
- # ----------------------------
29
-
30
- @prompt(
31
- name="app_alerts_list",
32
- description="List all application alerts in Instana",
33
- category="application_alerts",
34
- arguments=[{
35
- "name": "name_filter",
36
- "type": "string",
37
- "required": False,
38
- "description": "Filter alerts by application name (supports partial matches)"
39
- }, {
40
- "name": "severity",
41
- "type": "string",
42
- "required": False,
43
- "description": "Filter alerts by severity (e.g., 'CRITICAL', 'WARNING', 'INFO')"
44
- }, {
45
- "name": "from_time",
46
- "type": "integer",
47
- "required": False,
48
- "description": "Start timestamp in milliseconds (default: last 24 hours)"
49
- }, {
50
- "name": "to_time",
51
- "type": "integer",
52
- "required": False,
53
- "description": "End timestamp in milliseconds (default: current time)"
54
- }]
55
- )
56
-
57
- @prompt(
58
- name="app_alert_details",
59
- description="Get Smart Alert Configurations details for a specific application",
60
- category="application_alerts",
61
- arguments=[{
62
- "name": "alert_ids",
63
- "type": "List[str]",
64
- "required": False,
65
- "description": "List of alert IDs to retrieve details for"
66
- },
67
- {
68
- "name": "application_id",
69
- "type": "str",
70
- "required": False,
71
- "description": "ID of the application to which the alerts belong"
72
- }
73
- ]
74
- )
75
-
76
- @prompt(
77
- name="app_alert_config_delete",
78
- description="Delete a Smart Alert Configuration by ID",
79
- category="application_alerts",
80
- arguments=[{
81
- "name": "id",
82
- "type": "string",
83
- "required": True,
84
- "description": "ID of the Smart Alert Configuration to delete"
85
- }]
86
- )
87
-
88
- @prompt(
89
- name="app_alert_config_enable",
90
- description="Enable a Smart Alert Configuration by ID",
91
- category="application_alerts",
92
- arguments=[{
93
- "name": "id",
94
- "type": "string",
95
- "required": True,
96
- "description": "ID of the Smart Alert Configuration to enable"
97
- }]
98
- )
99
-
100
-
101
- # ----------------------------
102
- # Application Resource Prompts
103
- # ----------------------------
104
-
105
- @prompt(
106
- name="application_insights_summary",
107
- description="Retrieve a list of services within application perspectives from Instana.",
108
- category="application_resources",
109
- arguments=[
110
- {
111
- "name": "name_filter",
112
- "type": "string",
113
- "required": False,
114
- "description": "Filter applications or services by name (eg)"
115
- },
116
- {
117
- "name": "window_size",
118
- "type": "integer",
119
- "required": False,
120
- "description": "Size of time window in ms (default: 1 hour)"
121
- },
122
- {
123
- "name": "to_time",
124
- "type": "integer",
125
- "required": False,
126
- "description": "End timestamp in ms (default: now)"
127
- },
128
- {
129
- "name": "application_boundary_scope",
130
- "type": "string",
131
- "required": False,
132
- "description": "Scope (e.g., ALL, GROUP, SERVICE)"
133
- }
134
- ]
135
- )
136
-
137
-
138
-
139
-
140
- # ----------------------------
141
- # Application Metrics Prompts
142
- # ----------------------------
143
-
144
- @prompt(
145
- name="get_application_metrics",
146
- description="Retrieve metrics for specific applications including latency, error rates, etc., over a given time frame.",
147
- category="application_metrics",
148
- arguments=[
149
- {
150
- "name": "application_ids",
151
- "type": "list[str]",
152
- "required": False,
153
- "description": "List of application IDs to fetch metrics for"
154
- },
155
- {
156
- "name": "metrics",
157
- "type": "list[object]",
158
- "required": False,
159
- "description": "List of metrics with their aggregations (e.g., [{'metric': 'latency', 'aggregation': 'MEAN'}])"
160
- },
161
- {
162
- "name": "time_frame",
163
- "type": "object",
164
- "required": False,
165
- "description": "Time frame for the query (e.g., {'windowSize': 3600000, 'to': 1750861775680})"
166
- },
167
- {
168
- "name": "fill_time_series",
169
- "type": "boolean",
170
- "required": False,
171
- "description": "Fill missing data points with 0s"
172
- }
173
- ]
174
- )
175
-
176
- @prompt(
177
- name="get_application_endpoints_metrics",
178
- description="Retrieve metrics for endpoints within an application, such as latency, error rates, and call counts.",
179
- category="application_metrics",
180
- arguments=[
181
- {
182
- "name": "application_ids",
183
- "type": "list[str]",
184
- "required": True,
185
- "description": "List of application IDs whose endpoints should be queried"
186
- },
187
- {
188
- "name": "metrics",
189
- "type": "list[object]",
190
- "required": True,
191
- "description": "List of metric objects (e.g., [{'metric': 'latency', 'aggregation': 'MEAN'}])"
192
- },
193
- {
194
- "name": "time_frame",
195
- "type": "object",
196
- "required": True,
197
- "description": "Time frame for which to get metrics (e.g., {'windowSize': 3600000, 'to': 1750861775680})"
198
- },
199
- {
200
- "name": "order",
201
- "type": "object",
202
- "required": False,
203
- "description": "Sorting options (e.g., {'by': 'latency', 'direction': 'DESC'})"
204
- },
205
- {
206
- "name": "pagination",
207
- "type": "object",
208
- "required": False,
209
- "description": "Pagination info (e.g., {'page': 1, 'pageSize': 50})"
210
- },
211
- {
212
- "name": "filters",
213
- "type": "object",
214
- "required": False,
215
- "description": "Filter criteria like tags, services, endpoints etc."
216
- },
217
- {
218
- "name": "fill_time_series",
219
- "type": "boolean",
220
- "required": False,
221
- "description": "Whether to fill gaps in time series data with default values"
222
- }
223
- ]
224
- )
225
-
226
- @prompt(
227
- name="get_application_service_metrics",
228
- description="Fetchmetrics over a specific time frame for specific services.",
229
- category="application_metrics",
230
- arguments=[
231
- {
232
- "name": "service_ids",
233
- "type": "list[string]",
234
- "required": True,
235
- "description": "List of service IDs to fetch metrics for."
236
- },
237
- {
238
- "name": "metrics",
239
- "type": "list[object]",
240
- "required": False,
241
- "description": "List of metric definitions, (e.g., [{'metric': 'latency', 'aggregation': 'MEAN'}])"
242
- },
243
- {
244
- "name": "from",
245
- "type": "integer",
246
- "required": False,
247
- "description": "Start timestamp in milliseconds (default: 1 hour ago)"
248
- },
249
- {
250
- "name": "to",
251
- "type": "integer",
252
- "required": False,
253
- "description": "End timestamp in milliseconds (default: now)"
254
- },
255
- {
256
- "name": "fill_time_series",
257
- "type": "boolean",
258
- "required": False,
259
- "description": "Whether to fill missing data points with timestamp (default: true)"
260
- },
261
- {
262
- "name": "include_snapshot_ids",
263
- "type": "boolean",
264
- "required": False,
265
- "description": "Include snapshot IDs in the response (default: false)"
266
- }
267
- ]
268
- )
269
-
270
-
271
-
272
- # ----------------------------
273
- # Application Catalog Prompts
274
- # ----------------------------
275
-
276
- @prompt(
277
- name="app_catalog_yesterday",
278
- description="List 3 available application tag catalog data for yesterday ",
279
- category="application_catalog",
280
- arguments=[{
281
- "name": "use_case",
282
- "type": "string",
283
- "required": False,
284
- "description": "Use case for the tag catalog (e.g., 'GROUPING', 'FILTERING')"
285
- }, {
286
- "name": "data_source",
287
- "type": "string",
288
- "required": False,
289
- "description": "Data source for the tag catalog (e.g., 'CALLS', 'TRACES')"
290
- }, {
291
- "name": "var_from",
292
- "type": "integer",
293
- "required": False,
294
- "description": "Timestamp from which to get data (default: last 24 hours)"
295
- }, {
296
- "name": "limit",
297
- "type": "integer",
298
- "required": False,
299
- "description": "Limit the number of results returned (default: 100)"
300
- }
301
- ]
302
- )
303
-
304
- # --------------------------------
305
- # Infrastructure Analyze Prompts
306
- # --------------------------------
307
-
308
- @prompt(
309
- name="infra_available_metrics",
310
- description="Get available infrastructure metrics for a given entity type (e.g., jvmRuntimePlatform)",
311
- category="infrastructure_analyze",
312
- arguments=[
313
- {
314
- "name": "type",
315
- "type": "string",
316
- "required": True,
317
- "description": "Type of infrastructure entity (e.g., 'jvmRuntimePlatform')"
318
- },
319
- {
320
- "name": "query",
321
- "type": "string",
322
- "required": False,
323
- "description": "Optional search query for narrowing down metrics (e.g., 'java')"
324
- },
325
- {
326
- "name": "from",
327
- "type": "integer",
328
- "required": False,
329
- "description": "Start timestamp for the timeframe (eg., 1743923995000)"
330
- },
331
- {
332
- "name": "to",
333
- "type": "integer",
334
- "required": False,
335
- "description": "End timestamp for the timeframe (eg., 1743920395000)"
336
- },
337
- {
338
- "name": "windowSize",
339
- "type": "integer",
340
- "required": False,
341
- "description": "Window size in milliseconds (e.g., 3600000 for 1 hour)"
342
- }
343
- ]
344
- )
345
-
346
- @prompt(
347
- name="infra_get_entities",
348
- description="Fetch infrastructure entities and their metrics (e.g., memory used, blocked threads)",
349
- category="infrastructure_analyze",
350
- arguments=[
351
- {
352
- "name": "type",
353
- "type": "string",
354
- "required": True,
355
- "description": "Type of entity (e.g., 'jvmRuntimePlatform')"
356
- },
357
- {
358
- "name": "metrics",
359
- "type": "string",
360
- "required": True,
361
- "description": "List of metric objects as JSON string (e.g., memory.used, threads.blocked)"
362
- },
363
- {
364
- "name": "windowSize",
365
- "type": "integer",
366
- "required": False,
367
- "description": "Start timestamp for the timeframe (e.g., 3600000 for 1 hour)"
368
- },
369
- {
370
- "name": "to",
371
- "type": "integer",
372
- "required": False,
373
- "description": "End timestamp for the timeframe (e.g., 1743920395000)"
374
- }
375
- ]
376
- )
377
-
378
- @prompt(
379
- name="infra_available_plugins",
380
- description="List available infrastructure monitoring plugins (e.g., Java, Docker)",
381
- category="infrastructure_analyze",
382
- arguments=[
383
- {
384
- "name": "query",
385
- "type": "string",
386
- "required": False,
387
- "description": "Search term to filter plugin types (e.g., 'java')"
388
- },
389
- {
390
- "name": "offline",
391
- "type": "boolean",
392
- "required": False,
393
- "description": "Whether to include offline plugins (default: false)"
394
- },
395
- {
396
- "name": "windowSize",
397
- "type": "integer",
398
- "required": False,
399
- "description": "Start timestamp for the timeframe (e.g., 3600000 for 1 hour)"
400
- },
401
- {
402
- "name": "to",
403
- "type": "integer",
404
- "required": False,
405
- "description": "End timestamp for the timeframe (e.g., 1743923995000)"
406
- }
407
- ]
408
- )
409
-
410
- # --------------------------------
411
- # Infrastructure Metrics Prompts
412
- # --------------------------------
413
-
414
- @prompt(
415
- name="get_infrastructure_metrics",
416
- description="Retrieve infrastructure metrics for plugin and query with a given time frame for a rollup interval",
417
- category="infrastructure_metrics",
418
- arguments=[
419
- {
420
- "name": "plugin",
421
- "type": "string",
422
- "required": True,
423
- "description": "Plugin type to fetch metrics from (e.g., 'host')"
424
- },
425
- {
426
- "name": "query",
427
- "type": "string",
428
- "required": True,
429
- "description": "Query string to filter metrics (e.g., 'entity.selfType:java')"
430
- },
431
- {
432
- "name": "metrics",
433
- "type": "list",
434
- "required": True,
435
- "description": "List of metrics to fetch (e.g., [\"cpu.usage\", \"mem.usage\"])"
436
- },
437
- {
438
- "name": "snapshot_ids",
439
- "type": "list",
440
- "required": False,
441
- "description": "List of snapshot IDs to filter (eg: w1Wx4kqX5EuemG7Iw8N8SJnBC3A) --- if not provided, all snapshots will be considered"
442
- },
443
- {
444
- "name": "offline",
445
- "type": "boolean",
446
- "required": False,
447
- "description": "Include offline snapshots in the result (default: false)"
448
- },
449
- {
450
- "name": "window_size",
451
- "type": "integer",
452
- "required": False,
453
- "description": "Window size in milliseconds (default: 3600000 for 1 hour)"
454
- },
455
- {
456
- "name": "to",
457
- "type": "integer",
458
- "required": False,
459
- "description": "End timestamp in milliseconds (default: current time)"
460
- },
461
- {
462
- "name": "rollup",
463
- "type": "integer",
464
- "required": False,
465
- "description": "Rollup interval in seconds (default: 60)"
466
- }
467
- ]
468
- )
469
-
470
- # --------------------------------
471
- # Infrastructure Resources Prompts
472
- # --------------------------------
473
-
474
- @prompt(
475
- name="get_infrastructure_monitoring_state",
476
- description="Get an overview of the current Instana monitoring state, including monitored hosts and serverless entities.",
477
- category="infrastructure_resources",
478
- )
479
-
480
- @prompt(
481
- name="get_infrastructure_plugin_payload",
482
- description="Get raw plugin payload data for a specific snapshot entity in Instana.",
483
- category="infrastructure_resources",
484
- arguments=[
485
- {
486
- "name": "snapshot_id",
487
- "type": "string",
488
- "required": True,
489
- "description": "ID of the snapshot to fetch plugin payload for."
490
- },
491
- {
492
- "name": "payload_key",
493
- "type": "string",
494
- "required": True,
495
- "description": "Key of the payload to retrieve (e.g., 'topqueries')."
496
- },
497
- {
498
- "name": "to_time",
499
- "type": "integer",
500
- "required": False,
501
- "description": "End timestamp in milliseconds (default: current time)."
502
- },
503
- {
504
- "name": "window_size",
505
- "type": "integer",
506
- "required": False,
507
- "description": "Window size in milliseconds (default: 3600000 for 1 hour)."
508
- }
509
- ]
510
- )
511
-
512
- @prompt(
513
- name="get_infrastructure_metrics_snapshot",
514
- description="Get detailed information for a single infrastructure snapshot using its ID.",
515
- category="infrastructure_resources",
516
- arguments=[
517
- {
518
- "name": "snapshot_id",
519
- "type": "string",
520
- "required": True,
521
- "description": "Snapshot ID to retrieve details for."
522
- },
523
- {
524
- "name": "to_time",
525
- "type": "integer",
526
- "required": False,
527
- "description": "End timestamp in milliseconds (default: current time)."
528
- },
529
- {
530
- "name": "window_size",
531
- "type": "integer",
532
- "required": False,
533
- "description": "Window size in milliseconds (default: 3600000 for 1 hour)."
534
- }
535
- ]
536
- )
537
-
538
- @prompt(
539
- name="post_infrastructure_metrics_snapshot",
540
- description="Fetch details of multiple snapshots by their IDs.",
541
- category="infrastructure_resources",
542
- arguments=[
543
- {
544
- "name": "snapshot_ids",
545
- "type": "list",
546
- "required": True,
547
- "description": "List of snapshot IDs to retrieve."
548
- },
549
- {
550
- "name": "to_time",
551
- "type": "integer",
552
- "required": False,
553
- "description": "End timestamp in milliseconds (default: current time)."
554
- },
555
- {
556
- "name": "window_size",
557
- "type": "integer",
558
- "required": False,
559
- "description": "Window size in milliseconds (default: 3600000 for 1 hour )."
560
- },
561
- {
562
- "name": "detailed",
563
- "type": "boolean",
564
- "required": False,
565
- "description": "Return detailed/raw data if True; summarized data if False (default: False)."
566
- }
567
- ]
568
- )
569
-
570
- # --------------------------------
571
- # Infrastructure Topology Prompts
572
- # --------------------------------
573
-
574
- @prompt(
575
- name="get_related_hosts",
576
- description="Get hosts related to a specific snapshot, helping to understand infrastructure dependencies for a given entity.",
577
- category="infrastructure_topology",
578
- arguments=[
579
- {
580
- "name": "snapshot_id",
581
- "type": "string",
582
- "required": True,
583
- "description": "The ID of the snapshot to find related hosts for."
584
- },
585
- {
586
- "name": "to_time",
587
- "type": "integer",
588
- "required": False,
589
- "description": "End timestamp in milliseconds (default: 3600000 for 1 hour)."
590
- },
591
- {
592
- "name": "window_size",
593
- "type": "integer",
594
- "required": False,
595
- "description": "Time window in milliseconds for the related hosts query (default: 3600000 for 1 hour ) ."
596
- }
597
- ]
598
- )
599
-
600
- # --------------------------------
601
- # Application Topology Prompts
602
- # --------------------------------
603
-
604
- @prompt(
605
- name="get_application_topology",
606
- description="Retrieve the service topology showing connections between services in an application.",
607
- category="application_topology",
608
- arguments=[
609
- {
610
- "name": "window_size",
611
- "type": "integer",
612
- "required": False,
613
- "description": "Size of time window in milliseconds (default: 3600000 for 1 hour)"
614
- },
615
- {
616
- "name": "to_timestamp",
617
- "type": "integer",
618
- "required": False,
619
- "description": "Timestamp since Unix Epoch in milliseconds of the end of the time window (default: current time)"
620
- },
621
- {
622
- "name": "application_id",
623
- "type": "string",
624
- "required": False,
625
- "description": "Filter by application ID to show topology for a specific application"
626
- },
627
- {
628
- "name": "application_boundary_scope",
629
- "type": "string",
630
- "required": False,
631
- "description": "Filter by application scope, i.e., INBOUND or ALL (default: INBOUND)"
632
- }
633
- ]
634
- )
635
-
636
- # --------------------------------
637
- # Infrastructure Topology Prompts
638
- # --------------------------------
639
-
640
- @prompt(
641
- name="get_topology",
642
- description="Retrieve the complete infrastructure topology including nodes and edges, showing relationships and dependencies between monitored entities.",
643
- category="infrastructure_topology",
644
- arguments=[
645
- {
646
- "name": "include_data",
647
- "type": "boolean",
648
- "required": False,
649
- "description": "Whether to include detailed snapshot data for nodes (default: False)."
650
- }
651
- ]
652
- )
653
-
654
-
655
- # --------------------------------
656
- # Infrastructure Catalog Prompts
657
- # --------------------------------
658
- @prompt(
659
- name="get_available_payload_keys_by_plugin_id",
660
- description="Retrieve available payload keys for a specific plugin, used to access detailed monitoring data structures for that technology.",
661
- category="infrastructure_catalog",
662
- arguments=[
663
- {
664
- "name": "plugin_id",
665
- "type": "string",
666
- "required": True,
667
- "description": "The ID of the plugin to retrieve payload keys for."
668
- }
669
- ]
670
- )
671
-
672
- @prompt(
673
- name="get_infrastructure_catalog_metrics",
674
- description="Get the list of available metrics for a specified plugin (e.g., host, JVM, Kubernetes), supporting metric exploration for dashboards and queries.",
675
- category="infrastructure_catalog",
676
- arguments=[
677
- {
678
- "name": "plugin",
679
- "type": "string",
680
- "required": True,
681
- "description": "The plugin ID to fetch metrics for."
682
- },
683
- {
684
- "name": "filter",
685
- "type": "string",
686
- "required": False,
687
- "description": "Filter type to apply, (e.g., 'custom' or 'builtin')."
688
- }
689
- ]
690
- )
691
-
692
- @prompt(
693
- name="get_tag_catalog",
694
- description="Get available tags for a specific plugin, useful for grouping, filtering, or customizing visualizations and alerts.",
695
- category="infrastructure_catalog",
696
- arguments=[
697
- {
698
- "name": "plugin",
699
- "type": "string",
700
- "required": True,
701
- "description": "Plugin ID (e.g., 'host', 'jvm', 'kubernetes') to retrieve tags for."
702
- }
703
- ]
704
- )
705
-
706
- @prompt(
707
- name="get_tag_catalog_all",
708
- description="Retrieve the complete list of tags available across all monitored entities and plugins in your Instana environment.",
709
- category="infrastructure_catalog",
710
- )
711
-
712
-
713
- # ----------------------------
714
- # System Utility
715
- # ----------------------------
716
-
717
-
718
- @prompt(
719
- name="get_all_application_prompts",
720
- description="List all available application-related prompts with descriptions and arguments",
721
- category="system"
722
- )
723
- def get_all_application_prompts():
724
- try:
725
- grouped = defaultdict(list)
726
-
727
- for name, data in prompts.items():
728
- if name == "get_all_application_prompts":
729
- continue
730
-
731
- if not isinstance(data, dict):
732
- continue
733
-
734
- # Format arguments with all details
735
- formatted_args = []
736
- for arg in data.get("arguments", []):
737
- arg_line = f" • {arg['name']} ({arg['type']})"
738
- if arg.get('required', False):
739
- arg_line += " [REQUIRED]"
740
- if 'description' in arg:
741
- arg_line += f" - {arg['description']}"
742
- if 'default' in arg:
743
- arg_line += f" (default: {arg['default']})"
744
- formatted_args.append(arg_line)
745
-
746
- grouped[data.get("category", "Uncategorized")].append({
747
- "name": name,
748
- "description": data.get("description", ""),
749
- "arguments": formatted_args
750
- })
751
-
752
- # Build the output
753
- output = []
754
- output.append("=== AVAILABLE PROMPTS ===")
755
- output.append("")
756
-
757
- for category, items in sorted(grouped.items()):
758
- output.append(f"--- {category.upper()} ---")
759
- for item in sorted(items, key=lambda x: x['name']):
760
- output.append(f"\n🔹 {item['name']}")
761
- output.append(f" {item['description']}")
762
-
763
- if item["arguments"]:
764
- output.append(" Arguments:")
765
- output.extend(item["arguments"])
766
- else:
767
- output.append(" No arguments required")
768
-
769
- output.append("") # Empty line between categories
770
-
771
- return "\n".join(output)
772
-
773
- except Exception as e:
774
- return f"Error generating prompt list: {e!s}"
775
-
776
-
777
-
778
- @prompt(
779
- name="get_all_infrastructure_prompts",
780
- description="List all available infrastructure-related prompts with descriptions and arguments",
781
- category="system"
782
- )
783
- def get_all_infrastructure_prompts():
784
- try:
785
- grouped = defaultdict(list)
786
-
787
- for name, data in prompts.items():
788
- if name == "get_all_infrastructure_prompts":
789
- continue
790
-
791
- if not isinstance(data, dict):
792
- continue
793
-
794
- # Format arguments with all details
795
- formatted_args = []
796
- for arg in data.get("arguments", []):
797
- arg_line = f" • {arg['name']} ({arg['type']})"
798
- if arg.get('required', False):
799
- arg_line += " [REQUIRED]"
800
- if 'description' in arg:
801
- arg_line += f" - {arg['description']}"
802
- if 'default' in arg:
803
- arg_line += f" (default: {arg['default']})"
804
- formatted_args.append(arg_line)
805
-
806
- grouped[data.get("category", "Uncategorized")].append({
807
- "name": name,
808
- "description": data.get("description", ""),
809
- "arguments": formatted_args
810
- })
811
-
812
- # Build the output
813
- output = []
814
- output.append("=== AVAILABLE PROMPTS ===")
815
- output.append("")
816
-
817
- for category, items in sorted(grouped.items()):
818
- output.append(f"--- {category.upper()} ---")
819
- for item in sorted(items, key=lambda x: x['name']):
820
- output.append(f"\n🔹 {item['name']}")
821
- output.append(f" {item['description']}")
822
-
823
- if item["arguments"]:
824
- output.append(" Arguments:")
825
- output.extend(item["arguments"])
826
- else:
827
- output.append(" No arguments required")
828
-
829
- output.append("") # Empty line between categories
830
-
831
- return "\n".join(output)
832
-
833
- except Exception as e:
834
- return f"Error generating prompt list: {e!s}"
835
-
836
-
837
-
838
-
839
- @prompt(
840
- name="get_all_prompts",
841
- description="List all available prompts with descriptions and arguments",
842
- category="system",
843
- arguments=[]
844
- )
845
- def get_all_prompts():
846
- try:
847
- grouped = defaultdict(list)
848
-
849
- for name, data in prompts.items():
850
- if name == "get_all_prompts":
851
- continue
852
-
853
- if not isinstance(data, dict):
854
- continue
855
-
856
- # Format arguments with all details
857
- formatted_args = []
858
- for arg in data.get("arguments", []):
859
- arg_line = f" • {arg['name']} ({arg['type']})"
860
- if arg.get('required', False):
861
- arg_line += " [REQUIRED]"
862
- if 'description' in arg:
863
- arg_line += f" - {arg['description']}"
864
- if 'default' in arg:
865
- arg_line += f" (default: {arg['default']})"
866
- formatted_args.append(arg_line)
867
-
868
- grouped[data.get("category", "Uncategorized")].append({
869
- "name": name,
870
- "description": data.get("description", ""),
871
- "arguments": formatted_args
872
- })
873
-
874
- # Build the output
875
- output = []
876
- output.append("=== AVAILABLE PROMPTS ===")
877
- output.append("")
878
-
879
- for category, items in sorted(grouped.items()):
880
- output.append(f"--- {category.upper()} ---")
881
- for item in sorted(items, key=lambda x: x['name']):
882
- output.append(f"\n🔹 {item['name']}")
883
- output.append(f" {item['description']}")
884
-
885
- if item["arguments"]:
886
- output.append(" Arguments:")
887
- output.extend(item["arguments"])
888
- else:
889
- output.append(" No arguments required")
890
-
891
- output.append("") # Empty line between categories
892
-
893
- return "\n".join(output)
894
-
895
- except Exception as e:
896
- return f"Error generating prompt list: {e!s}"
897
-
898
-
899
- INSTANA_PROMPTS = prompts
900
-