Skip to main content
Glama

list_records

Retrieve records from a NocoDB table with filtering, sorting, and pagination options to manage and query database data.

Instructions

List records from a table with optional filtering, sorting, and pagination

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
base_idYesThe ID of the base/project
table_nameYesThe name of the table
whereNoFilter condition (e.g., "(status,eq,active)")
sortNoSort fields (prefix with - for descending, e.g., "-created_at")
fieldsNoComma-separated list of fields to return
limitNoNumber of records to return (default: 25)
offsetNoNumber of records to skip
view_idNoView ID to use for filtering

Implementation Reference

  • The handler function for the 'list_records' MCP tool. It takes the tool arguments and forwards them to the NocoDBClient's listRecords method, returning the records, pageInfo, and count.
    handler: async ( client: NocoDBClient, args: { base_id: string; table_name: string; where?: string; sort?: string; fields?: string; limit?: number; offset?: number; view_id?: string; }, ) => { const result = await client.listRecords(args.base_id, args.table_name, { where: args.where, sort: args.sort, fields: args.fields, limit: args.limit, offset: args.offset, viewId: args.view_id, }); return { records: result.list, pageInfo: result.pageInfo, count: result.list.length, }; },
  • The input schema for the 'list_records' tool, defining required base_id and table_name, and optional filtering, sorting, pagination parameters.
    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", }, where: { type: "string", description: 'Filter condition (e.g., "(status,eq,active)")', }, sort: { type: "string", description: 'Sort fields (prefix with - for descending, e.g., "-created_at")', }, fields: { type: "string", description: "Comma-separated list of fields to return", }, limit: { type: "number", description: "Number of records to return (default: 25)", }, offset: { type: "number", description: "Number of records to skip", }, view_id: { type: "string", description: "View ID to use for filtering", }, }, required: ["base_id", "table_name"], },
  • src/index.ts:55-62 (registration)
    Registration of the recordTools (including list_records) by spreading into the allTools array used for MCP server tool listing and execution.
    const allTools = [ ...databaseTools, ...tableTools, ...recordTools, ...viewTools, ...queryTools, ...attachmentTools, ];

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/andrewlwn77/nocodb-mcp'

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