Skip to main content
Glama

List Foreign Keys

list_foreign_keys
Read-onlyIdempotent

Retrieve foreign-key constraints with referenced tables, columns, and delete/update rules, optionally filtered by table or JDBC URL, to inspect database relationships.

Instructions

List foreign keys with referenced tables, columns and delete/update rules.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "list_foreign_keys"
  }
}

Input Schema

NameRequiredDescriptionDefault
jdbc_urlNoOptional JDBC URL to target a specific database (credentials embedded in URL); uses environment default when omitted
table_nameNoOptional plain table name; omit to list every foreign key

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.2.1
    • addedInput schema / properties / jdbc_url
      Added value: +{
      +  "description": "Optional JDBC URL to target a specific database (credentials embedded in URL); uses environment default when omitted",
      +  "type": "string"
      +}
  2. First observedv1.0.1

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, so the safety profile is covered without prose. The description adds value by naming what the read returns (referenced tables, columns, referential actions), but it says nothing about how the default database is resolved or what happens when the connection fails.

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?

A single front-loaded sentence with no filler; the returned metadata is listed inline. It is efficient, though the phrasing is dense enough that a little more structure could help scanning.

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?

This is a simple two-optional-parameter read tool with no output schema and full annotation coverage, so the description's statement of what is returned fills the main gap. Nothing critical is missing for correct invocation, though the database-selection behavior could be spelled out.

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%, and both parameters (jdbc_url, table_name) are documented in the schema, including the optional/omit behavior. The description adds no parameter meaning beyond that, so the baseline of 3 applies.

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 states a specific verb and resource ("List foreign keys") and enumerates the returned facets: referenced tables, columns, and delete/update rules. That is enough to distinguish it from the sibling listing tools such as list_indexes or list_tables, though it never names those siblings explicitly.

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?

Usage is only implied: an agent infers it should call this when it wants foreign-key metadata. There is no explicit statement of when to prefer it over list_indexes/describe_table, nor any note about prerequisites such as a reachable database connection.

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