quickbase_search_records
Search for specific text within records in a QuickBase table. Input the table ID, search term, and optional field IDs to locate relevant data efficiently.
Instructions
Search for records containing specific text
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fieldIds | No | Field IDs to search in | |
| searchTerm | Yes | Text to search for | |
| tableId | Yes | Table ID to search |
Implementation Reference
- src/quickbase/client.ts:521-528 (handler)Core handler function that implements record search by building a QuickBase 'where' clause with 'CT' (contains text) operator on specified fieldIds or defaults to fields 6 and 7, then delegates to getRecords method.async searchRecords(tableId: string, searchTerm: string, fieldIds?: number[]): Promise<any[]> { // This is a simple implementation - you might want to enhance based on your search needs const whereClause = fieldIds ? fieldIds.map(fieldId => `{${fieldId}.CT.'${searchTerm}'}`).join('OR') : `{6.CT.'${searchTerm}'}OR{7.CT.'${searchTerm}'}`; // Common text fields return this.getRecords(tableId, { where: whereClause }); }
- src/index.ts:314-330 (registration)MCP server registration and dispatch handler for 'quickbase_search_records' tool, parses arguments and calls QuickBaseClient.searchRecords, formats response as JSON text.case 'quickbase_search_records': if (!args || typeof args !== 'object') { throw new Error('Invalid arguments'); } const searchResults = await this.qbClient.searchRecords( args.tableId as string, args.searchTerm as string, args.fieldIds as number[] ); return { content: [ { type: 'text', text: JSON.stringify(searchResults, null, 2), }, ], };
- src/tools/index.ts:65-69 (schema)Zod schema for validating input parameters of quickbase_search_records tool.const SearchRecordsSchema = z.object({ tableId: z.string().describe('Table ID to search'), searchTerm: z.string().describe('Text to search for'), fieldIds: z.array(z.number()).optional().describe('Field IDs to search in') });
- src/tools/index.ts:352-363 (schema)Tool definition including inputSchema used for MCP tool listing and validation.name: 'quickbase_search_records', description: 'Search for records containing specific text', inputSchema: { type: 'object', properties: { tableId: { type: 'string', description: 'Table ID to search' }, searchTerm: { type: 'string', description: 'Text to search for' }, fieldIds: { type: 'array', items: { type: 'number' }, description: 'Field IDs to search in' } }, required: ['tableId', 'searchTerm'] } },
- src/index.ts:50-52 (registration)MCP server registers all tools including quickbase_search_records via quickbaseTools export from tools/index.ts.this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: quickbaseTools,