FindProperties
Search and retrieve property data from RushDB's graph database using customizable filters, sorting, and pagination for efficient data access.
Instructions
Find properties in the database using a search query
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| where | No | Search conditions for finding properties | |
| limit | No | Maximum number of properties to return | |
| skip | No | Number of properties to skip | |
| orderBy | No | Sorting configuration: key = field, value = asc|desc |
Implementation Reference
- tools/FindProperties.ts:17-33 (handler)The core handler function that executes the tool logic: queries the database for properties using where, limit, skip, and orderBy parameters.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-402 (schema)Input schema and metadata for the FindProperties tool, defining parameters where, limit, skip, orderBy.{ 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)Tool registration in the main MCP server request handler: switch case that invokes FindProperties and formats the response.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' } ] }
- index.ts:72-75 (registration)Registers the list of all tools (including FindProperties schema) for MCP ListTools requests.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }