Skip to main content
Glama

list_recipients

Retrieve and filter notification recipients in a Honeycomb environment. This tool provides a detailed list of recipient names, types, targets, and metadata for effective notification management.

Instructions

Lists available recipients for notifications in a specific environment. This tool returns a list of all recipients available in the specified environment, including their names, types, targets, and metadata.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
environmentYesThe Honeycomb environment
limitNoNumber of items per page
pageNoPage number (1-based)
searchNoSearch term to filter results
search_fieldsNoFields to search in (string or array of strings)
sort_byNoField to sort by
sort_orderNoSort direction

Implementation Reference

  • The handler function for the 'list_recipients' tool. It validates the 'environment' parameter, fetches recipients from the Honeycomb API, simplifies the response data, formats it as JSON text content with metadata, and handles errors using handleToolError.
    handler: async ({ environment }: z.infer<typeof ListRecipientsSchema>) => { // Validate input parameters if (!environment) { return handleToolError(new Error("environment parameter is required"), "list_recipients"); } try { // Fetch recipients from the API const recipients = await api.getRecipients(environment); // Create a simplified response const simplifiedRecipients = recipients.map(recipient => ({ id: recipient.id, name: recipient.name, type: recipient.type, target: recipient.target || '', created_at: recipient.created_at, updated_at: recipient.updated_at, })); return { content: [ { type: "text", text: JSON.stringify(simplifiedRecipients, null, 2), }, ], metadata: { count: simplifiedRecipients.length, environment } }; } catch (error) { return handleToolError(error, "list_recipients"); } }
  • Zod schema defining input parameters for the list_recipients tool: required 'environment' string, optional pagination fields from PaginationSchema.
    export const ListRecipientsSchema = z.object({ environment: z.string().min(1).trim().describe("The Honeycomb environment"), }).merge(PaginationSchema).describe("Parameters for listing notification recipients in a Honeycomb environment. Recipients receive alerts from triggers.");
  • Registration of the list_recipients tool: created via createListRecipientsTool(api) and added to the tools array in registerTools function, which iterates and registers each tool with the MCP server using server.tool().
    createListRecipientsTool(api),
  • src/tools/index.ts:9-9 (registration)
    Import of the createListRecipientsTool function used to instantiate the tool.
    import { createListRecipientsTool } from "./list-recipients.js";
  • The createListRecipientsTool factory function that returns the tool object with name, description, schema, and handler for 'list_recipients'. Note: name has typo 'list_recipient' without 's'? Wait, check: actually in code it's "list_recipients".
    export function createListRecipientsTool(api: HoneycombAPI) { return { name: "list_recipients", description: "Lists available recipients for notifications in a specific environment. This tool returns a list of all recipients available in the specified environment, including their names, types, targets, and metadata.", schema: ListRecipientsSchema.shape, /** * Handler for the list_recipients tool * * @param params - The parameters for the tool * @param params.environment - The Honeycomb environment * @returns List of recipients with relevant metadata */ handler: async ({ environment }: z.infer<typeof ListRecipientsSchema>) => { // Validate input parameters if (!environment) { return handleToolError(new Error("environment parameter is required"), "list_recipients"); } try { // Fetch recipients from the API const recipients = await api.getRecipients(environment); // Create a simplified response const simplifiedRecipients = recipients.map(recipient => ({ id: recipient.id, name: recipient.name, type: recipient.type, target: recipient.target || '', created_at: recipient.created_at, updated_at: recipient.updated_at, })); return { content: [ { type: "text", text: JSON.stringify(simplifiedRecipients, null, 2), }, ], metadata: { count: simplifiedRecipients.length, environment } }; } catch (error) { return handleToolError(error, "list_recipients"); } } }; }

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