Skip to main content
Glama
eklemen
by eklemen

get_relationships

List foreign-key relationships with constraint details, cardinality hints, and optional schema/table filters to understand table connections.

Instructions

List foreign-key relationships with constraint names, referenced tables/columns, ON UPDATE/DELETE actions, and a cardinality hint (1:1 when the FK columns are uniquely constrained locally, otherwise many:1). Optionally filter by schema and/or table.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableNoRestrict to foreign keys defined on this table.
schemaNoRestrict to this schema. If omitted, scans all non-system schemas.
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses the cardinality hint logic ('1:1 when FK columns are uniquely constrained locally') and the returned fields. It does not explicitly state read-only nature, but the action of listing relationships is indicative of a safe read operation.

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 two sentences, front-loading the main purpose and returned data in the first sentence, and filtering options in the second. No wasted words.

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

Completeness4/5

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

Given no output schema, the description explicitly lists all returned fields (constraint names, referenced tables/columns, actions, cardinality hint). It mentions optional filters. It does not specify default behavior when no schema filter is applied, though that is covered in the schema description. Overall sufficiently complete for this tool's complexity.

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 clear descriptions for both parameters. The tool description adds a general note about optional filtering but does not provide additional meaning beyond what the schema already conveys. Baseline of 3 is appropriate.

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

Purpose5/5

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

Description starts with a clear verb ('List') and specific resource ('foreign-key relationships'). It enumerates the exact information returned (constraint names, referenced tables/columns, actions, cardinality hint) and distinguishes from sibling tools like 'describe_table' or 'get_indexes' by focusing solely on relationships.

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

Usage Guidelines3/5

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

The description explains what the tool does but does not explicitly state when to use it versus alternatives. It mentions optional filtering by schema/table, implying typical use cases, but lacks direct comparisons to siblings like 'describe_table' or 'get_indexes'.

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/eklemen/db-mcp'

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