Skip to main content
Glama

GetRecordsByIds

Retrieve multiple database records using their unique identifiers. This tool fetches specific records from RushDB by providing an array of record IDs.

Instructions

Get multiple records by their IDs

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
recordIdsYesArray of record IDs to retrieve

Implementation Reference

  • The core handler function that validates input and retrieves multiple records by their IDs from the database using db.records.findById.
    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) } }
  • The JSON schema definition for the tool's input parameters, used for tool listing and validation in MCP.
    { 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'] } },
  • index.ts:443-452 (registration)
    The switch case in the MCP CallToolRequestHandler that registers and invokes the GetRecordsByIds handler, formatting the 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