Skip to main content
Glama

FindRelationships

Discover and analyze connections between data points in RushDB's graph database to understand complex relationships and dependencies.

Instructions

Find relationships in the database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
whereNoSearch conditions for finding relationships
limitNoMaximum number of relationships to return
skipNoNumber of relationships to skip
orderByNoSorting configuration: key = field, value = asc|desc

Implementation Reference

  • The core handler function that implements the FindRelationships tool, querying the database for relationships based on provided filters.
    export async function FindRelationships(params: {
      where?: Record<string, any>
      limit?: number
      skip?: number
      orderBy?: Record<string, 'asc' | 'desc'>
    }) {
      const { where, limit = 10, skip = 0, orderBy } = params
    
      const searchQuery: any = { limit, skip }
      if (where) searchQuery.where = where
      if (orderBy && Object.keys(orderBy).length > 0) searchQuery.orderBy = orderBy
    
      const result = await db.relationships.find(searchQuery)
      if (result.success && result.data) return result.data
      return []
    }
  • Defines the input schema, description, and metadata for the FindRelationships tool used in tool listing.
    {
      name: 'FindRelationships',
      description: 'Find relationships in the database',
      inputSchema: {
        type: 'object',
        properties: {
          where: { type: 'object', description: 'Search conditions for finding relationships' },
          limit: { type: 'number', description: 'Maximum number of relationships to return', default: 10 },
          skip: { type: 'number', description: 'Number of relationships to skip', default: 0 },
          orderBy: {
            type: 'object',
            description: 'Sorting configuration: key = field, value = asc|desc',
            additionalProperties: { type: 'string', enum: ['asc', 'desc'] }
          }
        },
        required: []
      }
    },
  • index.ts:257-271 (registration)
    Registers the FindRelationships tool in the MCP server's CallToolRequestSchema handler by dispatching to the handler function.
    case 'FindRelationships':
      const relations = await FindRelationships({
        where: args.where as Record<string, any> | undefined,
        limit: args.limit as number | undefined,
        skip: args.skip as number | undefined,
        orderBy: args.orderBy as Record<string, 'asc' | 'desc'> | undefined
      })
      return {
        content: [
          {
            type: 'text',
            text: relations.length > 0 ? JSON.stringify(relations, null, 2) : 'No relations found'
          }
        ]
      }
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. 'Find relationships' implies a read-only search operation, but the description doesn't mention permissions needed, pagination behavior (beyond what's in schema), rate limits, or what the output looks like. It's minimally informative for a tool with 4 parameters.

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

Conciseness4/5

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

The description is extremely concise at just 4 words, but this comes at the cost of being under-specified rather than efficiently informative. It's front-loaded but lacks necessary detail.

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?

For a tool with 4 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what relationships are, what format results return, or how this differs from other find/search tools in the server. The context signals indicate complexity that the description doesn't address.

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 fully documents all 4 parameters (where, limit, skip, orderBy). The description adds no parameter information beyond what's already in the schema, meeting the baseline for high schema coverage.

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

Purpose2/5

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

The description 'Find relationships in the database' is a tautology that merely restates the tool name 'FindRelationships' without adding specificity. It doesn't explain what kind of relationships, what database, or how this differs from sibling tools like FindRecords or FindOneRecord.

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

Usage Guidelines1/5

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

No guidance is provided about when to use this tool versus alternatives. With many sibling tools for data operations (FindRecords, FindOneRecord, GetRecordsByIds, etc.), the description offers no context about when relationships should be searched versus other record types or query methods.

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