list_data_sources
View all connected data sources in your Redash instance to identify available databases and datasets for querying.
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)Defines the 'list_data_sources' tool including its input schema (empty object), description, and handler function. The handler calls RedashClient.listDataSources(), stringifies the result as JSON, and returns it as text content, or 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/index.ts:59-59 (registration)Registers the listDataSourcesTool by including it in the tools array used by the MCP server's list_tools and call_tool request handlers.const tools = [listDataSourcesTool, getDataSourceTool, executeQueryAndWaitTool, listQueriesTool];
- src/redash-client.ts:111-113 (helper)Helper method in RedashClient that performs the API request to fetch the list of data sources from '/api/data_sources', invoked by the tool handler.async listDataSources(): Promise<DataSource[]> { return this.request<DataSource[]>('/api/data_sources'); }