FindUniqRecord
Locate a specific database record using search criteria and label filters to retrieve unique data entries from your graph database.
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 main handler function implementing the tool logic: finds a unique record matching the given labels and where conditions using the database API.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)Input schema and metadata definition for the FindUniqRecord tool, used for validation and tool listing.{ 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)Tool dispatch/registration in the MCP server CallToolRequest handler: imports and calls the FindUniqRecord function based on 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.' } ] }