FindUniqRecord
Locate a specific record in RushDB's graph database using search criteria and label filters to identify unique data entries.
Instructions
Find a unique record that matches the given search criteria
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| labels | No | Filter by record labels | |
| where | No | Search conditions for finding the unique record |
Implementation Reference
- tools/FindUniqRecord.ts:17-26 (handler)The core handler function that performs a unique record lookup using the database client with optional labels and where conditions.export async function FindUniqRecord(params: { labels?: string[]; where?: Record<string, any> }) { const { labels, where } = params const result = await db.records.findUniq({ ...(labels && { labels }), ...(where && { where }) }) return result?.data || null }
- tools.ts:347-358 (schema)Tool schema definition including name, description, and input validation schema for the FindUniqRecord tool.{ name: 'FindUniqRecord', description: 'Find a unique record that matches the given search criteria', inputSchema: { type: 'object', properties: { labels: { type: 'array', items: { type: 'string' }, description: 'Filter by record labels' }, where: { type: 'object', description: 'Search conditions for finding the unique record' } }, required: [] } },
- index.ts:382-394 (registration)Registration and dispatching logic in the MCP server handler that calls the FindUniqRecord tool function based on the tool name.case 'FindUniqRecord': const foundUniqRecord = await FindUniqRecord({ labels: args.labels as string[] | undefined, where: args.where as Record<string, any> | undefined }) return { content: [ { type: 'text', text: foundUniqRecord ? JSON.stringify(foundUniqRecord, null, 2) : 'No unique record found.' } ] }
- index.ts:72-75 (registration)Server registration for listing tools, which includes the FindUniqRecord schema via the imported tools array.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }