list_slos
Retrieve a list of Service Level Objectives (SLOs) for a specified dataset and environment, including names, descriptions, time periods, and success targets per million events.
Instructions
Lists available SLOs (Service Level Objectives) for a specific dataset. This tool returns a list of all SLOs available in the specified environment, including their names, descriptions, time periods, and target per million events expected to succeed. NOTE: all is NOT supported as a dataset name -- it is not possible to list all SLOs in an environment.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dataset | Yes | The dataset to fetch SLOs from | |
| environment | Yes | The Honeycomb environment |
Implementation Reference
- src/tools/list-slos.ts:39-77 (handler)Handler function for list_slos tool: validates environment and dataset, fetches SLOs via api.getSLOs, simplifies to id, name, description, time_period_days, target_per_million, returns JSON stringified content with metadata.handler: async ({ environment, dataset }: z.infer<typeof DatasetArgumentsSchema>) => { // Validate input parameters if (!environment) { return handleToolError(new Error("environment parameter is required"), "list_slos"); } if (!dataset) { return handleToolError(new Error("dataset parameter is required"), "list_slos"); } try { // Fetch SLOs from the API const slos = await api.getSLOs(environment, dataset); // Simplify the response to reduce context window usage const simplifiedSLOs: SimplifiedSLO[] = slos.map(slo => ({ id: slo.id, name: slo.name, description: slo.description || '', time_period_days: slo.time_period_days, target_per_million: slo.target_per_million, })); return { content: [ { type: "text", text: JSON.stringify(simplifiedSLOs, null, 2), }, ], metadata: { count: simplifiedSLOs.length, dataset, environment } }; } catch (error) { return handleToolError(error, "list_slos"); } }
- src/tools/list-slos.ts:27-30 (schema)Zod input schema requiring 'environment' and 'dataset' strings.schema: { environment: z.string().describe("The Honeycomb environment"), dataset: z.string().describe("The dataset to fetch SLOs from"), },
- src/tools/index.ts:46-46 (registration)Registration of list_slos tool via createListSLOsTool(api) in the tools array passed to registerTools function.createListSLOsTool(api),
- src/tools/list-slos.ts:9-15 (schema)TypeScript interface defining the simplified SLO structure returned by the tool.interface SimplifiedSLO { id: string; name: string; description: string; time_period_days: number; target_per_million: number; }
- src/tools/index.ts:10-10 (registration)Import of createListSLOsTool from list-slos.js for tool registration.import { createListSLOsTool } from "./list-slos.js";