list_destinations
Retrieve a list of all alert notification destinations, such as email and Slack, to view or manage where alerts are sent.
Instructions
List all alert notification destinations (email, Slack, etc.)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:1501-1515 (handler)The main handler function for the 'list_destinations' tool. Calls redashClient.getDestinations() and returns the result.
// Tool: list_destinations async function listDestinations() { try { const result = await redashClient.getDestinations(); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error) { logger.error(`Error listing destinations: ${error}`); return { isError: true, content: [{ type: "text", text: `Error listing destinations: ${error instanceof Error ? error.message : String(error)}` }] }; } } - src/index.ts:2280-2288 (registration)Tool registration entry for 'list_destinations' in the ListToolsRequestSchema handler, defining its name, description, and empty inputSchema.
// Destination tools { name: "list_destinations", description: "List all alert notification destinations (email, Slack, etc.)", inputSchema: { type: "object", properties: {} } } - src/index.ts:2554-2557 (registration)The case in the CallToolRequestSchema switch statement that routes 'list_destinations' calls to the listDestinations() handler.
// Destination tools case "list_destinations": logger.debug(`Handling list_destinations`); return await listDestinations(); - src/redashClient.ts:251-257 (schema)The RedashDestination interface definition used as the type for the destinations data.
// Destination interface export interface RedashDestination { id: number; name: string; type: string; options: any; } - src/redashClient.ts:1219-1231 (helper)The redashClient.getDestinations() method that performs the actual API call to GET /api/destinations.
// ----- Destination API Methods ----- // Get all destinations async getDestinations(): Promise<RedashDestination[]> { try { const response = await this.client.get('/api/destinations'); return response.data; } catch (error) { logger.error(`Error fetching destinations: ${error}`); throw new Error(`Failed to fetch destinations: ${error instanceof Error ? error.message : String(error)}`); } } }