list_tables
Retrieve all tables within a specified NocoDB base to view database structure and available data collections.
Instructions
List all tables in a base
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base_id | Yes | The ID of the base/project |
Implementation Reference
- src/tools/table.ts:18-32 (handler)The handler function for the 'list_tables' MCP tool. It calls the NocoDB client's listTables method with the provided base_id and returns a formatted response containing the list of tables with selected metadata fields and the total count.handler: async (client: NocoDBClient, args: { base_id: string }) => { const tables = await client.listTables(args.base_id); return { tables: tables.map((table) => ({ id: table.id, table_name: table.table_name, title: table.title, type: table.type, enabled: table.enabled, created_at: table.created_at, updated_at: table.updated_at, })), count: tables.length, }; },
- src/tools/table.ts:8-17 (schema)The input schema definition for the 'list_tables' tool, specifying an object with a required 'base_id' string parameter.inputSchema: { type: "object", properties: { base_id: { type: "string", description: "The ID of the base/project", }, }, required: ["base_id"], },
- src/index.ts:55-62 (registration)Combines and registers 'tableTools' (which includes 'list_tables') with other tool sets into 'allTools', which is used by the MCP server to handle ListToolsRequestSchema and CallToolRequestSchema.const allTools = [ ...databaseTools, ...tableTools, ...recordTools, ...viewTools, ...queryTools, ...attachmentTools, ];
- src/nocodb-api.ts:72-77 (helper)Helper method in NocoDBClient that performs the actual API call to retrieve the list of tables for a given base ID via the NocoDB meta endpoint.async listTables(baseId: string): Promise<NocoDBTable[]> { const response = await this.client.get( `/api/v1/db/meta/projects/${baseId}/tables`, ); return response.data.list; }