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'
          }
        ]
      }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states it 'retrieves' records, implying a read-only operation, but doesn't cover critical aspects like authentication needs, rate limits, error handling, pagination, or what happens if some IDs are invalid. For a tool with no annotation coverage, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function with zero wasted words. It's appropriately sized for a simple retrieval tool and front-loads the core purpose immediately.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (retrieving multiple records by ID), lack of annotations, and no output schema, the description is incomplete. It doesn't explain return values, error conditions, or behavioral constraints, which are essential for an agent to use this tool effectively in a broader context with many sibling tools.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the parameter 'recordIds' clearly documented in the schema as 'Array of record IDs to retrieve'. The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline for high schema coverage without adding value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('records by their IDs'), making the purpose immediately understandable. It distinguishes from siblings like 'GetRecord' (singular) and 'FindRecords' (search-based). However, it doesn't specify what type of records or from which system, leaving some ambiguity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'GetRecord' (for single records) or 'FindRecords' (for query-based retrieval). It doesn't mention prerequisites, limitations, or typical use cases, leaving the agent to infer usage from the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/rush-db/RushDB'

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