list_dashboards
List all dashboards in a base by providing the base app token.
Instructions
List all dashboards in a base
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app_token | Yes | Base app token |
Implementation Reference
- src/mcp-server.ts:491-505 (handler)MCP tool handler for 'list_dashboards'. Calls client.listDashboards() and returns the results.
case 'list_dashboards': { const dashboards = await client.listDashboards(args.app_token as string); return { content: [ { type: 'text', text: JSON.stringify({ success: true, count: dashboards.length, dashboards, }, null, 2), }, ], }; } - src/mcp-server.ts:285-298 (schema)Tool schema definition for 'list_dashboards' in the MCP tools array. Defines input schema with required 'app_token' field.
{ name: 'list_dashboards', description: 'List all dashboards in a base', inputSchema: { type: 'object', properties: { app_token: { type: 'string', description: 'Base app token', }, }, required: ['app_token'], }, }, - src/api/client.ts:330-340 (helper)The API client method that makes the actual HTTP GET request to the Lark bitable API to list dashboards.
/** * List all dashboards in a base * @param appToken - Base app token */ async listDashboards(appToken: string): Promise<any[]> { const response = await this.request<{ items: any[] }>({ method: 'GET', url: `/bitable/v1/apps/${appToken}/dashboards`, }); return response.data?.items || []; } - src/mcp-server.ts:319-322 (registration)MCP server registration of tools via ListToolsRequestSchema handler. The tools array (including list_dashboards) is registered here.
// Handle tool list requests server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; }); - bot/bot-dashboard-assistant.ts:908-938 (handler)Alternative handler for 'list_dashboards' intent in the bot assistant. Uses listBlocks instead of listDashboards.
private async handleListDashboards( intent: ParsedIntent, context: ConversationContext, chatId: string ): Promise<void> { const { appToken } = intent.entities; if (!appToken) { await this.sendMessage(chatId, '❓ I need an app token to list dashboards.'); return; } try { const blocks = await this.dashboardClient.listBlocks(appToken); if (blocks.length === 0) { await this.sendMessage(chatId, '📋 No dashboards found in this base.'); return; } const message = `📋 Found ${blocks.length} block(s):\n\n` + blocks.map((block: any, i: number) => `${i + 1}. ${block.block_type || 'Unknown'} (ID: ${block.block_id})` ).join('\n'); await this.sendMessage(chatId, message); } catch (error: any) { await this.sendMessage(chatId, `❌ Failed to list dashboards: ${error.message}`); } }