Skip to main content
Glama

FindOneRecord

Locate a specific record in RushDB's graph database using search criteria and label filters to retrieve matching data.

Instructions

Find a single record that matches the given search criteria

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
labelsNoFilter by record labels
whereNoSearch conditions for finding the record

Implementation Reference

  • The core handler function implementing the tool logic: queries the database for a single record matching optional labels and where conditions, returns the record data or null.
    export async function FindOneRecord(params: { labels?: string[]; where?: Record<string, any> }) { const { labels, where } = params const result = await db.records.findOne({ ...(labels && { labels }), ...(where && { where }) }) return result?.data || null }
  • Input schema definition for validating tool parameters: optional labels array and where object.
    inputSchema: { type: 'object', properties: { labels: { type: 'array', items: { type: 'string' }, description: 'Filter by record labels' }, where: { type: 'object', description: 'Search conditions for finding the record' } }, required: [] }
  • tools.ts:335-346 (registration)
    Registers the FindOneRecord tool in the exported tools array used by MCP listTools endpoint, including metadata and schema.
    { name: 'FindOneRecord', description: 'Find a single 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 record' } }, required: [] } },
  • index.ts:368-380 (registration)
    Registers the tool call dispatcher in the MCP CallToolRequestSchema handler: invokes FindOneRecord and returns formatted response.
    case 'FindOneRecord': const foundOneRecord = await FindOneRecord({ labels: args.labels as string[] | undefined, where: args.where as Record<string, any> | undefined }) return { content: [ { type: 'text', text: foundOneRecord ? JSON.stringify(foundOneRecord, null, 2) : 'No matching record found.' } ] }

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/1pxone/RushDB'

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