get_slo
Retrieve detailed SLO (Service Level Objective) information from Honeycomb datasets using an SLO ID. Access data like compliance, target per million, budget remaining, and timestamps for precise observability analysis.
Instructions
Retrieves a specific SLO (Service Level Objective) by ID with detailed information. This tool returns a detailed object containing the SLO's ID, name, description, time period, target per million, compliance, budget remaining, SLI alias, and timestamps.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dataset | Yes | The dataset containing the SLO | |
| environment | Yes | The Honeycomb environment | |
| sloId | Yes | The ID of the SLO to retrieve |
Implementation Reference
- src/tools/get-slo.ts:45-91 (handler)The handler function for the get_slo tool. It validates the input parameters (environment, dataset, sloId), fetches the SLO data using api.getSLO, simplifies the response into a structured object, and returns it in the expected MCP format with metadata. Errors are handled via handleToolError.handler: async ({ environment, dataset, sloId }: { environment: string; dataset: string; sloId: string }) => { // Validate input parameters if (!environment) { return handleToolError(new Error("environment parameter is required"), "get_slo"); } if (!dataset) { return handleToolError(new Error("dataset parameter is required"), "get_slo"); } if (!sloId) { return handleToolError(new Error("sloId parameter is required"), "get_slo"); } try { // Fetch SLO details from the API const slo = await api.getSLO(environment, dataset, sloId); // Simplify the response to reduce context window usage const simplifiedSLO: SimplifiedSLODetails = { id: slo.id, name: slo.name, description: slo.description || '', time_period_days: slo.time_period_days, target_per_million: slo.target_per_million, compliance: slo.compliance, budget_remaining: slo.budget_remaining, sli: slo.sli?.alias, created_at: slo.created_at, updated_at: slo.updated_at, }; return { content: [ { type: "text", text: JSON.stringify(simplifiedSLO, null, 2), }, ], metadata: { sloId, dataset, environment } }; } catch (error) { return handleToolError(error, "get_slo"); } }
- src/tools/get-slo.ts:31-35 (schema)Input schema for the get_slo tool using Zod validation for required parameters: environment, dataset, and sloId.schema: { environment: z.string().describe("The Honeycomb environment"), dataset: z.string().describe("The dataset containing the SLO"), sloId: z.string().describe("The ID of the SLO to retrieve"), },
- src/tools/get-slo.ts:8-19 (schema)TypeScript interface defining the simplified SLO data structure returned by the get_slo tool handler.interface SimplifiedSLODetails { id: string; name: string; description: string; time_period_days: number; target_per_million: number; compliance: number; budget_remaining: number; sli: string | undefined; created_at: string; updated_at: string; }
- src/tools/index.ts:47-47 (registration)The get_slo tool is registered by calling createGetSLOTool(api) and adding it to the tools array in registerTools function, which then registers all tools with the MCP server.createGetSLOTool(api),