list_data_sources
Retrieve all configured data sources available in Redash for query execution and data analysis.
Instructions
List all available data sources in Redash
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/datasource.ts:23-54 (handler)Full implementation of the list_data_sources tool handler, which takes no arguments, calls RedashClient.listDataSources(), stringifies the result as JSON, and handles errors.export const listDataSourcesTool: Tool = { name: 'list_data_sources', description: 'List all available data sources in Redash', inputSchema: { type: 'object', properties: {}, additionalProperties: false, }, handler: async (_args, client) => { try { const dataSources = await client.listDataSources(); return { content: [ { type: 'text', text: JSON.stringify(dataSources, null, 2), } as TextContent, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error listing data sources: ${error instanceof Error ? error.message : String(error)}`, } as TextContent, ], isError: true, }; } }, };
- src/tools/datasource.ts:26-30 (schema)Input schema for list_data_sources tool: empty object (no parameters required).inputSchema: { type: 'object', properties: {}, additionalProperties: false, },
- src/index.ts:59-59 (registration)Registration of listDataSourcesTool in the tools array used by MCP server handlers.const tools = [listDataSourcesTool, getDataSourceTool, executeQueryAndWaitTool, listQueriesTool];
- src/index.ts:16-16 (registration)Import of listDataSourcesTool for registration.import { listDataSourcesTool, getDataSourceTool } from './tools/datasource.js';
- src/redash-client.ts:111-113 (helper)Helper method on RedashClient used by the tool handler to fetch data sources via API.async listDataSources(): Promise<DataSource[]> { return this.request<DataSource[]>('/api/data_sources'); }