get_slo
Retrieve detailed Service Level Objective information by ID from Honeycomb observability data. Get SLO metrics including compliance, target, time period, and budget remaining for monitoring system performance.
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 |
|---|---|---|---|
| environment | Yes | The Honeycomb environment | |
| dataset | Yes | The dataset containing the SLO | |
| sloId | Yes | The ID of the SLO to retrieve |
Implementation Reference
- src/tools/get-slo.ts:45-91 (handler)The handler function that implements the core logic of the 'get_slo' tool: validates parameters, fetches SLO data using the Honeycomb API, simplifies the response structure, and returns it in MCP format.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)Zod schema defining the input parameters for the 'get_slo' tool: 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 structure of SLO data returned by the tool.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:45-47 (registration)Registration of the 'get_slo' tool by including its creator function in the tools array passed to the MCP server registration.// SLO tools createListSLOsTool(api), createGetSLOTool(api),
- src/tools/index.ts:10-11 (registration)Import of the createGetSLOTool function used to instantiate and register the 'get_slo' tool.import { createListSLOsTool } from "./list-slos.js"; import { createGetSLOTool } from "./get-slo.js";