get_view_data
Retrieve records from a specific NocoDB view by providing base ID, table name, and view ID. Supports pagination with limit and offset parameters for efficient data access.
Instructions
Get records from a specific view
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base_id | Yes | The ID of the base/project | |
| table_name | Yes | The name of the table | |
| view_id | Yes | The ID of the view | |
| limit | No | Number of records to return | |
| offset | No | Number of records to skip |
Implementation Reference
- src/tools/view.ts:113-134 (handler)The handler function that implements the core logic of the 'get_view_data' tool, fetching records from a specific view using the NocoDBClient's listRecords method with viewId, limit, and offset parameters.handler: async ( client: NocoDBClient, args: { base_id: string; table_name: string; view_id: string; limit?: number; offset?: number; }, ) => { const result = await client.listRecords(args.base_id, args.table_name, { viewId: args.view_id, limit: args.limit, offset: args.offset, }); return { records: result.list, pageInfo: result.pageInfo, count: result.list.length, view_id: args.view_id, }; },
- src/tools/view.ts:87-112 (schema)Input schema defining the parameters for the 'get_view_data' tool: base_id, table_name, view_id (required), and optional limit and offset.inputSchema: { type: "object", properties: { base_id: { type: "string", description: "The ID of the base/project", }, table_name: { type: "string", description: "The name of the table", }, view_id: { type: "string", description: "The ID of the view", }, limit: { type: "number", description: "Number of records to return", }, offset: { type: "number", description: "Number of records to skip", }, }, required: ["base_id", "table_name", "view_id"], },
- src/index.ts:55-62 (registration)Registers the 'get_view_data' tool by including the viewTools array (containing it) in the allTools array, which is used for listing and calling tools in the MCP server handlers.const allTools = [ ...databaseTools, ...tableTools, ...recordTools, ...viewTools, ...queryTools, ...attachmentTools, ];