list_data_sources
Retrieve a list of all available data sources in Redash to review connections and access settings.
Instructions
List all available data sources in Redash
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:214-239 (handler)The handler function for the 'list_data_sources' tool. Calls redashClient.getDataSources() and returns the data sources list as JSON. Has no input parameters (no schema required).
// Tool: list_data_sources async function listDataSources() { try { const dataSources = await redashClient.getDataSources(); return { content: [ { type: "text", text: JSON.stringify(dataSources, null, 2) } ] }; } catch (error) { logger.error(`Error listing data sources: ${error}`); return { isError: true, content: [ { type: "text", text: `Error listing data sources: ${error instanceof Error ? error.message : String(error)}` } ] }; } } - src/index.ts:1676-1683 (registration)Registration of 'list_data_sources' in the ListToolsRequestSchema handler, defining its name, description, and empty input schema (no parameters).
{ name: "list_data_sources", description: "List all available data sources in Redash", inputSchema: { type: "object", properties: {} } }, - src/index.ts:2352-2355 (registration)Route registration in the CallToolRequestSchema switch statement: case 'list_data_sources' dispatches to listDataSources() handler.
case "list_data_sources": logger.debug(`Handling list_data_sources`); return await listDataSources(); - src/redashClient.ts:478-487 (helper)The getDataSources() helper method on RedashClient that makes the actual HTTP GET request to /api/data_sources to fetch data sources from Redash.
// List available data sources async getDataSources(): Promise<any[]> { try { const response = await this.client.get('/api/data_sources'); return response.data; } catch (error) { logger.error(`Error fetching data sources: ${error}`); throw new Error('Failed to fetch data sources from Redash'); } }