list_recipients
Retrieve available notification recipients for a specific Honeycomb environment, including names, types, targets, and metadata, with pagination and search capabilities.
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
| Name | Required | Description | Default |
|---|---|---|---|
| environment | Yes | The Honeycomb environment | |
| page | No | Page number (1-based) | |
| limit | No | Number of items per page | |
| sort_by | No | Field to sort by | |
| sort_order | No | Sort direction | |
| search | No | Search term to filter results | |
| search_fields | No | Fields to search in (string or array of strings) |
Implementation Reference
- src/tools/list-recipients.ts:24-59 (handler)The handler function that executes the list_recipients tool logic: validates input, fetches recipients via API, simplifies data, and returns formatted response.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"); } }
- src/types/schema.ts:385-388 (schema)Zod schema for list_recipients tool inputs: requires 'environment', merges optional pagination parameters.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.");
- src/tools/index.ts:42-43 (registration)Registration of the list_recipients tool: created via createListRecipientsTool(api) and added to the tools array in registerTools function, which registers all tools with the MCP server via a loop.// Recipient tools createListRecipientsTool(api),