search_records
Locate records containing specified text within a resource URI. Define search terms, specific fields, and limit results for targeted record retrieval.
Instructions
Search for records containing specific text
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fields | No | Specific fields to search in. If not provided, searches all text fields. | |
| maxRecords | No | Maximum number of records to return. Defaults to 100. | |
| resourceUri | Yes | URI of the resource | |
| searchTerm | Yes | Text to search for in records |
Implementation Reference
- src/core/MCPServer.ts:190-203 (handler)Handler logic for the 'search_records' tool. Validates input arguments using SearchRecordsArgsSchema and delegates the search query to the dataService.queryResource method with searchTerm, fields, and maxRecords parameters.case 'search_records': { return await safeExecute(toolName, async () => { const args = validateInput(SearchRecordsArgsSchema, request.params.arguments); const records = await this.dataService.queryResource( args.resourceUri, { searchTerm: args.searchTerm, fields: args.fields, maxRecords: args.maxRecords, } ); return records; }); }
- src/types/index.ts:98-103 (schema)Zod schema defining the input arguments for the search_records tool: resourceUri (required), searchTerm (required), fields (optional array), maxRecords (optional number).export const SearchRecordsArgsSchema = z.object({ resourceUri: z.string().describe('URI of the resource'), searchTerm: z.string().describe('Text to search for in records'), fields: z.array(z.string()).optional().describe('Specific fields to search in. If not provided, searches all text fields.'), maxRecords: z.number().optional().describe('Maximum number of records to return. Defaults to 100.'), });
- src/core/MCPServer.ts:139-142 (registration)Tool registration entry in the handleListTools method, specifying the name, description, and input schema for 'search_records'.name: 'search_records', description: 'Search for records containing specific text', inputSchema: getInputSchema(SearchRecordsArgsSchema), },