Skip to main content
Glama
jasonsmithj

Redash MCP Server

by jasonsmithj

get_data_source

Retrieve configuration and connection details for a specific data source in Redash by providing its ID.

Instructions

Get details about a specific data source

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
data_source_idYesThe ID of the data source

Implementation Reference

  • The handler function that implements the core logic of the 'get_data_source' tool: validates the data_source_id argument, fetches the data source using RedashClient, stringifies it to JSON, or returns an error response.
    handler: async (args, client) => { try { const dataSourceId = args.data_source_id; if (typeof dataSourceId !== 'number') { return { content: [ { type: 'text', text: 'Error: data_source_id is required and must be a number', } as TextContent, ], isError: true, }; } const dataSource = await client.getDataSource(dataSourceId); return { content: [ { type: 'text', text: JSON.stringify(dataSource, null, 2), } as TextContent, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error getting data source: ${error instanceof Error ? error.message : String(error)}`, } as TextContent, ], isError: true, }; } },
  • Input schema definition for the 'get_data_source' tool, specifying the required 'data_source_id' as a number >=1.
    inputSchema: { type: 'object', properties: { data_source_id: { type: 'number', description: 'The ID of the data source', minimum: 1, }, }, required: ['data_source_id'], additionalProperties: false, },
  • src/index.ts:56-59 (registration)
    Registration of the getDataSourceTool in the tools array used by the MCP server's list_tools and call_tool request handlers.
    /** * Register tools */ const tools = [listDataSourcesTool, getDataSourceTool, executeQueryAndWaitTool, listQueriesTool];
  • Helper method in RedashClient that performs the API request to fetch a specific data source by ID, used by the tool handler.
    */ async getDataSource(id: number): Promise<DataSource> { return this.request<DataSource>(`/api/data_sources/${id}`); } /**

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jasonsmithj/redash-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server