FindProperties
Search and filter properties in the RushDB database using specific criteria, with options to limit results, skip records, and sort output.
Instructions
Find properties in the database using a search query
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of properties to return | |
| orderBy | No | Sorting configuration: key = field, value = asc|desc | |
| skip | No | Number of properties to skip | |
| where | No | Search conditions for finding properties |
Implementation Reference
- tools/FindProperties.ts:17-33 (handler)The main handler function that executes the tool logic by constructing a search query and fetching properties from the database using db.properties.find().export async function FindProperties(params: { where?: Record<string, any> limit?: number skip?: number orderBy?: Record<string, 'asc' | 'desc'> }) { const { where, limit, skip, orderBy } = params const searchQuery: Record<string, any> = {} if (where) searchQuery.where = where if (limit) searchQuery.limit = limit if (skip) searchQuery.skip = skip if (orderBy && Object.keys(orderBy).length > 0) searchQuery.orderBy = orderBy const result = await db.properties.find(searchQuery) return result.data }
- tools.ts:386-403 (schema)The input schema and metadata for the FindProperties tool as part of the tools registry.{ name: 'FindProperties', description: 'Find properties in the database using a search query', inputSchema: { type: 'object', properties: { where: { type: 'object', description: 'Search conditions for finding properties' }, limit: { type: 'number', description: 'Maximum number of properties to return', default: 10 }, skip: { type: 'number', description: 'Number of properties to skip', default: 0 }, orderBy: { type: 'object', description: 'Sorting configuration: key = field, value = asc|desc', additionalProperties: { type: 'string', enum: ['asc', 'desc'] } } }, required: [] } },
- index.ts:427-442 (registration)The registration and dispatch logic in the MCP CallToolRequest handler that invokes the FindProperties tool.case 'FindProperties': const foundProperties = await FindProperties({ where: args.where as Record<string, any> | undefined, limit: args.limit as number | undefined, skip: args.skip as number | undefined, orderBy: args.orderBy as Record<string, 'asc' | 'desc'> | undefined }) return { content: [ { type: 'text', text: foundProperties.length > 0 ? JSON.stringify(foundProperties, null, 2) : 'No properties found' } ] }