Skip to main content
Glama

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
NameRequiredDescriptionDefault
fieldsNoSpecific fields to search in. If not provided, searches all text fields.
maxRecordsNoMaximum number of records to return. Defaults to 100.
resourceUriYesURI of the resource
searchTermYesText to search for in records

Implementation Reference

  • 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; }); }
  • 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.'), });
  • 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), },

Other Tools

Related Tools

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/kbhuw/MCP_TEMPLATE'

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