search_records
Find records in an Airtable table by searching a specific field for matching values to retrieve relevant data entries.
Instructions
Search for 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 | |
| field_name | Yes | Name of the field to search in | |
| value | Yes | Value to search for |
Implementation Reference
- src/index.ts:580-598 (handler)Handler function for the 'search_records' tool. Extracts parameters, makes an Airtable API GET request with a filterByFormula to match the specified field value, and returns the matching records as JSON.case "search_records": { const { base_id, table_name, field_name, value } = request.params.arguments as { base_id: string; table_name: string; field_name: string; value: string; }; const response = await this.axiosInstance.get(`/${base_id}/${table_name}`, { params: { filterByFormula: `{${field_name}} = "${value}"`, }, }); return { content: [{ type: "text", text: JSON.stringify(response.data.records, null, 2), }], }; }
- src/index.ts:346-370 (registration)Registration of the 'search_records' tool in the ListTools response, including its name, description, and input schema definition.name: "search_records", description: "Search for 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", }, field_name: { type: "string", description: "Name of the field to search in", }, value: { type: "string", description: "Value to search for", }, }, required: ["base_id", "table_name", "field_name", "value"], }, },
- src/index.ts:348-370 (schema)Input schema definition for the 'search_records' tool, specifying required parameters: base_id, table_name, field_name, value.inputSchema: { type: "object", properties: { base_id: { type: "string", description: "ID of the base", }, table_name: { type: "string", description: "Name of the table", }, field_name: { type: "string", description: "Name of the field to search in", }, value: { type: "string", description: "Value to search for", }, }, required: ["base_id", "table_name", "field_name", "value"], }, },