honeycomb-api 0.1.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.
- honeycomb/__init__.py +217 -0
- honeycomb/_generated/__init__.py +8 -0
- honeycomb/_generated/api/__init__.py +1 -0
- honeycomb/_generated/api/auth/__init__.py +0 -0
- honeycomb/_generated/api/auth/get_auth.py +172 -0
- honeycomb/_generated/api/auth/get_v2_auth.py +168 -0
- honeycomb/_generated/api/boards/__init__.py +0 -0
- honeycomb/_generated/api/boards/create_board.py +217 -0
- honeycomb/_generated/api/boards/create_board_view.py +237 -0
- honeycomb/_generated/api/boards/delete_board.py +191 -0
- honeycomb/_generated/api/boards/delete_board_view.py +210 -0
- honeycomb/_generated/api/boards/get_board.py +208 -0
- honeycomb/_generated/api/boards/get_board_view.py +214 -0
- honeycomb/_generated/api/boards/list_board_views.py +206 -0
- honeycomb/_generated/api/boards/list_boards.py +177 -0
- honeycomb/_generated/api/boards/update_board.py +238 -0
- honeycomb/_generated/api/boards/update_board_view.py +250 -0
- honeycomb/_generated/api/burn_alerts/__init__.py +0 -0
- honeycomb/_generated/api/burn_alerts/create_burn_alert.py +224 -0
- honeycomb/_generated/api/burn_alerts/delete_burn_alert.py +204 -0
- honeycomb/_generated/api/burn_alerts/get_burn_alert.py +208 -0
- honeycomb/_generated/api/burn_alerts/list_burn_alerts_by_slo.py +220 -0
- honeycomb/_generated/api/calculated_fields/__init__.py +0 -0
- honeycomb/_generated/api/calculated_fields/create_calculated_field.py +239 -0
- honeycomb/_generated/api/calculated_fields/delete_calculated_field.py +225 -0
- honeycomb/_generated/api/calculated_fields/get_calculated_field.py +207 -0
- honeycomb/_generated/api/calculated_fields/list_calculated_fields.py +252 -0
- honeycomb/_generated/api/calculated_fields/update_calculated_field.py +242 -0
- honeycomb/_generated/api/columns/__init__.py +0 -0
- honeycomb/_generated/api/columns/create_column.py +241 -0
- honeycomb/_generated/api/columns/delete_column.py +221 -0
- honeycomb/_generated/api/columns/get_column.py +206 -0
- honeycomb/_generated/api/columns/list_columns.py +256 -0
- honeycomb/_generated/api/columns/update_column.py +242 -0
- honeycomb/_generated/api/dataset_definitions/__init__.py +0 -0
- honeycomb/_generated/api/dataset_definitions/list_dataset_definitions.py +193 -0
- honeycomb/_generated/api/dataset_definitions/patch_dataset_definitions.py +235 -0
- honeycomb/_generated/api/datasets/__init__.py +0 -0
- honeycomb/_generated/api/datasets/create_dataset.py +227 -0
- honeycomb/_generated/api/datasets/delete_dataset.py +251 -0
- honeycomb/_generated/api/datasets/get_dataset.py +195 -0
- honeycomb/_generated/api/datasets/list_datasets.py +177 -0
- honeycomb/_generated/api/datasets/update_dataset.py +217 -0
- honeycomb/_generated/api/enhance/__init__.py +0 -0
- honeycomb/_generated/api/enhance/record_enhance_indexer_usage.py +231 -0
- honeycomb/_generated/api/environments/__init__.py +0 -0
- honeycomb/_generated/api/environments/create_environment.py +247 -0
- honeycomb/_generated/api/environments/delete_environment.py +245 -0
- honeycomb/_generated/api/environments/get_environment.py +213 -0
- honeycomb/_generated/api/environments/list_environments.py +245 -0
- honeycomb/_generated/api/environments/update_environment.py +254 -0
- honeycomb/_generated/api/events/__init__.py +0 -0
- honeycomb/_generated/api/events/create_event.py +269 -0
- honeycomb/_generated/api/events/create_events.py +314 -0
- honeycomb/_generated/api/key_management/__init__.py +0 -0
- honeycomb/_generated/api/key_management/create_api_key.py +286 -0
- honeycomb/_generated/api/key_management/delete_api_key.py +223 -0
- honeycomb/_generated/api/key_management/get_api_key.py +225 -0
- honeycomb/_generated/api/key_management/list_api_keys.py +281 -0
- honeycomb/_generated/api/key_management/update_api_key.py +270 -0
- honeycomb/_generated/api/kinesis_events/__init__.py +0 -0
- honeycomb/_generated/api/kinesis_events/create_kinesis_events.py +220 -0
- honeycomb/_generated/api/marker_settings/__init__.py +0 -0
- honeycomb/_generated/api/marker_settings/create_marker_setting.py +209 -0
- honeycomb/_generated/api/marker_settings/delete_marker_settings.py +194 -0
- honeycomb/_generated/api/marker_settings/list_marker_settings.py +186 -0
- honeycomb/_generated/api/marker_settings/update_marker_settings.py +230 -0
- honeycomb/_generated/api/markers/__init__.py +0 -0
- honeycomb/_generated/api/markers/create_marker.py +220 -0
- honeycomb/_generated/api/markers/create_marker_v2.py +253 -0
- honeycomb/_generated/api/markers/delete_marker.py +200 -0
- honeycomb/_generated/api/markers/get_marker.py +194 -0
- honeycomb/_generated/api/markers/update_marker.py +233 -0
- honeycomb/_generated/api/markers/update_marker_v2.py +262 -0
- honeycomb/_generated/api/pipelines/__init__.py +0 -0
- honeycomb/_generated/api/pipelines/get_pipeline_configuration.py +306 -0
- honeycomb/_generated/api/pipelines/record_pipeline_usage.py +244 -0
- honeycomb/_generated/api/pipelines/update_pipeline_configuration_rollout.py +261 -0
- honeycomb/_generated/api/queries/__init__.py +0 -0
- honeycomb/_generated/api/queries/create_query.py +224 -0
- honeycomb/_generated/api/queries/get_query.py +208 -0
- honeycomb/_generated/api/query_annotations/__init__.py +0 -0
- honeycomb/_generated/api/query_annotations/create_query_annotation.py +226 -0
- honeycomb/_generated/api/query_annotations/delete_query_annotation.py +198 -0
- honeycomb/_generated/api/query_annotations/get_query_annotation.py +202 -0
- honeycomb/_generated/api/query_annotations/list_query_annotations.py +217 -0
- honeycomb/_generated/api/query_annotations/update_query_annotation.py +237 -0
- honeycomb/_generated/api/query_data/__init__.py +0 -0
- honeycomb/_generated/api/query_data/create_query_result.py +247 -0
- honeycomb/_generated/api/query_data/get_query_result.py +208 -0
- honeycomb/_generated/api/recipients/__init__.py +0 -0
- honeycomb/_generated/api/recipients/create_recipient.py +317 -0
- honeycomb/_generated/api/recipients/delete_recipient.py +199 -0
- honeycomb/_generated/api/recipients/get_recipient.py +252 -0
- honeycomb/_generated/api/recipients/list_recipients.py +230 -0
- honeycomb/_generated/api/recipients/update_recipient.py +323 -0
- honeycomb/_generated/api/reporting/__init__.py +0 -0
- honeycomb/_generated/api/reporting/get_slo_history.py +218 -0
- honeycomb/_generated/api/service_maps/__init__.py +0 -0
- honeycomb/_generated/api/service_maps/create_map_dependency_request.py +252 -0
- honeycomb/_generated/api/service_maps/get_map_dependencies.py +265 -0
- honeycomb/_generated/api/sl_os/__init__.py +0 -0
- honeycomb/_generated/api/sl_os/create_slo.py +229 -0
- honeycomb/_generated/api/sl_os/delete_slo.py +210 -0
- honeycomb/_generated/api/sl_os/get_slo.py +256 -0
- honeycomb/_generated/api/sl_os/list_slos.py +210 -0
- honeycomb/_generated/api/sl_os/update_slo.py +242 -0
- honeycomb/_generated/api/triggers/__init__.py +0 -0
- honeycomb/_generated/api/triggers/create_trigger.py +250 -0
- honeycomb/_generated/api/triggers/delete_trigger.py +204 -0
- honeycomb/_generated/api/triggers/get_trigger.py +214 -0
- honeycomb/_generated/api/triggers/list_triggers.py +206 -0
- honeycomb/_generated/api/triggers/list_triggers_with_recipient.py +208 -0
- honeycomb/_generated/api/triggers/update_trigger.py +248 -0
- honeycomb/_generated/client.py +271 -0
- honeycomb/_generated/errors.py +14 -0
- honeycomb/_generated/models/__init__.py +561 -0
- honeycomb/_generated/models/api_key_create_request.py +78 -0
- honeycomb/_generated/models/api_key_create_request_data.py +130 -0
- honeycomb/_generated/models/api_key_create_request_data_relationships.py +78 -0
- honeycomb/_generated/models/api_key_create_request_data_type.py +7 -0
- honeycomb/_generated/models/api_key_list_response.py +112 -0
- honeycomb/_generated/models/api_key_object.py +189 -0
- honeycomb/_generated/models/api_key_object_links.py +74 -0
- honeycomb/_generated/models/api_key_object_relationships.py +150 -0
- honeycomb/_generated/models/api_key_object_type.py +7 -0
- honeycomb/_generated/models/api_key_response.py +78 -0
- honeycomb/_generated/models/api_key_update_request.py +104 -0
- honeycomb/_generated/models/auth.py +140 -0
- honeycomb/_generated/models/auth_api_key_access.py +154 -0
- honeycomb/_generated/models/auth_environment.py +82 -0
- honeycomb/_generated/models/auth_team.py +82 -0
- honeycomb/_generated/models/auth_type.py +8 -0
- honeycomb/_generated/models/auth_v2_response.py +108 -0
- honeycomb/_generated/models/auth_v2_response_data.py +122 -0
- honeycomb/_generated/models/auth_v2_response_data_attributes.py +141 -0
- honeycomb/_generated/models/auth_v2_response_data_attributes_key_type.py +7 -0
- honeycomb/_generated/models/auth_v2_response_data_attributes_timestamps.py +107 -0
- honeycomb/_generated/models/auth_v2_response_data_relationships.py +59 -0
- honeycomb/_generated/models/auth_v2_response_data_type.py +7 -0
- honeycomb/_generated/models/base_trigger.py +367 -0
- honeycomb/_generated/models/base_trigger_alert_type.py +8 -0
- honeycomb/_generated/models/base_trigger_baseline_details_type_0.py +92 -0
- honeycomb/_generated/models/base_trigger_baseline_details_type_0_offset_minutes.py +10 -0
- honeycomb/_generated/models/base_trigger_baseline_details_type_0_type.py +8 -0
- honeycomb/_generated/models/base_trigger_evaluation_schedule.py +83 -0
- honeycomb/_generated/models/base_trigger_evaluation_schedule_type.py +8 -0
- honeycomb/_generated/models/base_trigger_evaluation_schedule_window.py +103 -0
- honeycomb/_generated/models/base_trigger_evaluation_schedule_window_days_of_week_item.py +13 -0
- honeycomb/_generated/models/base_trigger_threshold.py +95 -0
- honeycomb/_generated/models/base_trigger_threshold_op.py +10 -0
- honeycomb/_generated/models/batch_event.py +110 -0
- honeycomb/_generated/models/board.py +276 -0
- honeycomb/_generated/models/board_layout_generation.py +8 -0
- honeycomb/_generated/models/board_links.py +74 -0
- honeycomb/_generated/models/board_panel_position.py +104 -0
- honeycomb/_generated/models/board_query_visualization_settings.py +141 -0
- honeycomb/_generated/models/board_query_visualization_settings_charts_item.py +113 -0
- honeycomb/_generated/models/board_query_visualization_settings_charts_item_chart_type.py +13 -0
- honeycomb/_generated/models/board_type.py +7 -0
- honeycomb/_generated/models/board_view_filter.py +93 -0
- honeycomb/_generated/models/board_view_filter_operation.py +22 -0
- honeycomb/_generated/models/board_view_response.py +111 -0
- honeycomb/_generated/models/budget_rate.py +189 -0
- honeycomb/_generated/models/budget_rate_alert_type.py +8 -0
- honeycomb/_generated/models/burn_alert_shared_params.py +136 -0
- honeycomb/_generated/models/calculated_field.py +117 -0
- honeycomb/_generated/models/configuration_key_attributes.py +140 -0
- honeycomb/_generated/models/configuration_key_attributes_key_type.py +7 -0
- honeycomb/_generated/models/configuration_key_attributes_timestamps.py +107 -0
- honeycomb/_generated/models/create_board_view_request.py +96 -0
- honeycomb/_generated/models/create_budget_rate_burn_alert_request.py +232 -0
- honeycomb/_generated/models/create_budget_rate_burn_alert_request_slo.py +74 -0
- honeycomb/_generated/models/create_column.py +149 -0
- honeycomb/_generated/models/create_column_type.py +11 -0
- honeycomb/_generated/models/create_enhance_indexer_usage_record_request.py +78 -0
- honeycomb/_generated/models/create_enhance_indexer_usage_record_request_data.py +90 -0
- honeycomb/_generated/models/create_enhance_indexer_usage_record_request_data_attributes.py +97 -0
- honeycomb/_generated/models/create_enhance_indexer_usage_record_request_data_attributes_usage_data.py +88 -0
- honeycomb/_generated/models/create_enhance_indexer_usage_record_request_data_attributes_usage_data_resource_metrics_item.py +89 -0
- honeycomb/_generated/models/create_enhance_indexer_usage_record_request_data_attributes_usage_data_resource_metrics_item_scope_metrics_item.py +89 -0
- honeycomb/_generated/models/create_enhance_indexer_usage_record_request_data_attributes_usage_data_resource_metrics_item_scope_metrics_item_metrics_item.py +97 -0
- honeycomb/_generated/models/create_enhance_indexer_usage_record_request_data_attributes_usage_data_resource_metrics_item_scope_metrics_item_metrics_item_sum.py +102 -0
- honeycomb/_generated/models/create_enhance_indexer_usage_record_request_data_attributes_usage_data_resource_metrics_item_scope_metrics_item_metrics_item_sum_aggregation_temporality.py +7 -0
- honeycomb/_generated/models/create_enhance_indexer_usage_record_request_data_attributes_usage_data_resource_metrics_item_scope_metrics_item_metrics_item_sum_datapoints_item.py +105 -0
- honeycomb/_generated/models/create_enhance_indexer_usage_record_request_data_attributes_usage_data_resource_metrics_item_scope_metrics_item_metrics_item_sum_datapoints_item_attributes_item.py +87 -0
- honeycomb/_generated/models/create_enhance_indexer_usage_record_request_data_attributes_usage_data_resource_metrics_item_scope_metrics_item_metrics_item_sum_datapoints_item_attributes_item_value.py +73 -0
- honeycomb/_generated/models/create_enhance_indexer_usage_record_request_data_type.py +7 -0
- honeycomb/_generated/models/create_environment_request.py +78 -0
- honeycomb/_generated/models/create_environment_request_data.py +90 -0
- honeycomb/_generated/models/create_environment_request_data_attributes.py +102 -0
- honeycomb/_generated/models/create_environment_request_data_type.py +7 -0
- honeycomb/_generated/models/create_events_content_encoding.py +8 -0
- honeycomb/_generated/models/create_events_response_200_item.py +82 -0
- honeycomb/_generated/models/create_exhaustion_time_burn_alert_request.py +217 -0
- honeycomb/_generated/models/create_exhaustion_time_burn_alert_request_slo.py +74 -0
- honeycomb/_generated/models/create_map_dependencies_request.py +128 -0
- honeycomb/_generated/models/create_map_dependencies_response.py +97 -0
- honeycomb/_generated/models/create_map_dependencies_response_status.py +9 -0
- honeycomb/_generated/models/create_pipeline_health_record_request.py +78 -0
- honeycomb/_generated/models/create_pipeline_health_record_request_data.py +98 -0
- honeycomb/_generated/models/create_pipeline_health_record_request_data_attributes.py +88 -0
- honeycomb/_generated/models/create_pipeline_health_record_request_data_attributes_usage_data.py +88 -0
- honeycomb/_generated/models/create_pipeline_health_record_request_data_attributes_usage_data_resource_metrics_item.py +89 -0
- honeycomb/_generated/models/create_pipeline_health_record_request_data_attributes_usage_data_resource_metrics_item_scope_metrics_item.py +89 -0
- honeycomb/_generated/models/create_pipeline_health_record_request_data_attributes_usage_data_resource_metrics_item_scope_metrics_item_metrics_item.py +97 -0
- honeycomb/_generated/models/create_pipeline_health_record_request_data_attributes_usage_data_resource_metrics_item_scope_metrics_item_metrics_item_sum.py +102 -0
- honeycomb/_generated/models/create_pipeline_health_record_request_data_attributes_usage_data_resource_metrics_item_scope_metrics_item_metrics_item_sum_aggregation_temporality.py +7 -0
- honeycomb/_generated/models/create_pipeline_health_record_request_data_attributes_usage_data_resource_metrics_item_scope_metrics_item_metrics_item_sum_datapoints_item.py +105 -0
- honeycomb/_generated/models/create_pipeline_health_record_request_data_attributes_usage_data_resource_metrics_item_scope_metrics_item_metrics_item_sum_datapoints_item_attributes_item.py +87 -0
- honeycomb/_generated/models/create_pipeline_health_record_request_data_attributes_usage_data_resource_metrics_item_scope_metrics_item_metrics_item_sum_datapoints_item_attributes_item_value.py +73 -0
- honeycomb/_generated/models/create_pipeline_health_record_request_data_type.py +7 -0
- honeycomb/_generated/models/create_query_result_request.py +118 -0
- honeycomb/_generated/models/dataset.py +183 -0
- honeycomb/_generated/models/dataset_creation_payload.py +93 -0
- honeycomb/_generated/models/dataset_definition_type_1.py +96 -0
- honeycomb/_generated/models/dataset_definition_type_1_column_type.py +8 -0
- honeycomb/_generated/models/dataset_definitions.py +599 -0
- honeycomb/_generated/models/dataset_relationship.py +79 -0
- honeycomb/_generated/models/dataset_relationship_data.py +82 -0
- honeycomb/_generated/models/dataset_relationship_data_type.py +7 -0
- honeycomb/_generated/models/dataset_settings.py +73 -0
- honeycomb/_generated/models/dataset_update_payload.py +105 -0
- honeycomb/_generated/models/dataset_update_payload_settings.py +73 -0
- honeycomb/_generated/models/detailed_error.py +115 -0
- honeycomb/_generated/models/email_recipient.py +160 -0
- honeycomb/_generated/models/email_recipient_details.py +71 -0
- honeycomb/_generated/models/email_recipient_type.py +7 -0
- honeycomb/_generated/models/environment.py +112 -0
- honeycomb/_generated/models/environment_attributes.py +140 -0
- honeycomb/_generated/models/environment_attributes_color_type_1.py +7 -0
- honeycomb/_generated/models/environment_attributes_settings.py +70 -0
- honeycomb/_generated/models/environment_color.py +16 -0
- honeycomb/_generated/models/environment_links.py +70 -0
- honeycomb/_generated/models/environment_list_response.py +112 -0
- honeycomb/_generated/models/environment_relationship.py +79 -0
- honeycomb/_generated/models/environment_relationship_data.py +82 -0
- honeycomb/_generated/models/environment_relationship_data_type.py +7 -0
- honeycomb/_generated/models/environment_response.py +78 -0
- honeycomb/_generated/models/environment_type.py +7 -0
- honeycomb/_generated/models/error.py +74 -0
- honeycomb/_generated/models/event.py +71 -0
- honeycomb/_generated/models/exhaustion_time.py +174 -0
- honeycomb/_generated/models/exhaustion_time_alert_type.py +8 -0
- honeycomb/_generated/models/exhaustion_time_burn_alert_list_response.py +198 -0
- honeycomb/_generated/models/exhaustion_time_burn_alert_list_response_slo.py +77 -0
- honeycomb/_generated/models/filter_op.py +22 -0
- honeycomb/_generated/models/get_map_dependencies_response.py +169 -0
- honeycomb/_generated/models/get_map_dependencies_response_status.py +9 -0
- honeycomb/_generated/models/having_calculate_op.py +29 -0
- honeycomb/_generated/models/having_op.py +12 -0
- honeycomb/_generated/models/included_resource.py +106 -0
- honeycomb/_generated/models/included_resource_attributes.py +62 -0
- honeycomb/_generated/models/ingest_key_attributes.py +153 -0
- honeycomb/_generated/models/ingest_key_attributes_key_type.py +7 -0
- honeycomb/_generated/models/ingest_key_attributes_permissions.py +74 -0
- honeycomb/_generated/models/ingest_key_attributes_timestamps.py +107 -0
- honeycomb/_generated/models/ingest_key_type.py +90 -0
- honeycomb/_generated/models/ingest_key_type_key_type.py +7 -0
- honeycomb/_generated/models/jsonapi_error_source.py +92 -0
- honeycomb/_generated/models/kinesis_event.py +111 -0
- honeycomb/_generated/models/kinesis_event_record.py +73 -0
- honeycomb/_generated/models/kinesis_response.py +91 -0
- honeycomb/_generated/models/list_api_keys_filtertype.py +8 -0
- honeycomb/_generated/models/map_dependency.py +118 -0
- honeycomb/_generated/models/map_node.py +97 -0
- honeycomb/_generated/models/map_node_type.py +7 -0
- honeycomb/_generated/models/marker.py +151 -0
- honeycomb/_generated/models/marker_create_request.py +78 -0
- honeycomb/_generated/models/marker_create_request_data.py +104 -0
- honeycomb/_generated/models/marker_create_request_data_attributes.py +110 -0
- honeycomb/_generated/models/marker_create_request_data_relationships.py +92 -0
- honeycomb/_generated/models/marker_create_request_data_type.py +7 -0
- honeycomb/_generated/models/marker_object.py +136 -0
- honeycomb/_generated/models/marker_object_attributes.py +146 -0
- honeycomb/_generated/models/marker_object_attributes_timestamps.py +107 -0
- honeycomb/_generated/models/marker_object_links.py +74 -0
- honeycomb/_generated/models/marker_object_relationships.py +111 -0
- honeycomb/_generated/models/marker_object_relationships_dataset.py +104 -0
- honeycomb/_generated/models/marker_object_relationships_dataset_data_type_0.py +94 -0
- honeycomb/_generated/models/marker_object_relationships_dataset_data_type_0_type.py +7 -0
- honeycomb/_generated/models/marker_object_type.py +7 -0
- honeycomb/_generated/models/marker_response.py +78 -0
- honeycomb/_generated/models/marker_setting.py +125 -0
- honeycomb/_generated/models/marker_update_request.py +78 -0
- honeycomb/_generated/models/marker_update_request_data.py +104 -0
- honeycomb/_generated/models/marker_update_request_data_attributes.py +111 -0
- honeycomb/_generated/models/marker_update_request_data_relationships.py +92 -0
- honeycomb/_generated/models/marker_update_request_data_type.py +7 -0
- honeycomb/_generated/models/ms_teams_recipient.py +161 -0
- honeycomb/_generated/models/ms_teams_recipient_details.py +80 -0
- honeycomb/_generated/models/ms_teams_recipient_type.py +7 -0
- honeycomb/_generated/models/ms_teams_workflow_recipient.py +161 -0
- honeycomb/_generated/models/ms_teams_workflow_recipient_details.py +80 -0
- honeycomb/_generated/models/ms_teams_workflow_recipient_type.py +7 -0
- honeycomb/_generated/models/notification_recipient.py +131 -0
- honeycomb/_generated/models/notification_recipient_details.py +117 -0
- honeycomb/_generated/models/notification_recipient_details_pagerduty_severity.py +10 -0
- honeycomb/_generated/models/notification_recipient_details_variables_item.py +81 -0
- honeycomb/_generated/models/pager_duty_recipient.py +160 -0
- honeycomb/_generated/models/pager_duty_recipient_details.py +79 -0
- honeycomb/_generated/models/pager_duty_recipient_type.py +7 -0
- honeycomb/_generated/models/pagination_links.py +80 -0
- honeycomb/_generated/models/payload_template.py +73 -0
- honeycomb/_generated/models/pipeline_configuration_response.py +112 -0
- honeycomb/_generated/models/pipeline_configuration_response_attributes.py +101 -0
- honeycomb/_generated/models/pipeline_configuration_response_attributes_configs_item.py +85 -0
- honeycomb/_generated/models/pipeline_configuration_response_links.py +73 -0
- honeycomb/_generated/models/pipeline_configuration_response_type.py +7 -0
- honeycomb/_generated/models/pipeline_configuration_rollout.py +112 -0
- honeycomb/_generated/models/pipeline_configuration_rollout_attributes.py +75 -0
- honeycomb/_generated/models/pipeline_configuration_rollout_attributes_status.py +12 -0
- honeycomb/_generated/models/pipeline_configuration_rollout_links.py +73 -0
- honeycomb/_generated/models/pipeline_configuration_rollout_type.py +7 -0
- honeycomb/_generated/models/preset_filter.py +78 -0
- honeycomb/_generated/models/query.py +346 -0
- honeycomb/_generated/models/query_annotation.py +166 -0
- honeycomb/_generated/models/query_annotation_source.py +8 -0
- honeycomb/_generated/models/query_calculated_fields_item.py +80 -0
- honeycomb/_generated/models/query_calculations_item.py +98 -0
- honeycomb/_generated/models/query_compare_time_offset_seconds.py +14 -0
- honeycomb/_generated/models/query_filter_combination.py +8 -0
- honeycomb/_generated/models/query_filters_item.py +126 -0
- honeycomb/_generated/models/query_havings_item.py +128 -0
- honeycomb/_generated/models/query_op.py +30 -0
- honeycomb/_generated/models/query_orders_item.py +115 -0
- honeycomb/_generated/models/query_orders_item_order.py +8 -0
- honeycomb/_generated/models/query_panel.py +114 -0
- honeycomb/_generated/models/query_panel_query_panel.py +143 -0
- honeycomb/_generated/models/query_panel_query_panel_query_style.py +9 -0
- honeycomb/_generated/models/query_result.py +130 -0
- honeycomb/_generated/models/query_result_details.py +156 -0
- honeycomb/_generated/models/query_result_details_data.py +188 -0
- honeycomb/_generated/models/query_result_details_links.py +85 -0
- honeycomb/_generated/models/query_result_links.py +85 -0
- honeycomb/_generated/models/query_results_data.py +89 -0
- honeycomb/_generated/models/query_results_data_data.py +71 -0
- honeycomb/_generated/models/query_results_series.py +97 -0
- honeycomb/_generated/models/recipient_properties.py +137 -0
- honeycomb/_generated/models/recipient_type.py +12 -0
- honeycomb/_generated/models/slack_recipient.py +160 -0
- honeycomb/_generated/models/slack_recipient_details.py +71 -0
- honeycomb/_generated/models/slack_recipient_type.py +7 -0
- honeycomb/_generated/models/slo.py +245 -0
- honeycomb/_generated/models/slo_create.py +245 -0
- honeycomb/_generated/models/slo_create_sli.py +75 -0
- honeycomb/_generated/models/slo_detailed_response.py +312 -0
- honeycomb/_generated/models/slo_detailed_response_status.py +10 -0
- honeycomb/_generated/models/slo_history.py +94 -0
- honeycomb/_generated/models/slo_history_request.py +93 -0
- honeycomb/_generated/models/slo_history_response.py +91 -0
- honeycomb/_generated/models/slo_panel.py +114 -0
- honeycomb/_generated/models/slo_panel_slo_panel.py +75 -0
- honeycomb/_generated/models/slo_sli.py +74 -0
- honeycomb/_generated/models/tag.py +79 -0
- honeycomb/_generated/models/team_relationship.py +78 -0
- honeycomb/_generated/models/team_relationship_team.py +78 -0
- honeycomb/_generated/models/team_relationship_team_data.py +82 -0
- honeycomb/_generated/models/team_relationship_team_data_type.py +7 -0
- honeycomb/_generated/models/template_variable_definition.py +81 -0
- honeycomb/_generated/models/text_panel.py +114 -0
- honeycomb/_generated/models/text_panel_text_panel.py +71 -0
- honeycomb/_generated/models/trigger_response.py +399 -0
- honeycomb/_generated/models/trigger_with_inline_query.py +390 -0
- honeycomb/_generated/models/trigger_with_inline_query_query.py +60 -0
- honeycomb/_generated/models/trigger_with_query_reference.py +376 -0
- honeycomb/_generated/models/update_board_view_request.py +107 -0
- honeycomb/_generated/models/update_environment_request.py +78 -0
- honeycomb/_generated/models/update_environment_request_data.py +98 -0
- honeycomb/_generated/models/update_environment_request_data_attributes.py +118 -0
- honeycomb/_generated/models/update_environment_request_data_attributes_settings.py +73 -0
- honeycomb/_generated/models/update_environment_request_data_type.py +7 -0
- honeycomb/_generated/models/update_exhaustion_time_burn_alert_request.py +202 -0
- honeycomb/_generated/models/update_pipeline_configuration_rollout.py +98 -0
- honeycomb/_generated/models/update_pipeline_configuration_rollout_attributes.py +75 -0
- honeycomb/_generated/models/update_pipeline_configuration_rollout_attributes_status.py +12 -0
- honeycomb/_generated/models/update_pipeline_configuration_rollout_request.py +78 -0
- honeycomb/_generated/models/update_pipeline_configuration_rollout_request_data.py +98 -0
- honeycomb/_generated/models/update_pipeline_configuration_rollout_request_data_attributes.py +75 -0
- honeycomb/_generated/models/update_pipeline_configuration_rollout_request_data_attributes_status.py +12 -0
- honeycomb/_generated/models/update_pipeline_configuration_rollout_request_data_type.py +7 -0
- honeycomb/_generated/models/update_pipeline_configuration_rollout_response.py +78 -0
- honeycomb/_generated/models/update_pipeline_configuration_rollout_type.py +7 -0
- honeycomb/_generated/models/user_relationship.py +78 -0
- honeycomb/_generated/models/user_relationship_data.py +82 -0
- honeycomb/_generated/models/user_relationship_data_type.py +7 -0
- honeycomb/_generated/models/validation_error.py +145 -0
- honeycomb/_generated/models/validation_error_type_detail_item.py +103 -0
- honeycomb/_generated/models/validation_error_type_detail_item_code.py +10 -0
- honeycomb/_generated/models/webhook_header.py +81 -0
- honeycomb/_generated/models/webhook_recipient.py +160 -0
- honeycomb/_generated/models/webhook_recipient_details.py +142 -0
- honeycomb/_generated/models/webhook_recipient_details_webhook_payloads.py +117 -0
- honeycomb/_generated/models/webhook_recipient_details_webhook_payloads_payload_templates.py +126 -0
- honeycomb/_generated/models/webhook_recipient_type.py +7 -0
- honeycomb/_generated/py.typed +1 -0
- honeycomb/_generated/types.py +46 -0
- honeycomb/auth.py +152 -0
- honeycomb/client.py +736 -0
- honeycomb/exceptions.py +236 -0
- honeycomb/models/__init__.py +157 -0
- honeycomb/models/api_keys.py +81 -0
- honeycomb/models/board_builder.py +387 -0
- honeycomb/models/boards.py +86 -0
- honeycomb/models/burn_alerts.py +124 -0
- honeycomb/models/columns.py +59 -0
- honeycomb/models/datasets.py +51 -0
- honeycomb/models/derived_columns.py +107 -0
- honeycomb/models/environments.py +106 -0
- honeycomb/models/events.py +35 -0
- honeycomb/models/marker_builder.py +136 -0
- honeycomb/models/markers.py +73 -0
- honeycomb/models/queries.py +210 -0
- honeycomb/models/query_annotations.py +63 -0
- honeycomb/models/query_builder.py +840 -0
- honeycomb/models/recipient_builder.py +248 -0
- honeycomb/models/recipients.py +43 -0
- honeycomb/models/service_map_dependencies.py +126 -0
- honeycomb/models/slo_builder.py +463 -0
- honeycomb/models/slos.py +66 -0
- honeycomb/models/tags_mixin.py +79 -0
- honeycomb/models/trigger_builder.py +561 -0
- honeycomb/models/triggers.py +208 -0
- honeycomb/resources/__init__.py +35 -0
- honeycomb/resources/_recipient_utils.py +156 -0
- honeycomb/resources/api_keys.py +303 -0
- honeycomb/resources/base.py +142 -0
- honeycomb/resources/boards.py +350 -0
- honeycomb/resources/burn_alerts.py +205 -0
- honeycomb/resources/columns.py +185 -0
- honeycomb/resources/datasets.py +163 -0
- honeycomb/resources/derived_columns.py +233 -0
- honeycomb/resources/environments.py +295 -0
- honeycomb/resources/events.py +156 -0
- honeycomb/resources/markers.py +334 -0
- honeycomb/resources/queries.py +256 -0
- honeycomb/resources/query_annotations.py +207 -0
- honeycomb/resources/query_results.py +886 -0
- honeycomb/resources/recipients.py +202 -0
- honeycomb/resources/service_map_dependencies.py +389 -0
- honeycomb/resources/slos.py +353 -0
- honeycomb/resources/triggers.py +284 -0
- honeycomb/tools/__init__.py +85 -0
- honeycomb/tools/__main__.py +204 -0
- honeycomb/tools/builders.py +512 -0
- honeycomb/tools/descriptions.py +523 -0
- honeycomb/tools/executor.py +860 -0
- honeycomb/tools/generator.py +2386 -0
- honeycomb/tools/schemas.py +184 -0
- honeycomb_api-0.1.0.dist-info/METADATA +451 -0
- honeycomb_api-0.1.0.dist-info/RECORD +453 -0
- honeycomb_api-0.1.0.dist-info/WHEEL +4 -0
- honeycomb_api-0.1.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,2386 @@
|
|
|
1
|
+
"""Core tool definition generator for Claude API.
|
|
2
|
+
|
|
3
|
+
This module generates Claude-compatible tool definitions for Honeycomb API operations.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
import json
|
|
7
|
+
from typing import Any
|
|
8
|
+
|
|
9
|
+
from honeycomb.models import (
|
|
10
|
+
BoardCreate,
|
|
11
|
+
BurnAlertCreate,
|
|
12
|
+
ColumnCreate,
|
|
13
|
+
DatasetCreate,
|
|
14
|
+
DerivedColumnCreate,
|
|
15
|
+
MarkerCreate,
|
|
16
|
+
MarkerSettingCreate,
|
|
17
|
+
QuerySpec,
|
|
18
|
+
RecipientCreate,
|
|
19
|
+
ServiceMapDependencyRequestCreate,
|
|
20
|
+
SLOCreate,
|
|
21
|
+
TriggerCreate,
|
|
22
|
+
)
|
|
23
|
+
from honeycomb.tools.descriptions import get_description, validate_description
|
|
24
|
+
from honeycomb.tools.schemas import (
|
|
25
|
+
add_parameter,
|
|
26
|
+
generate_schema_from_model,
|
|
27
|
+
validate_schema,
|
|
28
|
+
validate_tool_name,
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
# ==============================================================================
|
|
32
|
+
# Tool Definition Structure
|
|
33
|
+
# ==============================================================================
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def create_tool_definition(
|
|
37
|
+
name: str,
|
|
38
|
+
description: str,
|
|
39
|
+
input_schema: dict[str, Any],
|
|
40
|
+
input_examples: list[dict[str, Any]] | None = None,
|
|
41
|
+
) -> dict[str, Any]:
|
|
42
|
+
"""Create a Claude tool definition.
|
|
43
|
+
|
|
44
|
+
Args:
|
|
45
|
+
name: Tool name (must match ^[a-zA-Z0-9_-]{1,64}$)
|
|
46
|
+
description: Tool description (>= 50 chars)
|
|
47
|
+
input_schema: JSON Schema for tool inputs
|
|
48
|
+
input_examples: Optional list of example inputs
|
|
49
|
+
|
|
50
|
+
Returns:
|
|
51
|
+
Complete tool definition dict
|
|
52
|
+
|
|
53
|
+
Raises:
|
|
54
|
+
ValueError: If validation fails
|
|
55
|
+
"""
|
|
56
|
+
# Validate
|
|
57
|
+
validate_tool_name(name)
|
|
58
|
+
validate_description(description)
|
|
59
|
+
validate_schema(input_schema)
|
|
60
|
+
|
|
61
|
+
# Build definition
|
|
62
|
+
definition: dict[str, Any] = {
|
|
63
|
+
"name": name,
|
|
64
|
+
"description": description,
|
|
65
|
+
"input_schema": input_schema,
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if input_examples:
|
|
69
|
+
definition["input_examples"] = input_examples
|
|
70
|
+
|
|
71
|
+
return definition
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
# ==============================================================================
|
|
75
|
+
# Triggers Tool Definitions
|
|
76
|
+
# ==============================================================================
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def generate_list_triggers_tool() -> dict[str, Any]:
|
|
80
|
+
"""Generate honeycomb_list_triggers tool definition."""
|
|
81
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": ["dataset"]}
|
|
82
|
+
|
|
83
|
+
add_parameter(
|
|
84
|
+
schema,
|
|
85
|
+
"dataset",
|
|
86
|
+
"string",
|
|
87
|
+
"The dataset slug to list triggers from",
|
|
88
|
+
required=True,
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
examples = [
|
|
92
|
+
{"dataset": "api-logs"},
|
|
93
|
+
{"dataset": "production"},
|
|
94
|
+
]
|
|
95
|
+
|
|
96
|
+
return create_tool_definition(
|
|
97
|
+
name="honeycomb_list_triggers",
|
|
98
|
+
description=get_description("honeycomb_list_triggers"),
|
|
99
|
+
input_schema=schema,
|
|
100
|
+
input_examples=examples,
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
def generate_get_trigger_tool() -> dict[str, Any]:
|
|
105
|
+
"""Generate honeycomb_get_trigger tool definition."""
|
|
106
|
+
schema: dict[str, Any] = {
|
|
107
|
+
"type": "object",
|
|
108
|
+
"properties": {},
|
|
109
|
+
"required": ["dataset", "trigger_id"],
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
add_parameter(schema, "dataset", "string", "The dataset slug", required=True)
|
|
113
|
+
add_parameter(schema, "trigger_id", "string", "The trigger ID to retrieve", required=True)
|
|
114
|
+
|
|
115
|
+
examples = [
|
|
116
|
+
{"dataset": "api-logs", "trigger_id": "aBcD123"},
|
|
117
|
+
{"dataset": "production", "trigger_id": "xyz789"},
|
|
118
|
+
]
|
|
119
|
+
|
|
120
|
+
return create_tool_definition(
|
|
121
|
+
name="honeycomb_get_trigger",
|
|
122
|
+
description=get_description("honeycomb_get_trigger"),
|
|
123
|
+
input_schema=schema,
|
|
124
|
+
input_examples=examples,
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
def generate_create_trigger_tool() -> dict[str, Any]:
|
|
129
|
+
"""Generate honeycomb_create_trigger tool definition."""
|
|
130
|
+
# Start with TriggerCreate schema
|
|
131
|
+
base_schema = generate_schema_from_model(
|
|
132
|
+
TriggerCreate,
|
|
133
|
+
exclude_fields={"created_at", "updated_at", "id"},
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
# Add dataset parameter
|
|
137
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": ["dataset"]}
|
|
138
|
+
add_parameter(
|
|
139
|
+
schema, "dataset", "string", "The dataset slug to create the trigger in", required=True
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
# Merge with TriggerCreate schema
|
|
143
|
+
schema["properties"].update(base_schema["properties"])
|
|
144
|
+
schema["required"].extend(base_schema.get("required", []))
|
|
145
|
+
|
|
146
|
+
# Add definitions if present
|
|
147
|
+
if "$defs" in base_schema:
|
|
148
|
+
schema["$defs"] = base_schema["$defs"]
|
|
149
|
+
|
|
150
|
+
examples = [
|
|
151
|
+
# Minimal example with COUNT
|
|
152
|
+
{
|
|
153
|
+
"dataset": "api-logs",
|
|
154
|
+
"name": "High Error Rate",
|
|
155
|
+
"query": {
|
|
156
|
+
"time_range": 900,
|
|
157
|
+
"calculations": [{"op": "COUNT"}],
|
|
158
|
+
"filters": [{"column": "status_code", "op": ">=", "value": 500}],
|
|
159
|
+
},
|
|
160
|
+
"threshold": {"op": ">", "value": 100},
|
|
161
|
+
"frequency": 900,
|
|
162
|
+
},
|
|
163
|
+
# P99 latency with recipients
|
|
164
|
+
{
|
|
165
|
+
"dataset": "production",
|
|
166
|
+
"name": "P99 Latency Alert",
|
|
167
|
+
"description": "Alerts when P99 latency exceeds 2 seconds",
|
|
168
|
+
"query": {
|
|
169
|
+
"time_range": 3600,
|
|
170
|
+
"calculations": [{"op": "P99", "column": "duration_ms"}],
|
|
171
|
+
},
|
|
172
|
+
"threshold": {"op": ">=", "value": 2000},
|
|
173
|
+
"frequency": 3600,
|
|
174
|
+
"recipients": [{"type": "email", "target": "oncall@example.com"}],
|
|
175
|
+
"alert_type": "on_change",
|
|
176
|
+
},
|
|
177
|
+
# Advanced: Multiple filters with string operations and tags
|
|
178
|
+
{
|
|
179
|
+
"dataset": "api-logs",
|
|
180
|
+
"name": "API Gateway Errors",
|
|
181
|
+
"description": "Monitors error rates for specific service with path filtering",
|
|
182
|
+
"query": {
|
|
183
|
+
"time_range": 1800,
|
|
184
|
+
"calculations": [{"op": "COUNT"}],
|
|
185
|
+
"filters": [
|
|
186
|
+
{"column": "status_code", "op": ">=", "value": 500},
|
|
187
|
+
{"column": "service_name", "op": "=", "value": "api-gateway"},
|
|
188
|
+
{"column": "path", "op": "starts-with", "value": "/api/v2"},
|
|
189
|
+
],
|
|
190
|
+
"filter_combination": "AND",
|
|
191
|
+
"breakdowns": ["endpoint"],
|
|
192
|
+
},
|
|
193
|
+
"threshold": {"op": ">", "value": 50, "exceeded_limit": 2},
|
|
194
|
+
"frequency": 900,
|
|
195
|
+
"recipients": [
|
|
196
|
+
{"type": "slack", "target": "#alerts"},
|
|
197
|
+
{
|
|
198
|
+
"type": "pagerduty",
|
|
199
|
+
"target": "routing-key-123",
|
|
200
|
+
"details": {"severity": "critical"},
|
|
201
|
+
},
|
|
202
|
+
],
|
|
203
|
+
"tags": [
|
|
204
|
+
{"key": "team", "value": "platform"},
|
|
205
|
+
{"key": "severity", "value": "high"},
|
|
206
|
+
],
|
|
207
|
+
},
|
|
208
|
+
# HEATMAP calculation example
|
|
209
|
+
{
|
|
210
|
+
"dataset": "traces",
|
|
211
|
+
"name": "Request Duration Distribution",
|
|
212
|
+
"query": {
|
|
213
|
+
"time_range": 3600,
|
|
214
|
+
"calculations": [{"op": "HEATMAP", "column": "duration_ms"}],
|
|
215
|
+
},
|
|
216
|
+
"threshold": {"op": ">", "value": 1000},
|
|
217
|
+
"frequency": 3600,
|
|
218
|
+
},
|
|
219
|
+
# COUNT_DISTINCT example
|
|
220
|
+
{
|
|
221
|
+
"dataset": "api-logs",
|
|
222
|
+
"name": "Unique Error Messages",
|
|
223
|
+
"query": {
|
|
224
|
+
"time_range": 3600,
|
|
225
|
+
"calculations": [{"op": "COUNT_DISTINCT", "column": "error_message"}],
|
|
226
|
+
"filters": [{"column": "level", "op": "=", "value": "error"}],
|
|
227
|
+
},
|
|
228
|
+
"threshold": {"op": ">", "value": 10},
|
|
229
|
+
"frequency": 1800,
|
|
230
|
+
},
|
|
231
|
+
]
|
|
232
|
+
|
|
233
|
+
return create_tool_definition(
|
|
234
|
+
name="honeycomb_create_trigger",
|
|
235
|
+
description=get_description("honeycomb_create_trigger"),
|
|
236
|
+
input_schema=schema,
|
|
237
|
+
input_examples=examples,
|
|
238
|
+
)
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
def generate_update_trigger_tool() -> dict[str, Any]:
|
|
242
|
+
"""Generate honeycomb_update_trigger tool definition."""
|
|
243
|
+
base_schema = generate_schema_from_model(
|
|
244
|
+
TriggerCreate,
|
|
245
|
+
exclude_fields={"created_at", "updated_at", "id"},
|
|
246
|
+
)
|
|
247
|
+
|
|
248
|
+
schema: dict[str, Any] = {
|
|
249
|
+
"type": "object",
|
|
250
|
+
"properties": {},
|
|
251
|
+
"required": ["dataset", "trigger_id"],
|
|
252
|
+
}
|
|
253
|
+
add_parameter(schema, "dataset", "string", "The dataset slug", required=True)
|
|
254
|
+
add_parameter(schema, "trigger_id", "string", "The trigger ID to update", required=True)
|
|
255
|
+
|
|
256
|
+
schema["properties"].update(base_schema["properties"])
|
|
257
|
+
schema["required"].extend(base_schema.get("required", []))
|
|
258
|
+
|
|
259
|
+
if "$defs" in base_schema:
|
|
260
|
+
schema["$defs"] = base_schema["$defs"]
|
|
261
|
+
|
|
262
|
+
examples = [
|
|
263
|
+
{
|
|
264
|
+
"dataset": "api-logs",
|
|
265
|
+
"trigger_id": "abc123",
|
|
266
|
+
"name": "Updated High Error Rate",
|
|
267
|
+
"query": {
|
|
268
|
+
"time_range": 900,
|
|
269
|
+
"calculations": [{"op": "COUNT"}],
|
|
270
|
+
"filters": [{"column": "status_code", "op": ">=", "value": 500}],
|
|
271
|
+
},
|
|
272
|
+
"threshold": {"op": ">", "value": 150}, # Updated threshold
|
|
273
|
+
"frequency": 900,
|
|
274
|
+
},
|
|
275
|
+
]
|
|
276
|
+
|
|
277
|
+
return create_tool_definition(
|
|
278
|
+
name="honeycomb_update_trigger",
|
|
279
|
+
description=get_description("honeycomb_update_trigger"),
|
|
280
|
+
input_schema=schema,
|
|
281
|
+
input_examples=examples,
|
|
282
|
+
)
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
def generate_delete_trigger_tool() -> dict[str, Any]:
|
|
286
|
+
"""Generate honeycomb_delete_trigger tool definition."""
|
|
287
|
+
schema: dict[str, Any] = {
|
|
288
|
+
"type": "object",
|
|
289
|
+
"properties": {},
|
|
290
|
+
"required": ["dataset", "trigger_id"],
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
add_parameter(schema, "dataset", "string", "The dataset slug", required=True)
|
|
294
|
+
add_parameter(schema, "trigger_id", "string", "The trigger ID to delete", required=True)
|
|
295
|
+
|
|
296
|
+
examples = [
|
|
297
|
+
{"dataset": "api-logs", "trigger_id": "abc123"},
|
|
298
|
+
{"dataset": "production", "trigger_id": "xyz789"},
|
|
299
|
+
]
|
|
300
|
+
|
|
301
|
+
return create_tool_definition(
|
|
302
|
+
name="honeycomb_delete_trigger",
|
|
303
|
+
description=get_description("honeycomb_delete_trigger"),
|
|
304
|
+
input_schema=schema,
|
|
305
|
+
input_examples=examples,
|
|
306
|
+
)
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
# ==============================================================================
|
|
310
|
+
# SLOs Tool Definitions
|
|
311
|
+
# ==============================================================================
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
def generate_list_slos_tool() -> dict[str, Any]:
|
|
315
|
+
"""Generate honeycomb_list_slos tool definition."""
|
|
316
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": ["dataset"]}
|
|
317
|
+
|
|
318
|
+
add_parameter(schema, "dataset", "string", "The dataset slug to list SLOs from", required=True)
|
|
319
|
+
|
|
320
|
+
examples = [
|
|
321
|
+
{"dataset": "api-logs"},
|
|
322
|
+
{"dataset": "production"},
|
|
323
|
+
]
|
|
324
|
+
|
|
325
|
+
return create_tool_definition(
|
|
326
|
+
name="honeycomb_list_slos",
|
|
327
|
+
description=get_description("honeycomb_list_slos"),
|
|
328
|
+
input_schema=schema,
|
|
329
|
+
input_examples=examples,
|
|
330
|
+
)
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
def generate_get_slo_tool() -> dict[str, Any]:
|
|
334
|
+
"""Generate honeycomb_get_slo tool definition."""
|
|
335
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": ["dataset", "slo_id"]}
|
|
336
|
+
|
|
337
|
+
add_parameter(schema, "dataset", "string", "The dataset slug", required=True)
|
|
338
|
+
add_parameter(schema, "slo_id", "string", "The SLO ID to retrieve", required=True)
|
|
339
|
+
|
|
340
|
+
examples = [
|
|
341
|
+
{"dataset": "api-logs", "slo_id": "slo-123"},
|
|
342
|
+
{"dataset": "production", "slo_id": "slo-456"},
|
|
343
|
+
]
|
|
344
|
+
|
|
345
|
+
return create_tool_definition(
|
|
346
|
+
name="honeycomb_get_slo",
|
|
347
|
+
description=get_description("honeycomb_get_slo"),
|
|
348
|
+
input_schema=schema,
|
|
349
|
+
input_examples=examples,
|
|
350
|
+
)
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
def generate_create_slo_tool() -> dict[str, Any]:
|
|
354
|
+
"""Generate honeycomb_create_slo tool definition."""
|
|
355
|
+
base_schema = generate_schema_from_model(
|
|
356
|
+
SLOCreate,
|
|
357
|
+
exclude_fields={"created_at", "updated_at", "id"},
|
|
358
|
+
)
|
|
359
|
+
|
|
360
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": ["dataset"]}
|
|
361
|
+
add_parameter(
|
|
362
|
+
schema, "dataset", "string", "The dataset slug to create the SLO in", required=True
|
|
363
|
+
)
|
|
364
|
+
|
|
365
|
+
schema["properties"].update(base_schema["properties"])
|
|
366
|
+
schema["required"].extend(base_schema.get("required", []))
|
|
367
|
+
|
|
368
|
+
if "$defs" in base_schema:
|
|
369
|
+
schema["$defs"] = base_schema["$defs"]
|
|
370
|
+
|
|
371
|
+
examples = [
|
|
372
|
+
# Minimal with existing derived column
|
|
373
|
+
{
|
|
374
|
+
"dataset": "api-logs",
|
|
375
|
+
"name": "API Availability",
|
|
376
|
+
"sli": {"alias": "success_rate"},
|
|
377
|
+
"target_per_million": 999000, # 99.9%
|
|
378
|
+
"time_period_days": 30,
|
|
379
|
+
},
|
|
380
|
+
# With NEW derived column created inline
|
|
381
|
+
{
|
|
382
|
+
"dataset": "production",
|
|
383
|
+
"name": "Request Success Rate",
|
|
384
|
+
"description": "Percentage of requests that succeed (status < 500)",
|
|
385
|
+
"sli": {
|
|
386
|
+
"alias": "request_success",
|
|
387
|
+
"expression": "IF(LT($status_code, 500), 1, 0)",
|
|
388
|
+
"description": "1 if status < 500, else 0",
|
|
389
|
+
},
|
|
390
|
+
"target_per_million": 995000, # 99.5%
|
|
391
|
+
"time_period_days": 7,
|
|
392
|
+
},
|
|
393
|
+
# With burn alerts inline (creates SLO + derived column + burn alerts in one call)
|
|
394
|
+
{
|
|
395
|
+
"dataset": "api-logs",
|
|
396
|
+
"name": "Critical API Availability",
|
|
397
|
+
"description": "High-priority SLO with burn rate alerting",
|
|
398
|
+
"sli": {
|
|
399
|
+
"alias": "api_success",
|
|
400
|
+
"expression": "IF(LT($status_code, 500), 1, 0)",
|
|
401
|
+
},
|
|
402
|
+
"target_per_million": 999900, # 99.99%
|
|
403
|
+
"time_period_days": 30,
|
|
404
|
+
"burn_alerts": [
|
|
405
|
+
{
|
|
406
|
+
"alert_type": "exhaustion_time",
|
|
407
|
+
"exhaustion_minutes": 60,
|
|
408
|
+
"description": "Budget exhausting in 1 hour",
|
|
409
|
+
"recipients": [
|
|
410
|
+
{"type": "email", "target": "oncall@example.com"},
|
|
411
|
+
{"type": "slack", "target": "#critical-alerts"},
|
|
412
|
+
],
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
"alert_type": "budget_rate",
|
|
416
|
+
"budget_rate_window_minutes": 60,
|
|
417
|
+
"budget_rate_decrease_threshold_per_million": 10000, # 1% drop in 1 hour
|
|
418
|
+
"description": "Error budget dropping too fast",
|
|
419
|
+
"recipients": [{"type": "pagerduty", "target": "routing-key-123"}],
|
|
420
|
+
},
|
|
421
|
+
],
|
|
422
|
+
},
|
|
423
|
+
]
|
|
424
|
+
|
|
425
|
+
return create_tool_definition(
|
|
426
|
+
name="honeycomb_create_slo",
|
|
427
|
+
description=get_description("honeycomb_create_slo"),
|
|
428
|
+
input_schema=schema,
|
|
429
|
+
input_examples=examples,
|
|
430
|
+
)
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
def generate_update_slo_tool() -> dict[str, Any]:
|
|
434
|
+
"""Generate honeycomb_update_slo tool definition."""
|
|
435
|
+
base_schema = generate_schema_from_model(
|
|
436
|
+
SLOCreate,
|
|
437
|
+
exclude_fields={"created_at", "updated_at", "id"},
|
|
438
|
+
)
|
|
439
|
+
|
|
440
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": ["dataset", "slo_id"]}
|
|
441
|
+
add_parameter(schema, "dataset", "string", "The dataset slug", required=True)
|
|
442
|
+
add_parameter(schema, "slo_id", "string", "The SLO ID to update", required=True)
|
|
443
|
+
|
|
444
|
+
schema["properties"].update(base_schema["properties"])
|
|
445
|
+
schema["required"].extend(base_schema.get("required", []))
|
|
446
|
+
|
|
447
|
+
if "$defs" in base_schema:
|
|
448
|
+
schema["$defs"] = base_schema["$defs"]
|
|
449
|
+
|
|
450
|
+
examples = [
|
|
451
|
+
{
|
|
452
|
+
"dataset": "api-logs",
|
|
453
|
+
"slo_id": "slo-123",
|
|
454
|
+
"name": "API Availability (Updated)",
|
|
455
|
+
"sli": {"alias": "success_rate"},
|
|
456
|
+
"target_per_million": 999500, # Updated from 999000 to 999500 (99.95%)
|
|
457
|
+
"time_period_days": 30,
|
|
458
|
+
},
|
|
459
|
+
]
|
|
460
|
+
|
|
461
|
+
return create_tool_definition(
|
|
462
|
+
name="honeycomb_update_slo",
|
|
463
|
+
description=get_description("honeycomb_update_slo"),
|
|
464
|
+
input_schema=schema,
|
|
465
|
+
input_examples=examples,
|
|
466
|
+
)
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
def generate_delete_slo_tool() -> dict[str, Any]:
|
|
470
|
+
"""Generate honeycomb_delete_slo tool definition."""
|
|
471
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": ["dataset", "slo_id"]}
|
|
472
|
+
|
|
473
|
+
add_parameter(schema, "dataset", "string", "The dataset slug", required=True)
|
|
474
|
+
add_parameter(schema, "slo_id", "string", "The SLO ID to delete", required=True)
|
|
475
|
+
|
|
476
|
+
examples = [
|
|
477
|
+
{"dataset": "api-logs", "slo_id": "slo-123"},
|
|
478
|
+
{"dataset": "production", "slo_id": "slo-456"},
|
|
479
|
+
]
|
|
480
|
+
|
|
481
|
+
return create_tool_definition(
|
|
482
|
+
name="honeycomb_delete_slo",
|
|
483
|
+
description=get_description("honeycomb_delete_slo"),
|
|
484
|
+
input_schema=schema,
|
|
485
|
+
input_examples=examples,
|
|
486
|
+
)
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
# ==============================================================================
|
|
490
|
+
# Burn Alerts Tool Definitions
|
|
491
|
+
# ==============================================================================
|
|
492
|
+
|
|
493
|
+
|
|
494
|
+
def generate_list_burn_alerts_tool() -> dict[str, Any]:
|
|
495
|
+
"""Generate honeycomb_list_burn_alerts tool definition."""
|
|
496
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": ["dataset", "slo_id"]}
|
|
497
|
+
|
|
498
|
+
add_parameter(schema, "dataset", "string", "The dataset slug", required=True)
|
|
499
|
+
add_parameter(schema, "slo_id", "string", "The SLO ID to list burn alerts for", required=True)
|
|
500
|
+
|
|
501
|
+
examples = [
|
|
502
|
+
{"dataset": "api-logs", "slo_id": "slo-123"},
|
|
503
|
+
{"dataset": "production", "slo_id": "slo-456"},
|
|
504
|
+
]
|
|
505
|
+
|
|
506
|
+
return create_tool_definition(
|
|
507
|
+
name="honeycomb_list_burn_alerts",
|
|
508
|
+
description=get_description("honeycomb_list_burn_alerts"),
|
|
509
|
+
input_schema=schema,
|
|
510
|
+
input_examples=examples,
|
|
511
|
+
)
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
def generate_get_burn_alert_tool() -> dict[str, Any]:
|
|
515
|
+
"""Generate honeycomb_get_burn_alert tool definition."""
|
|
516
|
+
schema: dict[str, Any] = {
|
|
517
|
+
"type": "object",
|
|
518
|
+
"properties": {},
|
|
519
|
+
"required": ["dataset", "burn_alert_id"],
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
add_parameter(schema, "dataset", "string", "The dataset slug", required=True)
|
|
523
|
+
add_parameter(schema, "burn_alert_id", "string", "The burn alert ID to retrieve", required=True)
|
|
524
|
+
|
|
525
|
+
examples = [
|
|
526
|
+
{"dataset": "api-logs", "burn_alert_id": "ba-123"},
|
|
527
|
+
{"dataset": "production", "burn_alert_id": "ba-456"},
|
|
528
|
+
]
|
|
529
|
+
|
|
530
|
+
return create_tool_definition(
|
|
531
|
+
name="honeycomb_get_burn_alert",
|
|
532
|
+
description=get_description("honeycomb_get_burn_alert"),
|
|
533
|
+
input_schema=schema,
|
|
534
|
+
input_examples=examples,
|
|
535
|
+
)
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
def generate_create_burn_alert_tool() -> dict[str, Any]:
|
|
539
|
+
"""Generate honeycomb_create_burn_alert tool definition."""
|
|
540
|
+
base_schema = generate_schema_from_model(
|
|
541
|
+
BurnAlertCreate,
|
|
542
|
+
exclude_fields={"created_at", "updated_at", "id"},
|
|
543
|
+
)
|
|
544
|
+
|
|
545
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": ["dataset"]}
|
|
546
|
+
add_parameter(
|
|
547
|
+
schema, "dataset", "string", "The dataset slug to create the burn alert in", required=True
|
|
548
|
+
)
|
|
549
|
+
|
|
550
|
+
schema["properties"].update(base_schema["properties"])
|
|
551
|
+
schema["required"].extend(base_schema.get("required", []))
|
|
552
|
+
|
|
553
|
+
if "$defs" in base_schema:
|
|
554
|
+
schema["$defs"] = base_schema["$defs"]
|
|
555
|
+
|
|
556
|
+
examples = [
|
|
557
|
+
# Exhaustion time alert without recipients (recipients are optional)
|
|
558
|
+
{
|
|
559
|
+
"dataset": "api-logs",
|
|
560
|
+
"alert_type": "exhaustion_time",
|
|
561
|
+
"slo_id": "slo-123",
|
|
562
|
+
"exhaustion_minutes": 60,
|
|
563
|
+
},
|
|
564
|
+
# Exhaustion time alert with ID-based recipient
|
|
565
|
+
{
|
|
566
|
+
"dataset": "api-logs",
|
|
567
|
+
"alert_type": "exhaustion_time",
|
|
568
|
+
"slo_id": "slo-456",
|
|
569
|
+
"exhaustion_minutes": 60,
|
|
570
|
+
"recipients": [{"id": "recip-123"}],
|
|
571
|
+
},
|
|
572
|
+
# Budget rate alert with inline recipients
|
|
573
|
+
{
|
|
574
|
+
"dataset": "production",
|
|
575
|
+
"alert_type": "budget_rate",
|
|
576
|
+
"slo_id": "slo-789",
|
|
577
|
+
"budget_rate_window_minutes": 60,
|
|
578
|
+
"budget_rate_decrease_threshold_per_million": 10000, # 1% drop in 1 hour
|
|
579
|
+
"description": "Alert when error budget drops by 1% in 1 hour",
|
|
580
|
+
"recipients": [
|
|
581
|
+
{"type": "email", "target": "sre@example.com"},
|
|
582
|
+
{"type": "slack", "target": "#slo-alerts"},
|
|
583
|
+
],
|
|
584
|
+
},
|
|
585
|
+
# Critical exhaustion alert with PagerDuty
|
|
586
|
+
{
|
|
587
|
+
"dataset": "critical-services",
|
|
588
|
+
"alert_type": "exhaustion_time",
|
|
589
|
+
"slo_id": "slo-abc",
|
|
590
|
+
"exhaustion_minutes": 30,
|
|
591
|
+
"description": "Critical: Budget exhausting in 30 minutes",
|
|
592
|
+
"recipients": [
|
|
593
|
+
{
|
|
594
|
+
"type": "pagerduty",
|
|
595
|
+
"target": "routing-key-critical",
|
|
596
|
+
"details": {"severity": "critical"},
|
|
597
|
+
},
|
|
598
|
+
],
|
|
599
|
+
},
|
|
600
|
+
]
|
|
601
|
+
|
|
602
|
+
return create_tool_definition(
|
|
603
|
+
name="honeycomb_create_burn_alert",
|
|
604
|
+
description=get_description("honeycomb_create_burn_alert"),
|
|
605
|
+
input_schema=schema,
|
|
606
|
+
input_examples=examples,
|
|
607
|
+
)
|
|
608
|
+
|
|
609
|
+
|
|
610
|
+
def generate_update_burn_alert_tool() -> dict[str, Any]:
|
|
611
|
+
"""Generate honeycomb_update_burn_alert tool definition."""
|
|
612
|
+
base_schema = generate_schema_from_model(
|
|
613
|
+
BurnAlertCreate,
|
|
614
|
+
exclude_fields={"created_at", "updated_at", "id"},
|
|
615
|
+
)
|
|
616
|
+
|
|
617
|
+
schema: dict[str, Any] = {
|
|
618
|
+
"type": "object",
|
|
619
|
+
"properties": {},
|
|
620
|
+
"required": ["dataset", "burn_alert_id"],
|
|
621
|
+
}
|
|
622
|
+
add_parameter(schema, "dataset", "string", "The dataset slug", required=True)
|
|
623
|
+
add_parameter(schema, "burn_alert_id", "string", "The burn alert ID to update", required=True)
|
|
624
|
+
|
|
625
|
+
schema["properties"].update(base_schema["properties"])
|
|
626
|
+
schema["required"].extend(base_schema.get("required", []))
|
|
627
|
+
|
|
628
|
+
if "$defs" in base_schema:
|
|
629
|
+
schema["$defs"] = base_schema["$defs"]
|
|
630
|
+
|
|
631
|
+
examples = [
|
|
632
|
+
{
|
|
633
|
+
"dataset": "api-logs",
|
|
634
|
+
"burn_alert_id": "ba-123",
|
|
635
|
+
"alert_type": "exhaustion_time",
|
|
636
|
+
"slo_id": "slo-123",
|
|
637
|
+
"exhaustion_minutes": 30, # Updated from 60 to 30
|
|
638
|
+
"recipients": [{"id": "recip-123"}],
|
|
639
|
+
},
|
|
640
|
+
]
|
|
641
|
+
|
|
642
|
+
return create_tool_definition(
|
|
643
|
+
name="honeycomb_update_burn_alert",
|
|
644
|
+
description=get_description("honeycomb_update_burn_alert"),
|
|
645
|
+
input_schema=schema,
|
|
646
|
+
input_examples=examples,
|
|
647
|
+
)
|
|
648
|
+
|
|
649
|
+
|
|
650
|
+
def generate_delete_burn_alert_tool() -> dict[str, Any]:
|
|
651
|
+
"""Generate honeycomb_delete_burn_alert tool definition."""
|
|
652
|
+
schema: dict[str, Any] = {
|
|
653
|
+
"type": "object",
|
|
654
|
+
"properties": {},
|
|
655
|
+
"required": ["dataset", "burn_alert_id"],
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
add_parameter(schema, "dataset", "string", "The dataset slug", required=True)
|
|
659
|
+
add_parameter(schema, "burn_alert_id", "string", "The burn alert ID to delete", required=True)
|
|
660
|
+
|
|
661
|
+
examples = [
|
|
662
|
+
{"dataset": "api-logs", "burn_alert_id": "ba-123"},
|
|
663
|
+
{"dataset": "production", "burn_alert_id": "ba-456"},
|
|
664
|
+
]
|
|
665
|
+
|
|
666
|
+
return create_tool_definition(
|
|
667
|
+
name="honeycomb_delete_burn_alert",
|
|
668
|
+
description=get_description("honeycomb_delete_burn_alert"),
|
|
669
|
+
input_schema=schema,
|
|
670
|
+
input_examples=examples,
|
|
671
|
+
)
|
|
672
|
+
|
|
673
|
+
|
|
674
|
+
# ==============================================================================
|
|
675
|
+
# Datasets Tool Definitions
|
|
676
|
+
# ==============================================================================
|
|
677
|
+
|
|
678
|
+
|
|
679
|
+
def generate_list_datasets_tool() -> dict[str, Any]:
|
|
680
|
+
"""Generate honeycomb_list_datasets tool definition."""
|
|
681
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": []}
|
|
682
|
+
|
|
683
|
+
examples: list[dict[str, Any]] = [
|
|
684
|
+
{}, # List all datasets
|
|
685
|
+
]
|
|
686
|
+
|
|
687
|
+
return create_tool_definition(
|
|
688
|
+
name="honeycomb_list_datasets",
|
|
689
|
+
description=get_description("honeycomb_list_datasets"),
|
|
690
|
+
input_schema=schema,
|
|
691
|
+
input_examples=examples,
|
|
692
|
+
)
|
|
693
|
+
|
|
694
|
+
|
|
695
|
+
def generate_get_dataset_tool() -> dict[str, Any]:
|
|
696
|
+
"""Generate honeycomb_get_dataset tool definition."""
|
|
697
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": ["slug"]}
|
|
698
|
+
|
|
699
|
+
add_parameter(schema, "slug", "string", "The dataset slug to retrieve", required=True)
|
|
700
|
+
|
|
701
|
+
examples: list[dict[str, Any]] = [
|
|
702
|
+
{"slug": "api-logs"},
|
|
703
|
+
{"slug": "production"},
|
|
704
|
+
]
|
|
705
|
+
|
|
706
|
+
return create_tool_definition(
|
|
707
|
+
name="honeycomb_get_dataset",
|
|
708
|
+
description=get_description("honeycomb_get_dataset"),
|
|
709
|
+
input_schema=schema,
|
|
710
|
+
input_examples=examples,
|
|
711
|
+
)
|
|
712
|
+
|
|
713
|
+
|
|
714
|
+
def generate_create_dataset_tool() -> dict[str, Any]:
|
|
715
|
+
"""Generate honeycomb_create_dataset tool definition."""
|
|
716
|
+
# Start with DatasetCreate schema
|
|
717
|
+
base_schema = generate_schema_from_model(
|
|
718
|
+
DatasetCreate,
|
|
719
|
+
exclude_fields={"created_at", "last_written_at", "slug", "regular_columns_count"},
|
|
720
|
+
)
|
|
721
|
+
|
|
722
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": []}
|
|
723
|
+
schema["properties"].update(base_schema["properties"])
|
|
724
|
+
schema["required"].extend(base_schema.get("required", []))
|
|
725
|
+
|
|
726
|
+
examples: list[dict[str, Any]] = [
|
|
727
|
+
# Minimal example
|
|
728
|
+
{"name": "api-logs"},
|
|
729
|
+
# With description
|
|
730
|
+
{
|
|
731
|
+
"name": "production-logs",
|
|
732
|
+
"description": "Production API logs from main services",
|
|
733
|
+
},
|
|
734
|
+
# With JSON expansion
|
|
735
|
+
{
|
|
736
|
+
"name": "trace-data",
|
|
737
|
+
"description": "Distributed traces with nested JSON",
|
|
738
|
+
"expand_json_depth": 3,
|
|
739
|
+
},
|
|
740
|
+
]
|
|
741
|
+
|
|
742
|
+
return create_tool_definition(
|
|
743
|
+
name="honeycomb_create_dataset",
|
|
744
|
+
description=get_description("honeycomb_create_dataset"),
|
|
745
|
+
input_schema=schema,
|
|
746
|
+
input_examples=examples,
|
|
747
|
+
)
|
|
748
|
+
|
|
749
|
+
|
|
750
|
+
def generate_update_dataset_tool() -> dict[str, Any]:
|
|
751
|
+
"""Generate honeycomb_update_dataset tool definition."""
|
|
752
|
+
base_schema = generate_schema_from_model(
|
|
753
|
+
DatasetCreate,
|
|
754
|
+
exclude_fields={"created_at", "last_written_at", "slug", "regular_columns_count"},
|
|
755
|
+
)
|
|
756
|
+
|
|
757
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": ["slug"]}
|
|
758
|
+
add_parameter(schema, "slug", "string", "The dataset slug to update", required=True)
|
|
759
|
+
|
|
760
|
+
schema["properties"].update(base_schema["properties"])
|
|
761
|
+
schema["required"].extend(base_schema.get("required", []))
|
|
762
|
+
|
|
763
|
+
examples: list[dict[str, Any]] = [
|
|
764
|
+
{"slug": "api-logs", "name": "API Logs", "description": "Updated description"},
|
|
765
|
+
{"slug": "production", "name": "Production", "expand_json_depth": 5},
|
|
766
|
+
]
|
|
767
|
+
|
|
768
|
+
return create_tool_definition(
|
|
769
|
+
name="honeycomb_update_dataset",
|
|
770
|
+
description=get_description("honeycomb_update_dataset"),
|
|
771
|
+
input_schema=schema,
|
|
772
|
+
input_examples=examples,
|
|
773
|
+
)
|
|
774
|
+
|
|
775
|
+
|
|
776
|
+
def generate_delete_dataset_tool() -> dict[str, Any]:
|
|
777
|
+
"""Generate honeycomb_delete_dataset tool definition."""
|
|
778
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": ["slug"]}
|
|
779
|
+
|
|
780
|
+
add_parameter(schema, "slug", "string", "The dataset slug to delete", required=True)
|
|
781
|
+
|
|
782
|
+
examples: list[dict[str, Any]] = [
|
|
783
|
+
{"slug": "test-dataset"},
|
|
784
|
+
{"slug": "old-logs"},
|
|
785
|
+
]
|
|
786
|
+
|
|
787
|
+
return create_tool_definition(
|
|
788
|
+
name="honeycomb_delete_dataset",
|
|
789
|
+
description=get_description("honeycomb_delete_dataset"),
|
|
790
|
+
input_schema=schema,
|
|
791
|
+
input_examples=examples,
|
|
792
|
+
)
|
|
793
|
+
|
|
794
|
+
|
|
795
|
+
# ==============================================================================
|
|
796
|
+
# Columns Tool Definitions
|
|
797
|
+
# ==============================================================================
|
|
798
|
+
|
|
799
|
+
|
|
800
|
+
def generate_list_columns_tool() -> dict[str, Any]:
|
|
801
|
+
"""Generate honeycomb_list_columns tool definition."""
|
|
802
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": ["dataset"]}
|
|
803
|
+
|
|
804
|
+
add_parameter(
|
|
805
|
+
schema, "dataset", "string", "The dataset slug to list columns from", required=True
|
|
806
|
+
)
|
|
807
|
+
|
|
808
|
+
examples: list[dict[str, Any]] = [
|
|
809
|
+
{"dataset": "api-logs"},
|
|
810
|
+
{"dataset": "production"},
|
|
811
|
+
]
|
|
812
|
+
|
|
813
|
+
return create_tool_definition(
|
|
814
|
+
name="honeycomb_list_columns",
|
|
815
|
+
description=get_description("honeycomb_list_columns"),
|
|
816
|
+
input_schema=schema,
|
|
817
|
+
input_examples=examples,
|
|
818
|
+
)
|
|
819
|
+
|
|
820
|
+
|
|
821
|
+
def generate_get_column_tool() -> dict[str, Any]:
|
|
822
|
+
"""Generate honeycomb_get_column tool definition."""
|
|
823
|
+
schema: dict[str, Any] = {
|
|
824
|
+
"type": "object",
|
|
825
|
+
"properties": {},
|
|
826
|
+
"required": ["dataset", "column_id"],
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
add_parameter(schema, "dataset", "string", "The dataset slug", required=True)
|
|
830
|
+
add_parameter(schema, "column_id", "string", "The column ID to retrieve", required=True)
|
|
831
|
+
|
|
832
|
+
examples: list[dict[str, Any]] = [
|
|
833
|
+
{"dataset": "api-logs", "column_id": "col-123"},
|
|
834
|
+
{"dataset": "production", "column_id": "col-456"},
|
|
835
|
+
]
|
|
836
|
+
|
|
837
|
+
return create_tool_definition(
|
|
838
|
+
name="honeycomb_get_column",
|
|
839
|
+
description=get_description("honeycomb_get_column"),
|
|
840
|
+
input_schema=schema,
|
|
841
|
+
input_examples=examples,
|
|
842
|
+
)
|
|
843
|
+
|
|
844
|
+
|
|
845
|
+
def generate_create_column_tool() -> dict[str, Any]:
|
|
846
|
+
"""Generate honeycomb_create_column tool definition."""
|
|
847
|
+
base_schema = generate_schema_from_model(
|
|
848
|
+
ColumnCreate,
|
|
849
|
+
exclude_fields={"id", "created_at", "updated_at", "last_written"},
|
|
850
|
+
)
|
|
851
|
+
|
|
852
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": ["dataset"]}
|
|
853
|
+
add_parameter(schema, "dataset", "string", "The dataset slug", required=True)
|
|
854
|
+
|
|
855
|
+
schema["properties"].update(base_schema["properties"])
|
|
856
|
+
schema["required"].extend(base_schema.get("required", []))
|
|
857
|
+
|
|
858
|
+
# Add definitions if present
|
|
859
|
+
if "$defs" in base_schema:
|
|
860
|
+
schema["$defs"] = base_schema["$defs"]
|
|
861
|
+
|
|
862
|
+
examples: list[dict[str, Any]] = [
|
|
863
|
+
# Minimal example (string column)
|
|
864
|
+
{"dataset": "api-logs", "key_name": "endpoint", "type": "string"},
|
|
865
|
+
# With description and type
|
|
866
|
+
{
|
|
867
|
+
"dataset": "api-logs",
|
|
868
|
+
"key_name": "duration_ms",
|
|
869
|
+
"type": "float",
|
|
870
|
+
"description": "Request duration in milliseconds",
|
|
871
|
+
},
|
|
872
|
+
# Hidden column
|
|
873
|
+
{
|
|
874
|
+
"dataset": "production",
|
|
875
|
+
"key_name": "internal_id",
|
|
876
|
+
"type": "integer",
|
|
877
|
+
"hidden": True,
|
|
878
|
+
"description": "Internal debugging ID",
|
|
879
|
+
},
|
|
880
|
+
]
|
|
881
|
+
|
|
882
|
+
return create_tool_definition(
|
|
883
|
+
name="honeycomb_create_column",
|
|
884
|
+
description=get_description("honeycomb_create_column"),
|
|
885
|
+
input_schema=schema,
|
|
886
|
+
input_examples=examples,
|
|
887
|
+
)
|
|
888
|
+
|
|
889
|
+
|
|
890
|
+
def generate_update_column_tool() -> dict[str, Any]:
|
|
891
|
+
"""Generate honeycomb_update_column tool definition."""
|
|
892
|
+
base_schema = generate_schema_from_model(
|
|
893
|
+
ColumnCreate,
|
|
894
|
+
exclude_fields={"id", "created_at", "updated_at", "last_written"},
|
|
895
|
+
)
|
|
896
|
+
|
|
897
|
+
schema: dict[str, Any] = {
|
|
898
|
+
"type": "object",
|
|
899
|
+
"properties": {},
|
|
900
|
+
"required": ["dataset", "column_id"],
|
|
901
|
+
}
|
|
902
|
+
add_parameter(schema, "dataset", "string", "The dataset slug", required=True)
|
|
903
|
+
add_parameter(schema, "column_id", "string", "The column ID to update", required=True)
|
|
904
|
+
|
|
905
|
+
schema["properties"].update(base_schema["properties"])
|
|
906
|
+
schema["required"].extend(base_schema.get("required", []))
|
|
907
|
+
|
|
908
|
+
# Add definitions if present
|
|
909
|
+
if "$defs" in base_schema:
|
|
910
|
+
schema["$defs"] = base_schema["$defs"]
|
|
911
|
+
|
|
912
|
+
examples: list[dict[str, Any]] = [
|
|
913
|
+
{
|
|
914
|
+
"dataset": "api-logs",
|
|
915
|
+
"column_id": "col-123",
|
|
916
|
+
"key_name": "endpoint",
|
|
917
|
+
"type": "string",
|
|
918
|
+
"description": "API endpoint path",
|
|
919
|
+
},
|
|
920
|
+
{
|
|
921
|
+
"dataset": "production",
|
|
922
|
+
"column_id": "col-456",
|
|
923
|
+
"key_name": "status_code",
|
|
924
|
+
"type": "integer",
|
|
925
|
+
"hidden": False,
|
|
926
|
+
},
|
|
927
|
+
]
|
|
928
|
+
|
|
929
|
+
return create_tool_definition(
|
|
930
|
+
name="honeycomb_update_column",
|
|
931
|
+
description=get_description("honeycomb_update_column"),
|
|
932
|
+
input_schema=schema,
|
|
933
|
+
input_examples=examples,
|
|
934
|
+
)
|
|
935
|
+
|
|
936
|
+
|
|
937
|
+
def generate_delete_column_tool() -> dict[str, Any]:
|
|
938
|
+
"""Generate honeycomb_delete_column tool definition."""
|
|
939
|
+
schema: dict[str, Any] = {
|
|
940
|
+
"type": "object",
|
|
941
|
+
"properties": {},
|
|
942
|
+
"required": ["dataset", "column_id"],
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
add_parameter(schema, "dataset", "string", "The dataset slug", required=True)
|
|
946
|
+
add_parameter(schema, "column_id", "string", "The column ID to delete", required=True)
|
|
947
|
+
|
|
948
|
+
examples: list[dict[str, Any]] = [
|
|
949
|
+
{"dataset": "api-logs", "column_id": "col-123"},
|
|
950
|
+
{"dataset": "production", "column_id": "col-456"},
|
|
951
|
+
]
|
|
952
|
+
|
|
953
|
+
return create_tool_definition(
|
|
954
|
+
name="honeycomb_delete_column",
|
|
955
|
+
description=get_description("honeycomb_delete_column"),
|
|
956
|
+
input_schema=schema,
|
|
957
|
+
input_examples=examples,
|
|
958
|
+
)
|
|
959
|
+
|
|
960
|
+
|
|
961
|
+
# ==============================================================================
|
|
962
|
+
# Recipients Tool Definitions
|
|
963
|
+
# ==============================================================================
|
|
964
|
+
|
|
965
|
+
|
|
966
|
+
def generate_list_recipients_tool() -> dict[str, Any]:
|
|
967
|
+
"""Generate honeycomb_list_recipients tool definition."""
|
|
968
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": []}
|
|
969
|
+
|
|
970
|
+
examples: list[dict[str, Any]] = [
|
|
971
|
+
{}, # List all recipients
|
|
972
|
+
]
|
|
973
|
+
|
|
974
|
+
return create_tool_definition(
|
|
975
|
+
name="honeycomb_list_recipients",
|
|
976
|
+
description=get_description("honeycomb_list_recipients"),
|
|
977
|
+
input_schema=schema,
|
|
978
|
+
input_examples=examples,
|
|
979
|
+
)
|
|
980
|
+
|
|
981
|
+
|
|
982
|
+
def generate_get_recipient_tool() -> dict[str, Any]:
|
|
983
|
+
"""Generate honeycomb_get_recipient tool definition."""
|
|
984
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": ["recipient_id"]}
|
|
985
|
+
|
|
986
|
+
add_parameter(schema, "recipient_id", "string", "The recipient ID to retrieve", required=True)
|
|
987
|
+
|
|
988
|
+
examples: list[dict[str, Any]] = [
|
|
989
|
+
{"recipient_id": "rec-123"},
|
|
990
|
+
{"recipient_id": "rec-456"},
|
|
991
|
+
]
|
|
992
|
+
|
|
993
|
+
return create_tool_definition(
|
|
994
|
+
name="honeycomb_get_recipient",
|
|
995
|
+
description=get_description("honeycomb_get_recipient"),
|
|
996
|
+
input_schema=schema,
|
|
997
|
+
input_examples=examples,
|
|
998
|
+
)
|
|
999
|
+
|
|
1000
|
+
|
|
1001
|
+
def generate_create_recipient_tool() -> dict[str, Any]:
|
|
1002
|
+
"""Generate honeycomb_create_recipient tool definition."""
|
|
1003
|
+
base_schema = generate_schema_from_model(
|
|
1004
|
+
RecipientCreate,
|
|
1005
|
+
exclude_fields={"id", "created_at", "updated_at"},
|
|
1006
|
+
)
|
|
1007
|
+
|
|
1008
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": []}
|
|
1009
|
+
schema["properties"].update(base_schema["properties"])
|
|
1010
|
+
schema["required"].extend(base_schema.get("required", []))
|
|
1011
|
+
|
|
1012
|
+
# Add definitions if present
|
|
1013
|
+
if "$defs" in base_schema:
|
|
1014
|
+
schema["$defs"] = base_schema["$defs"]
|
|
1015
|
+
|
|
1016
|
+
examples: list[dict[str, Any]] = [
|
|
1017
|
+
# Email recipient
|
|
1018
|
+
{
|
|
1019
|
+
"type": "email",
|
|
1020
|
+
"details": {"email_address": "alerts@example.com"},
|
|
1021
|
+
},
|
|
1022
|
+
# Slack channel
|
|
1023
|
+
{
|
|
1024
|
+
"type": "slack",
|
|
1025
|
+
"details": {"channel": "#alerts"},
|
|
1026
|
+
},
|
|
1027
|
+
# PagerDuty
|
|
1028
|
+
{
|
|
1029
|
+
"type": "pagerduty",
|
|
1030
|
+
"details": {"routing_key": "abc123def456"},
|
|
1031
|
+
},
|
|
1032
|
+
# Webhook
|
|
1033
|
+
{
|
|
1034
|
+
"type": "webhook",
|
|
1035
|
+
"details": {
|
|
1036
|
+
"url": "https://hooks.example.com/alerts",
|
|
1037
|
+
"secret": "webhook-secret-key",
|
|
1038
|
+
},
|
|
1039
|
+
},
|
|
1040
|
+
]
|
|
1041
|
+
|
|
1042
|
+
return create_tool_definition(
|
|
1043
|
+
name="honeycomb_create_recipient",
|
|
1044
|
+
description=get_description("honeycomb_create_recipient"),
|
|
1045
|
+
input_schema=schema,
|
|
1046
|
+
input_examples=examples,
|
|
1047
|
+
)
|
|
1048
|
+
|
|
1049
|
+
|
|
1050
|
+
def generate_update_recipient_tool() -> dict[str, Any]:
|
|
1051
|
+
"""Generate honeycomb_update_recipient tool definition."""
|
|
1052
|
+
base_schema = generate_schema_from_model(
|
|
1053
|
+
RecipientCreate,
|
|
1054
|
+
exclude_fields={"id", "created_at", "updated_at"},
|
|
1055
|
+
)
|
|
1056
|
+
|
|
1057
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": ["recipient_id"]}
|
|
1058
|
+
add_parameter(schema, "recipient_id", "string", "The recipient ID to update", required=True)
|
|
1059
|
+
|
|
1060
|
+
schema["properties"].update(base_schema["properties"])
|
|
1061
|
+
schema["required"].extend(base_schema.get("required", []))
|
|
1062
|
+
|
|
1063
|
+
# Add definitions if present
|
|
1064
|
+
if "$defs" in base_schema:
|
|
1065
|
+
schema["$defs"] = base_schema["$defs"]
|
|
1066
|
+
|
|
1067
|
+
examples: list[dict[str, Any]] = [
|
|
1068
|
+
{
|
|
1069
|
+
"recipient_id": "rec-123",
|
|
1070
|
+
"type": "email",
|
|
1071
|
+
"details": {"email_address": "new-alerts@example.com"},
|
|
1072
|
+
},
|
|
1073
|
+
{
|
|
1074
|
+
"recipient_id": "rec-456",
|
|
1075
|
+
"type": "slack",
|
|
1076
|
+
"details": {"channel": "#new-alerts"},
|
|
1077
|
+
},
|
|
1078
|
+
]
|
|
1079
|
+
|
|
1080
|
+
return create_tool_definition(
|
|
1081
|
+
name="honeycomb_update_recipient",
|
|
1082
|
+
description=get_description("honeycomb_update_recipient"),
|
|
1083
|
+
input_schema=schema,
|
|
1084
|
+
input_examples=examples,
|
|
1085
|
+
)
|
|
1086
|
+
|
|
1087
|
+
|
|
1088
|
+
def generate_delete_recipient_tool() -> dict[str, Any]:
|
|
1089
|
+
"""Generate honeycomb_delete_recipient tool definition."""
|
|
1090
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": ["recipient_id"]}
|
|
1091
|
+
|
|
1092
|
+
add_parameter(schema, "recipient_id", "string", "The recipient ID to delete", required=True)
|
|
1093
|
+
|
|
1094
|
+
examples: list[dict[str, Any]] = [
|
|
1095
|
+
{"recipient_id": "rec-123"},
|
|
1096
|
+
{"recipient_id": "rec-456"},
|
|
1097
|
+
]
|
|
1098
|
+
|
|
1099
|
+
return create_tool_definition(
|
|
1100
|
+
name="honeycomb_delete_recipient",
|
|
1101
|
+
description=get_description("honeycomb_delete_recipient"),
|
|
1102
|
+
input_schema=schema,
|
|
1103
|
+
input_examples=examples,
|
|
1104
|
+
)
|
|
1105
|
+
|
|
1106
|
+
|
|
1107
|
+
def generate_get_recipient_triggers_tool() -> dict[str, Any]:
|
|
1108
|
+
"""Generate honeycomb_get_recipient_triggers tool definition."""
|
|
1109
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": ["recipient_id"]}
|
|
1110
|
+
|
|
1111
|
+
add_parameter(
|
|
1112
|
+
schema,
|
|
1113
|
+
"recipient_id",
|
|
1114
|
+
"string",
|
|
1115
|
+
"The recipient ID to get associated triggers for",
|
|
1116
|
+
required=True,
|
|
1117
|
+
)
|
|
1118
|
+
|
|
1119
|
+
examples: list[dict[str, Any]] = [
|
|
1120
|
+
{"recipient_id": "rec-123"},
|
|
1121
|
+
{"recipient_id": "rec-456"},
|
|
1122
|
+
]
|
|
1123
|
+
|
|
1124
|
+
return create_tool_definition(
|
|
1125
|
+
name="honeycomb_get_recipient_triggers",
|
|
1126
|
+
description=get_description("honeycomb_get_recipient_triggers"),
|
|
1127
|
+
input_schema=schema,
|
|
1128
|
+
input_examples=examples,
|
|
1129
|
+
)
|
|
1130
|
+
|
|
1131
|
+
|
|
1132
|
+
# ==============================================================================
|
|
1133
|
+
# Derived Columns Tool Definitions
|
|
1134
|
+
# ==============================================================================
|
|
1135
|
+
|
|
1136
|
+
|
|
1137
|
+
def generate_list_derived_columns_tool() -> dict[str, Any]:
|
|
1138
|
+
"""Generate honeycomb_list_derived_columns tool definition."""
|
|
1139
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": ["dataset"]}
|
|
1140
|
+
|
|
1141
|
+
add_parameter(
|
|
1142
|
+
schema,
|
|
1143
|
+
"dataset",
|
|
1144
|
+
"string",
|
|
1145
|
+
"The dataset slug to list derived columns from (use '__all__' for environment-wide)",
|
|
1146
|
+
required=True,
|
|
1147
|
+
)
|
|
1148
|
+
|
|
1149
|
+
examples: list[dict[str, Any]] = [
|
|
1150
|
+
{"dataset": "api-logs"},
|
|
1151
|
+
{"dataset": "__all__"},
|
|
1152
|
+
]
|
|
1153
|
+
|
|
1154
|
+
return create_tool_definition(
|
|
1155
|
+
name="honeycomb_list_derived_columns",
|
|
1156
|
+
description=get_description("honeycomb_list_derived_columns"),
|
|
1157
|
+
input_schema=schema,
|
|
1158
|
+
input_examples=examples,
|
|
1159
|
+
)
|
|
1160
|
+
|
|
1161
|
+
|
|
1162
|
+
def generate_get_derived_column_tool() -> dict[str, Any]:
|
|
1163
|
+
"""Generate honeycomb_get_derived_column tool definition."""
|
|
1164
|
+
schema: dict[str, Any] = {
|
|
1165
|
+
"type": "object",
|
|
1166
|
+
"properties": {},
|
|
1167
|
+
"required": ["dataset", "derived_column_id"],
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
add_parameter(schema, "dataset", "string", "The dataset slug", required=True)
|
|
1171
|
+
add_parameter(
|
|
1172
|
+
schema, "derived_column_id", "string", "The derived column ID to retrieve", required=True
|
|
1173
|
+
)
|
|
1174
|
+
|
|
1175
|
+
examples: list[dict[str, Any]] = [
|
|
1176
|
+
{"dataset": "api-logs", "derived_column_id": "dc-123"},
|
|
1177
|
+
{"dataset": "__all__", "derived_column_id": "dc-456"},
|
|
1178
|
+
]
|
|
1179
|
+
|
|
1180
|
+
return create_tool_definition(
|
|
1181
|
+
name="honeycomb_get_derived_column",
|
|
1182
|
+
description=get_description("honeycomb_get_derived_column"),
|
|
1183
|
+
input_schema=schema,
|
|
1184
|
+
input_examples=examples,
|
|
1185
|
+
)
|
|
1186
|
+
|
|
1187
|
+
|
|
1188
|
+
def generate_create_derived_column_tool() -> dict[str, Any]:
|
|
1189
|
+
"""Generate honeycomb_create_derived_column tool definition."""
|
|
1190
|
+
base_schema = generate_schema_from_model(
|
|
1191
|
+
DerivedColumnCreate,
|
|
1192
|
+
exclude_fields={"id", "created_at", "updated_at"},
|
|
1193
|
+
)
|
|
1194
|
+
|
|
1195
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": ["dataset"]}
|
|
1196
|
+
add_parameter(
|
|
1197
|
+
schema,
|
|
1198
|
+
"dataset",
|
|
1199
|
+
"string",
|
|
1200
|
+
"The dataset slug (use '__all__' for environment-wide)",
|
|
1201
|
+
required=True,
|
|
1202
|
+
)
|
|
1203
|
+
|
|
1204
|
+
schema["properties"].update(base_schema["properties"])
|
|
1205
|
+
schema["required"].extend(base_schema.get("required", []))
|
|
1206
|
+
|
|
1207
|
+
examples: list[dict[str, Any]] = [
|
|
1208
|
+
# Boolean flag
|
|
1209
|
+
{
|
|
1210
|
+
"dataset": "api-logs",
|
|
1211
|
+
"alias": "is_error",
|
|
1212
|
+
"expression": "IF(GTE($status_code, 500), 1, 0)",
|
|
1213
|
+
"description": "1 if error, 0 otherwise",
|
|
1214
|
+
},
|
|
1215
|
+
# Categorization
|
|
1216
|
+
{
|
|
1217
|
+
"dataset": "api-logs",
|
|
1218
|
+
"alias": "status_category",
|
|
1219
|
+
"expression": "IF(LT($status_code, 400), 'success', IF(LT($status_code, 500), 'client_error', 'server_error'))",
|
|
1220
|
+
},
|
|
1221
|
+
# Environment-wide
|
|
1222
|
+
{
|
|
1223
|
+
"dataset": "__all__",
|
|
1224
|
+
"alias": "request_success",
|
|
1225
|
+
"expression": "IF(LT($status_code, 400), 1, 0)",
|
|
1226
|
+
"description": "Success indicator for all datasets",
|
|
1227
|
+
},
|
|
1228
|
+
]
|
|
1229
|
+
|
|
1230
|
+
return create_tool_definition(
|
|
1231
|
+
name="honeycomb_create_derived_column",
|
|
1232
|
+
description=get_description("honeycomb_create_derived_column"),
|
|
1233
|
+
input_schema=schema,
|
|
1234
|
+
input_examples=examples,
|
|
1235
|
+
)
|
|
1236
|
+
|
|
1237
|
+
|
|
1238
|
+
def generate_update_derived_column_tool() -> dict[str, Any]:
|
|
1239
|
+
"""Generate honeycomb_update_derived_column tool definition."""
|
|
1240
|
+
base_schema = generate_schema_from_model(
|
|
1241
|
+
DerivedColumnCreate,
|
|
1242
|
+
exclude_fields={"id", "created_at", "updated_at"},
|
|
1243
|
+
)
|
|
1244
|
+
|
|
1245
|
+
schema: dict[str, Any] = {
|
|
1246
|
+
"type": "object",
|
|
1247
|
+
"properties": {},
|
|
1248
|
+
"required": ["dataset", "derived_column_id"],
|
|
1249
|
+
}
|
|
1250
|
+
add_parameter(schema, "dataset", "string", "The dataset slug", required=True)
|
|
1251
|
+
add_parameter(
|
|
1252
|
+
schema, "derived_column_id", "string", "The derived column ID to update", required=True
|
|
1253
|
+
)
|
|
1254
|
+
|
|
1255
|
+
schema["properties"].update(base_schema["properties"])
|
|
1256
|
+
schema["required"].extend(base_schema.get("required", []))
|
|
1257
|
+
|
|
1258
|
+
examples: list[dict[str, Any]] = [
|
|
1259
|
+
{
|
|
1260
|
+
"dataset": "api-logs",
|
|
1261
|
+
"derived_column_id": "dc-123",
|
|
1262
|
+
"alias": "is_error",
|
|
1263
|
+
"expression": "IF(GTE($status_code, 500), 1, 0)",
|
|
1264
|
+
"description": "Updated error flag",
|
|
1265
|
+
},
|
|
1266
|
+
]
|
|
1267
|
+
|
|
1268
|
+
return create_tool_definition(
|
|
1269
|
+
name="honeycomb_update_derived_column",
|
|
1270
|
+
description=get_description("honeycomb_update_derived_column"),
|
|
1271
|
+
input_schema=schema,
|
|
1272
|
+
input_examples=examples,
|
|
1273
|
+
)
|
|
1274
|
+
|
|
1275
|
+
|
|
1276
|
+
def generate_delete_derived_column_tool() -> dict[str, Any]:
|
|
1277
|
+
"""Generate honeycomb_delete_derived_column tool definition."""
|
|
1278
|
+
schema: dict[str, Any] = {
|
|
1279
|
+
"type": "object",
|
|
1280
|
+
"properties": {},
|
|
1281
|
+
"required": ["dataset", "derived_column_id"],
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
add_parameter(schema, "dataset", "string", "The dataset slug", required=True)
|
|
1285
|
+
add_parameter(
|
|
1286
|
+
schema, "derived_column_id", "string", "The derived column ID to delete", required=True
|
|
1287
|
+
)
|
|
1288
|
+
|
|
1289
|
+
examples: list[dict[str, Any]] = [
|
|
1290
|
+
{"dataset": "api-logs", "derived_column_id": "dc-123"},
|
|
1291
|
+
{"dataset": "__all__", "derived_column_id": "dc-456"},
|
|
1292
|
+
]
|
|
1293
|
+
|
|
1294
|
+
return create_tool_definition(
|
|
1295
|
+
name="honeycomb_delete_derived_column",
|
|
1296
|
+
description=get_description("honeycomb_delete_derived_column"),
|
|
1297
|
+
input_schema=schema,
|
|
1298
|
+
input_examples=examples,
|
|
1299
|
+
)
|
|
1300
|
+
|
|
1301
|
+
|
|
1302
|
+
# ==============================================================================
|
|
1303
|
+
# Boards Tool Definitions
|
|
1304
|
+
# ==============================================================================
|
|
1305
|
+
|
|
1306
|
+
|
|
1307
|
+
def generate_list_boards_tool() -> dict[str, Any]:
|
|
1308
|
+
"""Generate honeycomb_list_boards tool definition."""
|
|
1309
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": []}
|
|
1310
|
+
|
|
1311
|
+
examples: list[dict[str, Any]] = [
|
|
1312
|
+
{}, # List all boards
|
|
1313
|
+
]
|
|
1314
|
+
|
|
1315
|
+
return create_tool_definition(
|
|
1316
|
+
name="honeycomb_list_boards",
|
|
1317
|
+
description=get_description("honeycomb_list_boards"),
|
|
1318
|
+
input_schema=schema,
|
|
1319
|
+
input_examples=examples,
|
|
1320
|
+
)
|
|
1321
|
+
|
|
1322
|
+
|
|
1323
|
+
def generate_get_board_tool() -> dict[str, Any]:
|
|
1324
|
+
"""Generate honeycomb_get_board tool definition."""
|
|
1325
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": ["board_id"]}
|
|
1326
|
+
|
|
1327
|
+
add_parameter(schema, "board_id", "string", "The board ID to retrieve", required=True)
|
|
1328
|
+
|
|
1329
|
+
examples: list[dict[str, Any]] = [
|
|
1330
|
+
{"board_id": "board-123"},
|
|
1331
|
+
{"board_id": "board-456"},
|
|
1332
|
+
]
|
|
1333
|
+
|
|
1334
|
+
return create_tool_definition(
|
|
1335
|
+
name="honeycomb_get_board",
|
|
1336
|
+
description=get_description("honeycomb_get_board"),
|
|
1337
|
+
input_schema=schema,
|
|
1338
|
+
input_examples=examples,
|
|
1339
|
+
)
|
|
1340
|
+
|
|
1341
|
+
|
|
1342
|
+
def generate_create_board_tool() -> dict[str, Any]:
|
|
1343
|
+
"""Generate honeycomb_create_board tool definition."""
|
|
1344
|
+
# Build schema manually for complex nested structure
|
|
1345
|
+
schema: dict[str, Any] = {
|
|
1346
|
+
"type": "object",
|
|
1347
|
+
"properties": {},
|
|
1348
|
+
"required": ["name"],
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
add_parameter(schema, "name", "string", "Board name", required=True)
|
|
1352
|
+
add_parameter(schema, "description", "string", "Board description", required=False)
|
|
1353
|
+
add_parameter(
|
|
1354
|
+
schema,
|
|
1355
|
+
"layout_generation",
|
|
1356
|
+
"string",
|
|
1357
|
+
"Layout mode: 'auto' or 'manual' (default: auto)",
|
|
1358
|
+
required=False,
|
|
1359
|
+
)
|
|
1360
|
+
|
|
1361
|
+
# Inline query panels array
|
|
1362
|
+
schema["properties"]["inline_query_panels"] = {
|
|
1363
|
+
"type": "array",
|
|
1364
|
+
"description": "Array of query panels to create inline (each creates a new query)",
|
|
1365
|
+
"items": {
|
|
1366
|
+
"type": "object",
|
|
1367
|
+
"properties": {
|
|
1368
|
+
"name": {"type": "string", "description": "Panel/query name"},
|
|
1369
|
+
"dataset": {"type": "string", "description": "Dataset slug"},
|
|
1370
|
+
"time_range": {"type": "integer", "description": "Time range in seconds"},
|
|
1371
|
+
"calculations": {
|
|
1372
|
+
"type": "array",
|
|
1373
|
+
"description": "Array of calculation objects",
|
|
1374
|
+
"items": {"type": "object"},
|
|
1375
|
+
},
|
|
1376
|
+
"filters": {
|
|
1377
|
+
"type": "array",
|
|
1378
|
+
"description": "Array of filter objects",
|
|
1379
|
+
"items": {"type": "object"},
|
|
1380
|
+
},
|
|
1381
|
+
"breakdowns": {
|
|
1382
|
+
"type": "array",
|
|
1383
|
+
"description": "Fields to group by",
|
|
1384
|
+
"items": {"type": "string"},
|
|
1385
|
+
},
|
|
1386
|
+
"orders": {
|
|
1387
|
+
"type": "array",
|
|
1388
|
+
"description": "Ordering specifications",
|
|
1389
|
+
"items": {"type": "object"},
|
|
1390
|
+
},
|
|
1391
|
+
"limit": {"type": "integer", "description": "Result limit"},
|
|
1392
|
+
"style": {
|
|
1393
|
+
"type": "string",
|
|
1394
|
+
"description": "Panel style: graph, table, or combo",
|
|
1395
|
+
},
|
|
1396
|
+
},
|
|
1397
|
+
"required": ["name"], # dataset is optional (defaults to environment-wide)
|
|
1398
|
+
},
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
# Inline SLO panels array
|
|
1402
|
+
schema["properties"]["inline_slo_panels"] = {
|
|
1403
|
+
"type": "array",
|
|
1404
|
+
"description": "Array of SLO definitions to create inline",
|
|
1405
|
+
"items": {
|
|
1406
|
+
"type": "object",
|
|
1407
|
+
"properties": {
|
|
1408
|
+
"name": {"type": "string", "description": "SLO name"},
|
|
1409
|
+
"dataset": {"type": "string", "description": "Dataset slug"},
|
|
1410
|
+
"sli": {
|
|
1411
|
+
"type": "object",
|
|
1412
|
+
"description": "SLI definition (alias + optional expression for inline creation)",
|
|
1413
|
+
"properties": {
|
|
1414
|
+
"alias": {"type": "string", "description": "Derived column alias"},
|
|
1415
|
+
"expression": {
|
|
1416
|
+
"type": "string",
|
|
1417
|
+
"description": "Optional expression (creates derived column inline)",
|
|
1418
|
+
},
|
|
1419
|
+
"description": {"type": "string"},
|
|
1420
|
+
},
|
|
1421
|
+
"required": ["alias"],
|
|
1422
|
+
},
|
|
1423
|
+
"target_per_million": {"type": "integer"},
|
|
1424
|
+
"target_percentage": {"type": "number"},
|
|
1425
|
+
"target_nines": {"type": "integer"},
|
|
1426
|
+
"time_period_days": {"type": "integer"},
|
|
1427
|
+
"time_period_weeks": {"type": "integer"},
|
|
1428
|
+
"description": {"type": "string"},
|
|
1429
|
+
},
|
|
1430
|
+
"required": ["name", "dataset", "sli"],
|
|
1431
|
+
},
|
|
1432
|
+
}
|
|
1433
|
+
|
|
1434
|
+
# Text panels array
|
|
1435
|
+
schema["properties"]["text_panels"] = {
|
|
1436
|
+
"type": "array",
|
|
1437
|
+
"description": "Array of markdown text panels",
|
|
1438
|
+
"items": {
|
|
1439
|
+
"type": "object",
|
|
1440
|
+
"properties": {
|
|
1441
|
+
"content": {"type": "string", "description": "Markdown text content"},
|
|
1442
|
+
},
|
|
1443
|
+
"required": ["content"],
|
|
1444
|
+
},
|
|
1445
|
+
}
|
|
1446
|
+
|
|
1447
|
+
# SLO panels array (IDs)
|
|
1448
|
+
schema["properties"]["slo_panels"] = {
|
|
1449
|
+
"type": "array",
|
|
1450
|
+
"description": "Array of existing SLO IDs to display as panels",
|
|
1451
|
+
"items": {"type": "string"},
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
# Tags
|
|
1455
|
+
schema["properties"]["tags"] = {
|
|
1456
|
+
"type": "array",
|
|
1457
|
+
"description": "Array of tag objects",
|
|
1458
|
+
"items": {
|
|
1459
|
+
"type": "object",
|
|
1460
|
+
"properties": {
|
|
1461
|
+
"key": {"type": "string"},
|
|
1462
|
+
"value": {"type": "string"},
|
|
1463
|
+
},
|
|
1464
|
+
},
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
examples: list[dict[str, Any]] = [
|
|
1468
|
+
# Simple: inline query panels with auto-layout
|
|
1469
|
+
{
|
|
1470
|
+
"name": "API Dashboard",
|
|
1471
|
+
"layout_generation": "auto",
|
|
1472
|
+
"inline_query_panels": [
|
|
1473
|
+
{
|
|
1474
|
+
"name": "Error Count",
|
|
1475
|
+
"dataset": "api-logs",
|
|
1476
|
+
"time_range": 3600,
|
|
1477
|
+
"calculations": [{"op": "COUNT"}],
|
|
1478
|
+
"filters": [{"column": "status_code", "op": ">=", "value": 500}],
|
|
1479
|
+
},
|
|
1480
|
+
{
|
|
1481
|
+
"name": "P99 Latency",
|
|
1482
|
+
"dataset": "api-logs",
|
|
1483
|
+
"time_range": 3600,
|
|
1484
|
+
"calculations": [{"op": "P99", "column": "duration_ms"}],
|
|
1485
|
+
},
|
|
1486
|
+
],
|
|
1487
|
+
},
|
|
1488
|
+
# With text panel
|
|
1489
|
+
{
|
|
1490
|
+
"name": "Service Overview",
|
|
1491
|
+
"description": "Main service health dashboard",
|
|
1492
|
+
"layout_generation": "auto",
|
|
1493
|
+
"inline_query_panels": [
|
|
1494
|
+
{
|
|
1495
|
+
"name": "Request Rate",
|
|
1496
|
+
"dataset": "production",
|
|
1497
|
+
"time_range": 7200,
|
|
1498
|
+
"calculations": [{"op": "COUNT"}],
|
|
1499
|
+
"breakdowns": ["endpoint"],
|
|
1500
|
+
}
|
|
1501
|
+
],
|
|
1502
|
+
"text_panels": [{"content": "## Service Status\nMonitor during peak hours"}],
|
|
1503
|
+
},
|
|
1504
|
+
# Complex: with existing SLO ID
|
|
1505
|
+
{
|
|
1506
|
+
"name": "SRE Dashboard",
|
|
1507
|
+
"layout_generation": "auto",
|
|
1508
|
+
"inline_query_panels": [
|
|
1509
|
+
{
|
|
1510
|
+
"name": "Error Rate",
|
|
1511
|
+
"dataset": "api-logs",
|
|
1512
|
+
"time_range": 3600,
|
|
1513
|
+
"calculations": [{"op": "COUNT"}],
|
|
1514
|
+
"filters": [{"column": "status_code", "op": ">=", "value": 500}],
|
|
1515
|
+
"breakdowns": ["service"],
|
|
1516
|
+
"orders": [{"op": "COUNT", "order": "descending"}],
|
|
1517
|
+
"limit": 20,
|
|
1518
|
+
}
|
|
1519
|
+
],
|
|
1520
|
+
"slo_panels": ["slo-123"],
|
|
1521
|
+
"text_panels": [{"content": "## Alerts\nCheck PagerDuty for incidents"}],
|
|
1522
|
+
"tags": [{"key": "team", "value": "platform"}],
|
|
1523
|
+
},
|
|
1524
|
+
# Advanced: inline SLO creation with derived column
|
|
1525
|
+
{
|
|
1526
|
+
"name": "Production Monitoring",
|
|
1527
|
+
"layout_generation": "auto",
|
|
1528
|
+
"inline_query_panels": [
|
|
1529
|
+
{
|
|
1530
|
+
"name": "Request Count",
|
|
1531
|
+
"dataset": "production",
|
|
1532
|
+
"time_range": 86400,
|
|
1533
|
+
"calculations": [{"op": "COUNT"}],
|
|
1534
|
+
"breakdowns": ["service"],
|
|
1535
|
+
}
|
|
1536
|
+
],
|
|
1537
|
+
"inline_slo_panels": [
|
|
1538
|
+
{
|
|
1539
|
+
"name": "API Availability",
|
|
1540
|
+
"dataset": "api-logs",
|
|
1541
|
+
"sli": {
|
|
1542
|
+
"alias": "success_rate",
|
|
1543
|
+
"expression": "IF(LT($status_code, 400), 1, 0)",
|
|
1544
|
+
"description": "1 if successful, 0 if error",
|
|
1545
|
+
},
|
|
1546
|
+
"target_nines": 3,
|
|
1547
|
+
"time_period_days": 30,
|
|
1548
|
+
"description": "99.9% availability target",
|
|
1549
|
+
}
|
|
1550
|
+
],
|
|
1551
|
+
"text_panels": [{"content": "## SLO Policy\nReview weekly"}],
|
|
1552
|
+
},
|
|
1553
|
+
]
|
|
1554
|
+
|
|
1555
|
+
return create_tool_definition(
|
|
1556
|
+
name="honeycomb_create_board",
|
|
1557
|
+
description=get_description("honeycomb_create_board"),
|
|
1558
|
+
input_schema=schema,
|
|
1559
|
+
input_examples=examples,
|
|
1560
|
+
)
|
|
1561
|
+
|
|
1562
|
+
|
|
1563
|
+
def generate_update_board_tool() -> dict[str, Any]:
|
|
1564
|
+
"""Generate honeycomb_update_board tool definition."""
|
|
1565
|
+
base_schema = generate_schema_from_model(
|
|
1566
|
+
BoardCreate,
|
|
1567
|
+
exclude_fields={"id", "links"},
|
|
1568
|
+
)
|
|
1569
|
+
|
|
1570
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": ["board_id"]}
|
|
1571
|
+
add_parameter(schema, "board_id", "string", "The board ID to update", required=True)
|
|
1572
|
+
|
|
1573
|
+
schema["properties"].update(base_schema["properties"])
|
|
1574
|
+
schema["required"].extend(base_schema.get("required", []))
|
|
1575
|
+
|
|
1576
|
+
examples: list[dict[str, Any]] = [
|
|
1577
|
+
{
|
|
1578
|
+
"board_id": "board-123",
|
|
1579
|
+
"name": "Updated Dashboard",
|
|
1580
|
+
"description": "New description",
|
|
1581
|
+
},
|
|
1582
|
+
]
|
|
1583
|
+
|
|
1584
|
+
return create_tool_definition(
|
|
1585
|
+
name="honeycomb_update_board",
|
|
1586
|
+
description=get_description("honeycomb_update_board"),
|
|
1587
|
+
input_schema=schema,
|
|
1588
|
+
input_examples=examples,
|
|
1589
|
+
)
|
|
1590
|
+
|
|
1591
|
+
|
|
1592
|
+
def generate_delete_board_tool() -> dict[str, Any]:
|
|
1593
|
+
"""Generate honeycomb_delete_board tool definition."""
|
|
1594
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": ["board_id"]}
|
|
1595
|
+
|
|
1596
|
+
add_parameter(schema, "board_id", "string", "The board ID to delete", required=True)
|
|
1597
|
+
|
|
1598
|
+
examples: list[dict[str, Any]] = [
|
|
1599
|
+
{"board_id": "board-123"},
|
|
1600
|
+
{"board_id": "board-456"},
|
|
1601
|
+
]
|
|
1602
|
+
|
|
1603
|
+
return create_tool_definition(
|
|
1604
|
+
name="honeycomb_delete_board",
|
|
1605
|
+
description=get_description("honeycomb_delete_board"),
|
|
1606
|
+
input_schema=schema,
|
|
1607
|
+
input_examples=examples,
|
|
1608
|
+
)
|
|
1609
|
+
|
|
1610
|
+
|
|
1611
|
+
# ==============================================================================
|
|
1612
|
+
# Queries Tool Definitions
|
|
1613
|
+
# ==============================================================================
|
|
1614
|
+
|
|
1615
|
+
|
|
1616
|
+
def generate_create_query_tool() -> dict[str, Any]:
|
|
1617
|
+
"""Generate honeycomb_create_query tool definition."""
|
|
1618
|
+
base_schema = generate_schema_from_model(
|
|
1619
|
+
QuerySpec,
|
|
1620
|
+
exclude_fields={"id", "created_at", "updated_at"},
|
|
1621
|
+
)
|
|
1622
|
+
|
|
1623
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": ["dataset"]}
|
|
1624
|
+
add_parameter(schema, "dataset", "string", "The dataset slug", required=True)
|
|
1625
|
+
|
|
1626
|
+
# Add optional annotation_name parameter
|
|
1627
|
+
add_parameter(
|
|
1628
|
+
schema,
|
|
1629
|
+
"annotation_name",
|
|
1630
|
+
"string",
|
|
1631
|
+
"Optional name for the query annotation (saves query with a display name)",
|
|
1632
|
+
required=False,
|
|
1633
|
+
)
|
|
1634
|
+
|
|
1635
|
+
schema["properties"].update(base_schema["properties"])
|
|
1636
|
+
schema["required"].extend(base_schema.get("required", []))
|
|
1637
|
+
|
|
1638
|
+
# Add definitions if present
|
|
1639
|
+
if "$defs" in base_schema:
|
|
1640
|
+
schema["$defs"] = base_schema["$defs"]
|
|
1641
|
+
|
|
1642
|
+
examples: list[dict[str, Any]] = [
|
|
1643
|
+
# Simple COUNT query
|
|
1644
|
+
{
|
|
1645
|
+
"dataset": "api-logs",
|
|
1646
|
+
"time_range": 3600,
|
|
1647
|
+
"calculations": [{"op": "COUNT"}],
|
|
1648
|
+
},
|
|
1649
|
+
# P99 with filters
|
|
1650
|
+
{
|
|
1651
|
+
"dataset": "api-logs",
|
|
1652
|
+
"time_range": 3600,
|
|
1653
|
+
"calculations": [{"op": "P99", "column": "duration_ms"}],
|
|
1654
|
+
"filters": [{"column": "status_code", "op": ">=", "value": 200}],
|
|
1655
|
+
},
|
|
1656
|
+
# With annotation name
|
|
1657
|
+
{
|
|
1658
|
+
"dataset": "api-logs",
|
|
1659
|
+
"annotation_name": "Error Rate Dashboard",
|
|
1660
|
+
"time_range": 7200,
|
|
1661
|
+
"calculations": [{"op": "COUNT"}],
|
|
1662
|
+
"filters": [{"column": "status_code", "op": ">=", "value": 500}],
|
|
1663
|
+
},
|
|
1664
|
+
]
|
|
1665
|
+
|
|
1666
|
+
return create_tool_definition(
|
|
1667
|
+
name="honeycomb_create_query",
|
|
1668
|
+
description=get_description("honeycomb_create_query"),
|
|
1669
|
+
input_schema=schema,
|
|
1670
|
+
input_examples=examples,
|
|
1671
|
+
)
|
|
1672
|
+
|
|
1673
|
+
|
|
1674
|
+
def generate_get_query_tool() -> dict[str, Any]:
|
|
1675
|
+
"""Generate honeycomb_get_query tool definition."""
|
|
1676
|
+
schema: dict[str, Any] = {
|
|
1677
|
+
"type": "object",
|
|
1678
|
+
"properties": {},
|
|
1679
|
+
"required": ["dataset", "query_id"],
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1682
|
+
add_parameter(schema, "dataset", "string", "The dataset slug", required=True)
|
|
1683
|
+
add_parameter(schema, "query_id", "string", "The query ID to retrieve", required=True)
|
|
1684
|
+
|
|
1685
|
+
examples: list[dict[str, Any]] = [
|
|
1686
|
+
{"dataset": "api-logs", "query_id": "q-123"},
|
|
1687
|
+
{"dataset": "production", "query_id": "q-456"},
|
|
1688
|
+
]
|
|
1689
|
+
|
|
1690
|
+
return create_tool_definition(
|
|
1691
|
+
name="honeycomb_get_query",
|
|
1692
|
+
description=get_description("honeycomb_get_query"),
|
|
1693
|
+
input_schema=schema,
|
|
1694
|
+
input_examples=examples,
|
|
1695
|
+
)
|
|
1696
|
+
|
|
1697
|
+
|
|
1698
|
+
def generate_run_query_tool() -> dict[str, Any]:
|
|
1699
|
+
"""Generate honeycomb_run_query tool definition."""
|
|
1700
|
+
base_schema = generate_schema_from_model(
|
|
1701
|
+
QuerySpec,
|
|
1702
|
+
exclude_fields={"id", "created_at", "updated_at"},
|
|
1703
|
+
)
|
|
1704
|
+
|
|
1705
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": ["dataset"]}
|
|
1706
|
+
add_parameter(schema, "dataset", "string", "The dataset slug", required=True)
|
|
1707
|
+
|
|
1708
|
+
schema["properties"].update(base_schema["properties"])
|
|
1709
|
+
schema["required"].extend(base_schema.get("required", []))
|
|
1710
|
+
|
|
1711
|
+
# Add definitions if present
|
|
1712
|
+
if "$defs" in base_schema:
|
|
1713
|
+
schema["$defs"] = base_schema["$defs"]
|
|
1714
|
+
|
|
1715
|
+
examples: list[dict[str, Any]] = [
|
|
1716
|
+
# Count in last hour
|
|
1717
|
+
{
|
|
1718
|
+
"dataset": "api-logs",
|
|
1719
|
+
"time_range": 3600,
|
|
1720
|
+
"calculations": [{"op": "COUNT"}],
|
|
1721
|
+
},
|
|
1722
|
+
# P99 with breakdowns
|
|
1723
|
+
{
|
|
1724
|
+
"dataset": "api-logs",
|
|
1725
|
+
"time_range": 7200,
|
|
1726
|
+
"calculations": [{"op": "P99", "column": "duration_ms"}],
|
|
1727
|
+
"breakdowns": ["endpoint"],
|
|
1728
|
+
},
|
|
1729
|
+
# Multiple calculations with filters and ordering
|
|
1730
|
+
{
|
|
1731
|
+
"dataset": "api-logs",
|
|
1732
|
+
"time_range": 3600,
|
|
1733
|
+
"calculations": [
|
|
1734
|
+
{"op": "COUNT"},
|
|
1735
|
+
{"op": "AVG", "column": "duration_ms"},
|
|
1736
|
+
{"op": "P99", "column": "duration_ms"},
|
|
1737
|
+
],
|
|
1738
|
+
"filters": [{"column": "status_code", "op": ">=", "value": 500}],
|
|
1739
|
+
"orders": [{"column": "COUNT", "order": "descending"}],
|
|
1740
|
+
"limit": 100,
|
|
1741
|
+
},
|
|
1742
|
+
]
|
|
1743
|
+
|
|
1744
|
+
return create_tool_definition(
|
|
1745
|
+
name="honeycomb_run_query",
|
|
1746
|
+
description=get_description("honeycomb_run_query"),
|
|
1747
|
+
input_schema=schema,
|
|
1748
|
+
input_examples=examples,
|
|
1749
|
+
)
|
|
1750
|
+
|
|
1751
|
+
|
|
1752
|
+
# ==============================================================================
|
|
1753
|
+
# Markers Tool Definitions
|
|
1754
|
+
# ==============================================================================
|
|
1755
|
+
|
|
1756
|
+
|
|
1757
|
+
def generate_list_markers_tool() -> dict[str, Any]:
|
|
1758
|
+
"""Generate honeycomb_list_markers tool definition."""
|
|
1759
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": ["dataset"]}
|
|
1760
|
+
add_parameter(schema, "dataset", "string", "The dataset slug", required=True)
|
|
1761
|
+
|
|
1762
|
+
examples: list[dict[str, Any]] = [{"dataset": "api-logs"}, {"dataset": "production"}]
|
|
1763
|
+
|
|
1764
|
+
return create_tool_definition(
|
|
1765
|
+
name="honeycomb_list_markers",
|
|
1766
|
+
description=get_description("honeycomb_list_markers"),
|
|
1767
|
+
input_schema=schema,
|
|
1768
|
+
input_examples=examples,
|
|
1769
|
+
)
|
|
1770
|
+
|
|
1771
|
+
|
|
1772
|
+
def generate_create_marker_tool() -> dict[str, Any]:
|
|
1773
|
+
"""Generate honeycomb_create_marker tool definition."""
|
|
1774
|
+
base_schema = generate_schema_from_model(
|
|
1775
|
+
MarkerCreate, exclude_fields={"id", "created_at", "updated_at", "color"}
|
|
1776
|
+
)
|
|
1777
|
+
|
|
1778
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": ["dataset"]}
|
|
1779
|
+
add_parameter(
|
|
1780
|
+
schema,
|
|
1781
|
+
"dataset",
|
|
1782
|
+
"string",
|
|
1783
|
+
"The dataset slug (or '__all__' for environment-wide)",
|
|
1784
|
+
required=True,
|
|
1785
|
+
)
|
|
1786
|
+
add_parameter(schema, "color", "string", "Optional hex color (e.g., '#FF5733')", required=False)
|
|
1787
|
+
|
|
1788
|
+
schema["properties"].update(base_schema["properties"])
|
|
1789
|
+
schema["required"].extend(base_schema.get("required", []))
|
|
1790
|
+
|
|
1791
|
+
examples: list[dict[str, Any]] = [
|
|
1792
|
+
{"dataset": "api-logs", "message": "deploy v1.2.3", "type": "deploy"},
|
|
1793
|
+
{
|
|
1794
|
+
"dataset": "__all__",
|
|
1795
|
+
"message": "maintenance window",
|
|
1796
|
+
"type": "maintenance",
|
|
1797
|
+
"start_time": 1640000000,
|
|
1798
|
+
"end_time": 1640003600,
|
|
1799
|
+
},
|
|
1800
|
+
{"dataset": "production", "message": "config change", "type": "config", "color": "#FF5733"},
|
|
1801
|
+
]
|
|
1802
|
+
|
|
1803
|
+
return create_tool_definition(
|
|
1804
|
+
name="honeycomb_create_marker",
|
|
1805
|
+
description=get_description("honeycomb_create_marker"),
|
|
1806
|
+
input_schema=schema,
|
|
1807
|
+
input_examples=examples,
|
|
1808
|
+
)
|
|
1809
|
+
|
|
1810
|
+
|
|
1811
|
+
def generate_update_marker_tool() -> dict[str, Any]:
|
|
1812
|
+
"""Generate honeycomb_update_marker tool definition."""
|
|
1813
|
+
base_schema = generate_schema_from_model(
|
|
1814
|
+
MarkerCreate, exclude_fields={"id", "created_at", "updated_at", "color"}
|
|
1815
|
+
)
|
|
1816
|
+
|
|
1817
|
+
schema: dict[str, Any] = {
|
|
1818
|
+
"type": "object",
|
|
1819
|
+
"properties": {},
|
|
1820
|
+
"required": ["dataset", "marker_id"],
|
|
1821
|
+
}
|
|
1822
|
+
add_parameter(schema, "dataset", "string", "The dataset slug", required=True)
|
|
1823
|
+
add_parameter(schema, "marker_id", "string", "The marker ID to update", required=True)
|
|
1824
|
+
|
|
1825
|
+
schema["properties"].update(base_schema["properties"])
|
|
1826
|
+
schema["required"].extend(base_schema.get("required", []))
|
|
1827
|
+
|
|
1828
|
+
examples: list[dict[str, Any]] = [
|
|
1829
|
+
{
|
|
1830
|
+
"dataset": "api-logs",
|
|
1831
|
+
"marker_id": "abc123",
|
|
1832
|
+
"message": "updated deploy v1.2.4",
|
|
1833
|
+
"type": "deploy",
|
|
1834
|
+
},
|
|
1835
|
+
]
|
|
1836
|
+
|
|
1837
|
+
return create_tool_definition(
|
|
1838
|
+
name="honeycomb_update_marker",
|
|
1839
|
+
description=get_description("honeycomb_update_marker"),
|
|
1840
|
+
input_schema=schema,
|
|
1841
|
+
input_examples=examples,
|
|
1842
|
+
)
|
|
1843
|
+
|
|
1844
|
+
|
|
1845
|
+
def generate_delete_marker_tool() -> dict[str, Any]:
|
|
1846
|
+
"""Generate honeycomb_delete_marker tool definition."""
|
|
1847
|
+
schema: dict[str, Any] = {
|
|
1848
|
+
"type": "object",
|
|
1849
|
+
"properties": {},
|
|
1850
|
+
"required": ["dataset", "marker_id"],
|
|
1851
|
+
}
|
|
1852
|
+
add_parameter(schema, "dataset", "string", "The dataset slug", required=True)
|
|
1853
|
+
add_parameter(schema, "marker_id", "string", "The marker ID to delete", required=True)
|
|
1854
|
+
|
|
1855
|
+
examples: list[dict[str, Any]] = [{"dataset": "api-logs", "marker_id": "abc123"}]
|
|
1856
|
+
|
|
1857
|
+
return create_tool_definition(
|
|
1858
|
+
name="honeycomb_delete_marker",
|
|
1859
|
+
description=get_description("honeycomb_delete_marker"),
|
|
1860
|
+
input_schema=schema,
|
|
1861
|
+
input_examples=examples,
|
|
1862
|
+
)
|
|
1863
|
+
|
|
1864
|
+
|
|
1865
|
+
def generate_list_marker_settings_tool() -> dict[str, Any]:
|
|
1866
|
+
"""Generate honeycomb_list_marker_settings tool definition."""
|
|
1867
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": ["dataset"]}
|
|
1868
|
+
add_parameter(
|
|
1869
|
+
schema,
|
|
1870
|
+
"dataset",
|
|
1871
|
+
"string",
|
|
1872
|
+
"The dataset slug (or '__all__' for environment-wide)",
|
|
1873
|
+
required=True,
|
|
1874
|
+
)
|
|
1875
|
+
|
|
1876
|
+
examples: list[dict[str, Any]] = [{"dataset": "api-logs"}, {"dataset": "__all__"}]
|
|
1877
|
+
|
|
1878
|
+
return create_tool_definition(
|
|
1879
|
+
name="honeycomb_list_marker_settings",
|
|
1880
|
+
description=get_description("honeycomb_list_marker_settings"),
|
|
1881
|
+
input_schema=schema,
|
|
1882
|
+
input_examples=examples,
|
|
1883
|
+
)
|
|
1884
|
+
|
|
1885
|
+
|
|
1886
|
+
def generate_get_marker_setting_tool() -> dict[str, Any]:
|
|
1887
|
+
"""Generate honeycomb_get_marker_setting tool definition."""
|
|
1888
|
+
schema: dict[str, Any] = {
|
|
1889
|
+
"type": "object",
|
|
1890
|
+
"properties": {},
|
|
1891
|
+
"required": ["dataset", "setting_id"],
|
|
1892
|
+
}
|
|
1893
|
+
add_parameter(schema, "dataset", "string", "The dataset slug", required=True)
|
|
1894
|
+
add_parameter(schema, "setting_id", "string", "The marker setting ID", required=True)
|
|
1895
|
+
|
|
1896
|
+
examples: list[dict[str, Any]] = [{"dataset": "api-logs", "setting_id": "set-123"}]
|
|
1897
|
+
|
|
1898
|
+
return create_tool_definition(
|
|
1899
|
+
name="honeycomb_get_marker_setting",
|
|
1900
|
+
description=get_description("honeycomb_get_marker_setting"),
|
|
1901
|
+
input_schema=schema,
|
|
1902
|
+
input_examples=examples,
|
|
1903
|
+
)
|
|
1904
|
+
|
|
1905
|
+
|
|
1906
|
+
def generate_create_marker_setting_tool() -> dict[str, Any]:
|
|
1907
|
+
"""Generate honeycomb_create_marker_setting tool definition."""
|
|
1908
|
+
base_schema = generate_schema_from_model(
|
|
1909
|
+
MarkerSettingCreate, exclude_fields={"id", "created_at", "updated_at"}
|
|
1910
|
+
)
|
|
1911
|
+
|
|
1912
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": ["dataset"]}
|
|
1913
|
+
add_parameter(
|
|
1914
|
+
schema,
|
|
1915
|
+
"dataset",
|
|
1916
|
+
"string",
|
|
1917
|
+
"The dataset slug (or '__all__' for environment-wide)",
|
|
1918
|
+
required=True,
|
|
1919
|
+
)
|
|
1920
|
+
|
|
1921
|
+
schema["properties"].update(base_schema["properties"])
|
|
1922
|
+
schema["required"].extend(base_schema.get("required", []))
|
|
1923
|
+
|
|
1924
|
+
examples: list[dict[str, Any]] = [
|
|
1925
|
+
{"dataset": "api-logs", "type": "deploy", "color": "#00FF00"},
|
|
1926
|
+
{"dataset": "__all__", "type": "incident", "color": "#FF0000"},
|
|
1927
|
+
]
|
|
1928
|
+
|
|
1929
|
+
return create_tool_definition(
|
|
1930
|
+
name="honeycomb_create_marker_setting",
|
|
1931
|
+
description=get_description("honeycomb_create_marker_setting"),
|
|
1932
|
+
input_schema=schema,
|
|
1933
|
+
input_examples=examples,
|
|
1934
|
+
)
|
|
1935
|
+
|
|
1936
|
+
|
|
1937
|
+
def generate_update_marker_setting_tool() -> dict[str, Any]:
|
|
1938
|
+
"""Generate honeycomb_update_marker_setting tool definition."""
|
|
1939
|
+
base_schema = generate_schema_from_model(
|
|
1940
|
+
MarkerSettingCreate, exclude_fields={"id", "created_at", "updated_at"}
|
|
1941
|
+
)
|
|
1942
|
+
|
|
1943
|
+
schema: dict[str, Any] = {
|
|
1944
|
+
"type": "object",
|
|
1945
|
+
"properties": {},
|
|
1946
|
+
"required": ["dataset", "setting_id"],
|
|
1947
|
+
}
|
|
1948
|
+
add_parameter(schema, "dataset", "string", "The dataset slug", required=True)
|
|
1949
|
+
add_parameter(schema, "setting_id", "string", "The marker setting ID to update", required=True)
|
|
1950
|
+
|
|
1951
|
+
schema["properties"].update(base_schema["properties"])
|
|
1952
|
+
schema["required"].extend(base_schema.get("required", []))
|
|
1953
|
+
|
|
1954
|
+
examples: list[dict[str, Any]] = [
|
|
1955
|
+
{"dataset": "api-logs", "setting_id": "set-123", "type": "deploy", "color": "#0000FF"},
|
|
1956
|
+
]
|
|
1957
|
+
|
|
1958
|
+
return create_tool_definition(
|
|
1959
|
+
name="honeycomb_update_marker_setting",
|
|
1960
|
+
description=get_description("honeycomb_update_marker_setting"),
|
|
1961
|
+
input_schema=schema,
|
|
1962
|
+
input_examples=examples,
|
|
1963
|
+
)
|
|
1964
|
+
|
|
1965
|
+
|
|
1966
|
+
def generate_delete_marker_setting_tool() -> dict[str, Any]:
|
|
1967
|
+
"""Generate honeycomb_delete_marker_setting tool definition."""
|
|
1968
|
+
schema: dict[str, Any] = {
|
|
1969
|
+
"type": "object",
|
|
1970
|
+
"properties": {},
|
|
1971
|
+
"required": ["dataset", "setting_id"],
|
|
1972
|
+
}
|
|
1973
|
+
add_parameter(schema, "dataset", "string", "The dataset slug", required=True)
|
|
1974
|
+
add_parameter(schema, "setting_id", "string", "The marker setting ID to delete", required=True)
|
|
1975
|
+
|
|
1976
|
+
examples: list[dict[str, Any]] = [{"dataset": "api-logs", "setting_id": "set-123"}]
|
|
1977
|
+
|
|
1978
|
+
return create_tool_definition(
|
|
1979
|
+
name="honeycomb_delete_marker_setting",
|
|
1980
|
+
description=get_description("honeycomb_delete_marker_setting"),
|
|
1981
|
+
input_schema=schema,
|
|
1982
|
+
input_examples=examples,
|
|
1983
|
+
)
|
|
1984
|
+
|
|
1985
|
+
|
|
1986
|
+
# ==============================================================================
|
|
1987
|
+
# Events Tool Definitions
|
|
1988
|
+
# ==============================================================================
|
|
1989
|
+
|
|
1990
|
+
|
|
1991
|
+
def generate_send_event_tool() -> dict[str, Any]:
|
|
1992
|
+
"""Generate honeycomb_send_event tool definition."""
|
|
1993
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": ["dataset", "data"]}
|
|
1994
|
+
add_parameter(schema, "dataset", "string", "The dataset slug", required=True)
|
|
1995
|
+
add_parameter(schema, "data", "object", "Event data as key-value pairs", required=True)
|
|
1996
|
+
add_parameter(schema, "timestamp", "integer", "Unix timestamp for the event", required=False)
|
|
1997
|
+
add_parameter(schema, "samplerate", "integer", "Sample rate (default: 1)", required=False)
|
|
1998
|
+
|
|
1999
|
+
examples: list[dict[str, Any]] = [
|
|
2000
|
+
{
|
|
2001
|
+
"dataset": "api-logs",
|
|
2002
|
+
"data": {"endpoint": "/api/users", "duration_ms": 42, "status_code": 200},
|
|
2003
|
+
},
|
|
2004
|
+
{
|
|
2005
|
+
"dataset": "production",
|
|
2006
|
+
"data": {"service": "auth", "latency": 15},
|
|
2007
|
+
"timestamp": 1640000000,
|
|
2008
|
+
},
|
|
2009
|
+
]
|
|
2010
|
+
|
|
2011
|
+
return create_tool_definition(
|
|
2012
|
+
name="honeycomb_send_event",
|
|
2013
|
+
description=get_description("honeycomb_send_event"),
|
|
2014
|
+
input_schema=schema,
|
|
2015
|
+
input_examples=examples,
|
|
2016
|
+
)
|
|
2017
|
+
|
|
2018
|
+
|
|
2019
|
+
def generate_send_batch_events_tool() -> dict[str, Any]:
|
|
2020
|
+
"""Generate honeycomb_send_batch_events tool definition."""
|
|
2021
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": ["dataset", "events"]}
|
|
2022
|
+
add_parameter(schema, "dataset", "string", "The dataset slug", required=True)
|
|
2023
|
+
|
|
2024
|
+
schema["properties"]["events"] = {
|
|
2025
|
+
"type": "array",
|
|
2026
|
+
"description": "Array of event objects. Each event must have a 'data' field with event payload.",
|
|
2027
|
+
"items": {
|
|
2028
|
+
"type": "object",
|
|
2029
|
+
"properties": {
|
|
2030
|
+
"data": {
|
|
2031
|
+
"type": "object",
|
|
2032
|
+
"description": "Event payload as key-value pairs (required for each event)",
|
|
2033
|
+
},
|
|
2034
|
+
"time": {
|
|
2035
|
+
"type": "string",
|
|
2036
|
+
"description": "Event timestamp in ISO8601 format (e.g., '2024-01-15T10:30:00Z'). Optional, defaults to server time.",
|
|
2037
|
+
},
|
|
2038
|
+
"samplerate": {
|
|
2039
|
+
"type": "integer",
|
|
2040
|
+
"description": "Sample rate for this event (optional, defaults to 1)",
|
|
2041
|
+
},
|
|
2042
|
+
},
|
|
2043
|
+
"required": ["data"],
|
|
2044
|
+
},
|
|
2045
|
+
}
|
|
2046
|
+
|
|
2047
|
+
examples: list[dict[str, Any]] = [
|
|
2048
|
+
{
|
|
2049
|
+
"dataset": "api-logs",
|
|
2050
|
+
"events": [
|
|
2051
|
+
{
|
|
2052
|
+
"data": {"endpoint": "/api/users", "duration_ms": 42, "status_code": 200},
|
|
2053
|
+
"time": "2024-01-15T10:30:00Z",
|
|
2054
|
+
},
|
|
2055
|
+
{
|
|
2056
|
+
"data": {"endpoint": "/api/posts", "duration_ms": 18, "status_code": 201},
|
|
2057
|
+
"time": "2024-01-15T10:30:15Z",
|
|
2058
|
+
},
|
|
2059
|
+
],
|
|
2060
|
+
},
|
|
2061
|
+
]
|
|
2062
|
+
|
|
2063
|
+
return create_tool_definition(
|
|
2064
|
+
name="honeycomb_send_batch_events",
|
|
2065
|
+
description=get_description("honeycomb_send_batch_events"),
|
|
2066
|
+
input_schema=schema,
|
|
2067
|
+
input_examples=examples,
|
|
2068
|
+
)
|
|
2069
|
+
|
|
2070
|
+
|
|
2071
|
+
# ==============================================================================
|
|
2072
|
+
# Service Map Dependencies Tool Definitions
|
|
2073
|
+
# ==============================================================================
|
|
2074
|
+
|
|
2075
|
+
|
|
2076
|
+
def generate_query_service_map_tool() -> dict[str, Any]:
|
|
2077
|
+
"""Generate honeycomb_query_service_map tool definition."""
|
|
2078
|
+
base_schema = generate_schema_from_model(
|
|
2079
|
+
ServiceMapDependencyRequestCreate,
|
|
2080
|
+
exclude_fields={"id", "status"},
|
|
2081
|
+
)
|
|
2082
|
+
|
|
2083
|
+
schema: dict[str, Any] = {"type": "object", "properties": {}, "required": []}
|
|
2084
|
+
schema["properties"].update(base_schema["properties"])
|
|
2085
|
+
schema["required"].extend(base_schema.get("required", []))
|
|
2086
|
+
|
|
2087
|
+
# Add max_pages parameter
|
|
2088
|
+
add_parameter(
|
|
2089
|
+
schema,
|
|
2090
|
+
"max_pages",
|
|
2091
|
+
"integer",
|
|
2092
|
+
"Maximum pages to fetch (default: 640, up to 64K results)",
|
|
2093
|
+
required=False,
|
|
2094
|
+
)
|
|
2095
|
+
|
|
2096
|
+
examples: list[dict[str, Any]] = [
|
|
2097
|
+
# Simple: last 2 hours
|
|
2098
|
+
{"time_range": 7200},
|
|
2099
|
+
# With filters
|
|
2100
|
+
{"time_range": 3600, "filters": [{"name": "user-service"}]},
|
|
2101
|
+
# Absolute time range
|
|
2102
|
+
{"start_time": 1640000000, "end_time": 1640003600},
|
|
2103
|
+
]
|
|
2104
|
+
|
|
2105
|
+
return create_tool_definition(
|
|
2106
|
+
name="honeycomb_query_service_map",
|
|
2107
|
+
description=get_description("honeycomb_query_service_map"),
|
|
2108
|
+
input_schema=schema,
|
|
2109
|
+
input_examples=examples,
|
|
2110
|
+
)
|
|
2111
|
+
|
|
2112
|
+
|
|
2113
|
+
# ==============================================================================
|
|
2114
|
+
# Generator Functions
|
|
2115
|
+
# ==============================================================================
|
|
2116
|
+
|
|
2117
|
+
|
|
2118
|
+
def generate_all_tools() -> list[dict[str, Any]]:
|
|
2119
|
+
"""Generate all tool definitions.
|
|
2120
|
+
|
|
2121
|
+
Returns:
|
|
2122
|
+
List of 56 tool definitions:
|
|
2123
|
+
- Priority 1: Triggers (5), SLOs (5), Burn Alerts (5) = 15 tools
|
|
2124
|
+
- Batch 1: Datasets (5), Columns (5) = 10 tools
|
|
2125
|
+
- Batch 2: Recipients (6), Derived Columns (5) = 11 tools
|
|
2126
|
+
- Batch 3a: Queries (3) = 3 tools
|
|
2127
|
+
- Batch 3b: Boards (5) = 5 tools
|
|
2128
|
+
- Batch 4: Markers (4), Marker Settings (5), Events (2), Service Map (1) = 12 tools
|
|
2129
|
+
"""
|
|
2130
|
+
tools = [
|
|
2131
|
+
# Priority 1: Triggers
|
|
2132
|
+
generate_list_triggers_tool(),
|
|
2133
|
+
generate_get_trigger_tool(),
|
|
2134
|
+
generate_create_trigger_tool(),
|
|
2135
|
+
generate_update_trigger_tool(),
|
|
2136
|
+
generate_delete_trigger_tool(),
|
|
2137
|
+
# Priority 1: SLOs
|
|
2138
|
+
generate_list_slos_tool(),
|
|
2139
|
+
generate_get_slo_tool(),
|
|
2140
|
+
generate_create_slo_tool(),
|
|
2141
|
+
generate_update_slo_tool(),
|
|
2142
|
+
generate_delete_slo_tool(),
|
|
2143
|
+
# Priority 1: Burn Alerts
|
|
2144
|
+
generate_list_burn_alerts_tool(),
|
|
2145
|
+
generate_get_burn_alert_tool(),
|
|
2146
|
+
generate_create_burn_alert_tool(),
|
|
2147
|
+
generate_update_burn_alert_tool(),
|
|
2148
|
+
generate_delete_burn_alert_tool(),
|
|
2149
|
+
# Batch 1: Datasets
|
|
2150
|
+
generate_list_datasets_tool(),
|
|
2151
|
+
generate_get_dataset_tool(),
|
|
2152
|
+
generate_create_dataset_tool(),
|
|
2153
|
+
generate_update_dataset_tool(),
|
|
2154
|
+
generate_delete_dataset_tool(),
|
|
2155
|
+
# Batch 1: Columns
|
|
2156
|
+
generate_list_columns_tool(),
|
|
2157
|
+
generate_get_column_tool(),
|
|
2158
|
+
generate_create_column_tool(),
|
|
2159
|
+
generate_update_column_tool(),
|
|
2160
|
+
generate_delete_column_tool(),
|
|
2161
|
+
# Batch 2: Recipients
|
|
2162
|
+
generate_list_recipients_tool(),
|
|
2163
|
+
generate_get_recipient_tool(),
|
|
2164
|
+
generate_create_recipient_tool(),
|
|
2165
|
+
generate_update_recipient_tool(),
|
|
2166
|
+
generate_delete_recipient_tool(),
|
|
2167
|
+
generate_get_recipient_triggers_tool(),
|
|
2168
|
+
# Batch 2: Derived Columns
|
|
2169
|
+
generate_list_derived_columns_tool(),
|
|
2170
|
+
generate_get_derived_column_tool(),
|
|
2171
|
+
generate_create_derived_column_tool(),
|
|
2172
|
+
generate_update_derived_column_tool(),
|
|
2173
|
+
generate_delete_derived_column_tool(),
|
|
2174
|
+
# Batch 3a: Queries
|
|
2175
|
+
generate_create_query_tool(),
|
|
2176
|
+
generate_get_query_tool(),
|
|
2177
|
+
generate_run_query_tool(),
|
|
2178
|
+
# Batch 3b: Boards
|
|
2179
|
+
generate_list_boards_tool(),
|
|
2180
|
+
generate_get_board_tool(),
|
|
2181
|
+
generate_create_board_tool(),
|
|
2182
|
+
generate_update_board_tool(),
|
|
2183
|
+
generate_delete_board_tool(),
|
|
2184
|
+
# Batch 4: Markers
|
|
2185
|
+
generate_list_markers_tool(),
|
|
2186
|
+
generate_create_marker_tool(),
|
|
2187
|
+
generate_update_marker_tool(),
|
|
2188
|
+
generate_delete_marker_tool(),
|
|
2189
|
+
# Batch 4: Marker Settings
|
|
2190
|
+
generate_list_marker_settings_tool(),
|
|
2191
|
+
generate_get_marker_setting_tool(),
|
|
2192
|
+
generate_create_marker_setting_tool(),
|
|
2193
|
+
generate_update_marker_setting_tool(),
|
|
2194
|
+
generate_delete_marker_setting_tool(),
|
|
2195
|
+
# Batch 4: Events
|
|
2196
|
+
generate_send_event_tool(),
|
|
2197
|
+
generate_send_batch_events_tool(),
|
|
2198
|
+
# Batch 4: Service Map
|
|
2199
|
+
generate_query_service_map_tool(),
|
|
2200
|
+
]
|
|
2201
|
+
|
|
2202
|
+
return tools
|
|
2203
|
+
|
|
2204
|
+
|
|
2205
|
+
def generate_tools_for_resource(resource: str) -> list[dict[str, Any]]:
|
|
2206
|
+
"""Generate tool definitions for a specific resource.
|
|
2207
|
+
|
|
2208
|
+
Args:
|
|
2209
|
+
resource: Resource name (triggers, slos, burn_alerts, datasets, columns, recipients, derived_columns, queries, boards)
|
|
2210
|
+
|
|
2211
|
+
Returns:
|
|
2212
|
+
List of tool definitions for that resource
|
|
2213
|
+
|
|
2214
|
+
Raises:
|
|
2215
|
+
ValueError: If resource name is invalid
|
|
2216
|
+
"""
|
|
2217
|
+
generators = {
|
|
2218
|
+
"triggers": [
|
|
2219
|
+
generate_list_triggers_tool,
|
|
2220
|
+
generate_get_trigger_tool,
|
|
2221
|
+
generate_create_trigger_tool,
|
|
2222
|
+
generate_update_trigger_tool,
|
|
2223
|
+
generate_delete_trigger_tool,
|
|
2224
|
+
],
|
|
2225
|
+
"slos": [
|
|
2226
|
+
generate_list_slos_tool,
|
|
2227
|
+
generate_get_slo_tool,
|
|
2228
|
+
generate_create_slo_tool,
|
|
2229
|
+
generate_update_slo_tool,
|
|
2230
|
+
generate_delete_slo_tool,
|
|
2231
|
+
],
|
|
2232
|
+
"burn_alerts": [
|
|
2233
|
+
generate_list_burn_alerts_tool,
|
|
2234
|
+
generate_get_burn_alert_tool,
|
|
2235
|
+
generate_create_burn_alert_tool,
|
|
2236
|
+
generate_update_burn_alert_tool,
|
|
2237
|
+
generate_delete_burn_alert_tool,
|
|
2238
|
+
],
|
|
2239
|
+
"datasets": [
|
|
2240
|
+
generate_list_datasets_tool,
|
|
2241
|
+
generate_get_dataset_tool,
|
|
2242
|
+
generate_create_dataset_tool,
|
|
2243
|
+
generate_update_dataset_tool,
|
|
2244
|
+
generate_delete_dataset_tool,
|
|
2245
|
+
],
|
|
2246
|
+
"columns": [
|
|
2247
|
+
generate_list_columns_tool,
|
|
2248
|
+
generate_get_column_tool,
|
|
2249
|
+
generate_create_column_tool,
|
|
2250
|
+
generate_update_column_tool,
|
|
2251
|
+
generate_delete_column_tool,
|
|
2252
|
+
],
|
|
2253
|
+
"recipients": [
|
|
2254
|
+
generate_list_recipients_tool,
|
|
2255
|
+
generate_get_recipient_tool,
|
|
2256
|
+
generate_create_recipient_tool,
|
|
2257
|
+
generate_update_recipient_tool,
|
|
2258
|
+
generate_delete_recipient_tool,
|
|
2259
|
+
generate_get_recipient_triggers_tool,
|
|
2260
|
+
],
|
|
2261
|
+
"derived_columns": [
|
|
2262
|
+
generate_list_derived_columns_tool,
|
|
2263
|
+
generate_get_derived_column_tool,
|
|
2264
|
+
generate_create_derived_column_tool,
|
|
2265
|
+
generate_update_derived_column_tool,
|
|
2266
|
+
generate_delete_derived_column_tool,
|
|
2267
|
+
],
|
|
2268
|
+
"queries": [
|
|
2269
|
+
generate_create_query_tool,
|
|
2270
|
+
generate_get_query_tool,
|
|
2271
|
+
generate_run_query_tool,
|
|
2272
|
+
],
|
|
2273
|
+
"boards": [
|
|
2274
|
+
generate_list_boards_tool,
|
|
2275
|
+
generate_get_board_tool,
|
|
2276
|
+
generate_create_board_tool,
|
|
2277
|
+
generate_update_board_tool,
|
|
2278
|
+
generate_delete_board_tool,
|
|
2279
|
+
],
|
|
2280
|
+
"markers": [
|
|
2281
|
+
generate_list_markers_tool,
|
|
2282
|
+
generate_create_marker_tool,
|
|
2283
|
+
generate_update_marker_tool,
|
|
2284
|
+
generate_delete_marker_tool,
|
|
2285
|
+
],
|
|
2286
|
+
"marker_settings": [
|
|
2287
|
+
generate_list_marker_settings_tool,
|
|
2288
|
+
generate_get_marker_setting_tool,
|
|
2289
|
+
generate_create_marker_setting_tool,
|
|
2290
|
+
generate_update_marker_setting_tool,
|
|
2291
|
+
generate_delete_marker_setting_tool,
|
|
2292
|
+
],
|
|
2293
|
+
"events": [
|
|
2294
|
+
generate_send_event_tool,
|
|
2295
|
+
generate_send_batch_events_tool,
|
|
2296
|
+
],
|
|
2297
|
+
"service_map": [
|
|
2298
|
+
generate_query_service_map_tool,
|
|
2299
|
+
],
|
|
2300
|
+
}
|
|
2301
|
+
|
|
2302
|
+
if resource not in generators:
|
|
2303
|
+
raise ValueError(
|
|
2304
|
+
f"Invalid resource '{resource}'. Valid resources: {', '.join(generators.keys())}"
|
|
2305
|
+
)
|
|
2306
|
+
|
|
2307
|
+
return [gen() for gen in generators[resource]]
|
|
2308
|
+
|
|
2309
|
+
|
|
2310
|
+
def export_tools_json(tools: list[dict[str, Any]], output_path: str) -> None:
|
|
2311
|
+
"""Export tool definitions to a JSON file.
|
|
2312
|
+
|
|
2313
|
+
Args:
|
|
2314
|
+
tools: List of tool definitions
|
|
2315
|
+
output_path: Path to write JSON file
|
|
2316
|
+
"""
|
|
2317
|
+
from datetime import datetime, timezone
|
|
2318
|
+
|
|
2319
|
+
output = {
|
|
2320
|
+
"tools": tools,
|
|
2321
|
+
"version": "0.1.0",
|
|
2322
|
+
"generated_at": datetime.now(timezone.utc).isoformat(),
|
|
2323
|
+
"count": len(tools),
|
|
2324
|
+
}
|
|
2325
|
+
|
|
2326
|
+
with open(output_path, "w") as f:
|
|
2327
|
+
json.dump(output, f, indent=2)
|
|
2328
|
+
|
|
2329
|
+
|
|
2330
|
+
def export_tools_python(tools: list[dict[str, Any]], output_path: str) -> None:
|
|
2331
|
+
"""Export tool definitions to a Python module.
|
|
2332
|
+
|
|
2333
|
+
Args:
|
|
2334
|
+
tools: List of tool definitions
|
|
2335
|
+
output_path: Path to write Python file
|
|
2336
|
+
"""
|
|
2337
|
+
from datetime import datetime, timezone
|
|
2338
|
+
|
|
2339
|
+
# Generate the Python code
|
|
2340
|
+
code = f'''"""Auto-generated Honeycomb tool definitions for Claude API.
|
|
2341
|
+
|
|
2342
|
+
Generated at: {datetime.now(timezone.utc).isoformat()}
|
|
2343
|
+
Version: 0.1.0
|
|
2344
|
+
Tool count: {len(tools)}
|
|
2345
|
+
"""
|
|
2346
|
+
|
|
2347
|
+
from typing import Any
|
|
2348
|
+
|
|
2349
|
+
HONEYCOMB_TOOLS: list[dict[str, Any]] = {json.dumps(tools, indent=4)}
|
|
2350
|
+
|
|
2351
|
+
|
|
2352
|
+
def get_tool(name: str) -> dict[str, Any] | None:
|
|
2353
|
+
"""Get a tool definition by name.
|
|
2354
|
+
|
|
2355
|
+
Args:
|
|
2356
|
+
name: Tool name (e.g., "honeycomb_create_trigger")
|
|
2357
|
+
|
|
2358
|
+
Returns:
|
|
2359
|
+
Tool definition dict or None if not found
|
|
2360
|
+
"""
|
|
2361
|
+
for tool in HONEYCOMB_TOOLS:
|
|
2362
|
+
if tool["name"] == name:
|
|
2363
|
+
return tool
|
|
2364
|
+
return None
|
|
2365
|
+
|
|
2366
|
+
|
|
2367
|
+
def get_all_tools() -> list[dict[str, Any]]:
|
|
2368
|
+
"""Get all tool definitions.
|
|
2369
|
+
|
|
2370
|
+
Returns:
|
|
2371
|
+
List of all tool definitions
|
|
2372
|
+
"""
|
|
2373
|
+
return HONEYCOMB_TOOLS.copy()
|
|
2374
|
+
|
|
2375
|
+
|
|
2376
|
+
def list_tool_names() -> list[str]:
|
|
2377
|
+
"""Get list of all tool names.
|
|
2378
|
+
|
|
2379
|
+
Returns:
|
|
2380
|
+
List of tool names
|
|
2381
|
+
"""
|
|
2382
|
+
return [tool["name"] for tool in HONEYCOMB_TOOLS]
|
|
2383
|
+
'''
|
|
2384
|
+
|
|
2385
|
+
with open(output_path, "w") as f:
|
|
2386
|
+
f.write(code)
|