Skip to main content
Glama
honeycombio
by honeycombio

list_triggers

Retrieve all configured alerts and their metadata for a specific dataset in Honeycomb to monitor system performance and identify issues.

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
environmentYesThe Honeycomb environment
datasetYesThe dataset to fetch triggers from

Implementation Reference

  • Handler for the list_triggers tool: validates environment and dataset parameters, fetches triggers via api.getTriggers, maps to SimplifiedTrigger format, calculates active and triggered counts, returns JSON content 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");
      }
    }
  • Zod schema defining input parameters: environment (string) and dataset (string) for the list_triggers tool.
    schema: {
      environment: z.string().describe("The Honeycomb environment"),
      dataset: z.string().describe("The dataset to fetch triggers from"),
    },
  • Creation of the list_triggers tool instance using createListTriggersTool and addition to the tools array.
    createListTriggersTool(api),
  • Loop that registers each tool, including list_triggers, to the MCP server by calling server.tool with name, description, schema, and wrapper handler.
    for (const tool of tools) {
      // Register the tool with the server using type assertion to bypass TypeScript's strict type checking
      (server as any).tool(
        tool.name,
        tool.description,
        tool.schema, 
        async (args: Record<string, any>, extra: any) => {
          try {
            // Validate and ensure required fields are present before passing to handler
            if (tool.name.includes("analyze_columns") && (!args.environment || !args.dataset || !args.columns)) {
              throw new Error("Missing required fields: environment, dataset, and columns are required");
            } else if (tool.name.includes("run_query") && (!args.environment || !args.dataset)) {
              throw new Error("Missing required fields: environment and dataset are required");
            }
            
            // Use type assertion to satisfy TypeScript's type checking
            const result = await tool.handler(args as any);
            
            // If the result already has the expected format, return it directly
            if (result && typeof result === 'object' && 'content' in result) {
              return result as any;
            }
            
            // Otherwise, format the result as expected by the SDK
            return {
              content: [
                {
                  type: "text",
                  text: typeof result === 'string' ? result : JSON.stringify(result, null, 2),
                },
              ],
            } as any;
          } catch (error) {
            // Format errors to match the SDK's expected format
            return {
              content: [
                {
                  type: "text",
                  text: error instanceof Error ? error.message : String(error),
                },
              ],
              isError: true,
            } as any;
          }
        }
      );
    }
  • Interface defining the simplified trigger data structure returned by the tool.
    interface SimplifiedTrigger {
      id: string;
      name: string;
      description: string;
      threshold: {
        op: string;
        value: number;
      };
      triggered: boolean;
      disabled: boolean;
      frequency: number;
      alert_type?: string;
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses key behavioral traits: it returns a list with specific metadata, and importantly notes the constraint that '__all__ is NOT supported', which is crucial for correct usage. It does not cover aspects like pagination, rate limits, or error handling, but provides sufficient operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose in the first sentence, followed by details on return values and a critical note. Every sentence adds value without redundancy, making it efficient and well-structured for quick understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description compensates well by explaining what the tool returns and a key constraint. It covers the essential context for a list operation, though it could be more complete by mentioning potential limitations like response size or authentication needs, which are not addressed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters (environment and dataset). The description adds value by clarifying that 'dataset' cannot be '__all__', which is a semantic constraint beyond the schema. However, it does not provide additional details on parameter formats or examples, staying at the baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Lists' and the resource 'triggers (alerts) for a specific dataset', specifying it returns names, descriptions, thresholds, and metadata. It distinguishes from siblings like 'get_trigger' (singular) and 'list_datasets' by focusing on triggers within a dataset.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context by noting that '__all__ is NOT supported as a dataset name', which helps avoid misuse. However, it does not explicitly state when to use this tool versus alternatives like 'get_trigger' or other list tools, leaving some ambiguity in sibling differentiation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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