Skip to main content
Glama

list_triggers

Retrieve detailed triggers and metadata for a specific dataset in a Honeycomb environment. This tool provides names, descriptions, thresholds, and additional details for all available alerts.

Instructions

Lists available triggers (alerts) for a specific dataset. This tool returns a list of all triggers available in the specified dataset, including their names, descriptions, thresholds, and other metadata. NOTE: all is NOT supported as a dataset name -- it is not possible to list all triggers in an environment.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
datasetYesThe dataset to fetch triggers from
environmentYesThe Honeycomb environment

Implementation Reference

  • Handler function for the list_triggers tool. Validates required parameters (environment, dataset), fetches triggers using HoneycombAPI.getTriggers, simplifies trigger data into a compact interface, computes counts for active and triggered triggers, and returns structured content with JSON-serialized triggers and metadata.
    handler: async ({ environment, dataset }: z.infer<typeof DatasetArgumentsSchema>) => { // Validate input parameters if (!environment) { return handleToolError(new Error("environment parameter is required"), "list_triggers"); } if (!dataset) { return handleToolError(new Error("dataset parameter is required"), "list_triggers"); } try { // Fetch triggers from the API const triggers = await api.getTriggers(environment, dataset); // Simplify the response to reduce context window usage const simplifiedTriggers: SimplifiedTrigger[] = triggers.map(trigger => ({ id: trigger.id, name: trigger.name, description: trigger.description || '', threshold: { op: trigger.threshold.op, value: trigger.threshold.value, }, triggered: trigger.triggered, disabled: trigger.disabled, frequency: trigger.frequency, alert_type: trigger.alert_type, })); const activeCount = simplifiedTriggers.filter(trigger => !trigger.disabled).length; const triggeredCount = simplifiedTriggers.filter(trigger => trigger.triggered).length; return { content: [ { type: "text", text: JSON.stringify(simplifiedTriggers, null, 2), }, ], metadata: { count: simplifiedTriggers.length, activeCount, triggeredCount, dataset, environment } }; } catch (error) { return handleToolError(error, "list_triggers"); } }
  • Input schema using Zod for validating environment and dataset parameters required by the list_triggers tool.
    schema: { environment: z.string().describe("The Honeycomb environment"), dataset: z.string().describe("The dataset to fetch triggers from"), },
  • The list_triggers tool is created via createListTriggersTool(api) and included in the tools array, which is subsequently registered with the MCP server in a loop.
    // Trigger tools createListTriggersTool(api), createGetTriggerTool(api),
  • SimplifiedTrigger interface defines the structure of trigger data returned by the tool to reduce context window usage.
    interface SimplifiedTrigger { id: string; name: string; description: string; threshold: { op: string; value: number; }; triggered: boolean; disabled: boolean; frequency: number; alert_type?: string; }
  • Import of the createListTriggersTool function used to instantiate the list_triggers tool.
    import { createListTriggersTool } from "./list-triggers.js";

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/honeycombio/honeycomb-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server