Skip to main content
Glama

FindOneRecord

Locate a specific record in RushDB's graph database by applying 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

  • Core handler function that executes the FindOneRecord tool: queries the database for a single record matching the provided labels and where conditions.
    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
    }
  • tools.ts:336-346 (registration)
    Tool registration entry in the tools array, providing name, description, and input schema for MCP server.listTools().
      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: []
      }
    },
  • Input schema definition for validating FindOneRecord tool parameters.
      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: []
      }
    },
  • MCP CallToolRequest dispatcher case that invokes the FindOneRecord handler and formats the response content.
    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.'
          }
        ]
      }
  • index.ts:72-76 (registration)
    Registers the listTools capability, returning the tools array which includes FindOneRecord.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools
      }
    })
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states it finds 'a single record' but doesn't clarify what happens if multiple records match (e.g., returns first, errors, or requires unique criteria). It also omits details like permissions needed, rate limits, or response format, which are critical for a search tool with no output schema.

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 with zero waste. It's front-loaded with the core purpose and avoids unnecessary elaboration, making it easy to parse quickly.

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 of a search tool with no annotations and no output schema, the description is incomplete. It doesn't explain the return value, error conditions, or behavioral nuances (e.g., handling of multiple matches). For a tool with 2 parameters and nested objects, more context is needed to ensure reliable use.

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%, so the schema already documents both parameters (labels and where). The description mentions 'search criteria' which aligns with the schema but adds no additional meaning about parameter usage, constraints, or examples. Baseline 3 is appropriate when the schema handles parameter documentation adequately.

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 tool's purpose: 'Find a single record that matches the given search criteria.' It specifies the verb ('Find') and resource ('record'), and distinguishes it from bulk operations like FindRecords. However, it doesn't explicitly differentiate from FindUniqRecord, which appears to be a similar sibling tool.

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. It doesn't mention when to choose FindOneRecord over FindRecords (for multiple records), FindUniqRecord (for unique records), or GetRecord (by ID). There's no context about prerequisites, error handling, or typical use cases.

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