Skip to main content
Glama

GetRecordsByIds

Retrieve multiple database records simultaneously by specifying their unique IDs. This tool enables efficient batch data access from RushDB's graph database.

Instructions

Get multiple records by their IDs

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
recordIdsYesArray of record IDs to retrieve

Implementation Reference

  • The core handler function implementing the tool logic: validates recordIds array, fetches records using db.records.findById, maps and returns data with count.
    export async function GetRecordsByIds(params: { recordIds: string[] }) { const { recordIds } = params if (!Array.isArray(recordIds) || recordIds.length === 0) { return { success: false, message: 'recordIds must be a non-empty array', data: [] } } const result = await db.records.findById(recordIds) return { success: true, count: result.data.length, data: result.data.map((r: any) => r.data) } }
  • tools.ts:168-182 (registration)
    Registers the GetRecordsByIds tool in the MCP server's tools list, including its description and input schema for validation.
    { name: 'GetRecordsByIds', description: 'Get multiple records by their IDs', inputSchema: { type: 'object', properties: { recordIds: { type: 'array', items: { type: 'string' }, description: 'Array of record IDs to retrieve' } }, required: ['recordIds'] } },
  • Helper code in the main CallToolRequestSchema handler that invokes the GetRecordsByIds function and formats the MCP response.
    case 'GetRecordsByIds': const recordsByIds = await GetRecordsByIds({ recordIds: args.recordIds as string[] }) return { content: [ { type: 'text', text: recordsByIds.count > 0 ? JSON.stringify(recordsByIds.data, null, 2) : 'No records 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