list_records
Retrieve records from an Airtable table by specifying the base ID and table name, with optional limit on results.
Instructions
List records in a table
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base_id | Yes | ID of the base | |
| table_name | Yes | Name of the table | |
| max_records | No | Maximum number of records to return |
Implementation Reference
- src/index.ts:510-525 (handler)The handler implementation for the 'list_records' tool. It destructures the input arguments, performs a GET request to the Airtable API to list records from the specified table (with optional maxRecords parameter), and returns the records as formatted JSON text content.case "list_records": { const { base_id, table_name, max_records } = request.params.arguments as { base_id: string; table_name: string; max_records?: number; }; const response = await this.axiosInstance.get(`/${base_id}/${table_name}`, { params: max_records ? { maxRecords: max_records } : undefined, }); return { content: [{ type: "text", text: JSON.stringify(response.data.records, null, 2), }], }; }
- src/index.ts:256-273 (schema)The input schema for the 'list_records' tool, defining the expected parameters: required base_id and table_name (strings), optional max_records (number). Used for validation in tool calls.inputSchema: { type: "object", properties: { base_id: { type: "string", description: "ID of the base", }, table_name: { type: "string", description: "Name of the table", }, max_records: { type: "number", description: "Maximum number of records to return", }, }, required: ["base_id", "table_name"], },
- src/index.ts:253-274 (registration)The registration of the 'list_records' tool in the list of available tools returned by ListToolsRequestSchema. Includes name, description, and input schema.{ name: "list_records", description: "List records in a table", inputSchema: { type: "object", properties: { base_id: { type: "string", description: "ID of the base", }, table_name: { type: "string", description: "Name of the table", }, max_records: { type: "number", description: "Maximum number of records to return", }, }, required: ["base_id", "table_name"], }, },