get_my_dashboards
Retrieve dashboards created by the current Redash user. Supports pagination with page number and page size.
Instructions
Get dashboards created by the current user
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number (starts at 1) | |
| pageSize | No | Number of results per page |
Implementation Reference
- src/index.ts:817-830 (handler)MCP tool handler for 'get_my_dashboards'. Validates args via getMyDashboardsSchema, calls redashClient.getMyDashboards(), and returns the result as JSON text content.
async function getMyDashboards(params: z.infer<typeof getMyDashboardsSchema>) { try { const result = await redashClient.getMyDashboards(params.page, params.pageSize); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error) { logger.error(`Error fetching my dashboards: ${error}`); return { isError: true, content: [{ type: "text", text: `Error fetching my dashboards: ${error instanceof Error ? error.message : String(error)}` }] }; } } - src/index.ts:812-815 (schema)Zod schema for 'get_my_dashboards' input validation. Accepts optional 'page' (default 1) and 'pageSize' (default 25) parameters.
const getMyDashboardsSchema = z.object({ page: z.coerce.number().optional().default(1), pageSize: z.coerce.number().optional().default(25) }); - src/index.ts:1907-1917 (registration)Tool registration in ListToolsRequestSchema handler. Registers 'get_my_dashboards' with description 'Get dashboards created by the current user' and input schema with page/pageSize properties.
{ name: "get_my_dashboards", description: "Get dashboards created by the current user", inputSchema: { type: "object", properties: { page: { type: "number", description: "Page number (starts at 1)" }, pageSize: { type: "number", description: "Number of results per page" } } } }, - src/index.ts:2426-2428 (registration)CallToolRequestSchema handler routing for 'get_my_dashboards'. Parses args with getMyDashboardsSchema and delegates to the getMyDashboards handler function.
case "get_my_dashboards": logger.debug(`Handling get_my_dashboards`); return await getMyDashboards(getMyDashboardsSchema.parse(args)); - src/redashClient.ts:836-851 (helper)Redash API client method that makes the actual HTTP GET request to '/api/dashboards/my' with pagination params. Returns count, page, pageSize, and results array of RedashDashboard objects.
async getMyDashboards(page = 1, pageSize = 25): Promise<{ count: number; page: number; pageSize: number; results: RedashDashboard[] }> { try { const response = await this.client.get('/api/dashboards/my', { params: { page, page_size: pageSize } }); return { count: response.data.count, page: response.data.page, pageSize: response.data.page_size, results: response.data.results }; } catch (error) { logger.error(`Error fetching my dashboards: ${error}`); throw new Error(`Failed to fetch my dashboards: ${error instanceof Error ? error.message : String(error)}`); } }