Skip to main content
Glama
informatics-isi-edu

Deriva MCP Server

Official

reorder_visible_foreign_keys

Reorder related tables in a context's visible foreign key list by index or exact key references, with changes staged until apply_annotations().

Instructions

Reorder foreign keys in the visible-foreign-keys list for a specific context.

This is a convenience tool for reordering related tables without manually reconstructing the list. Changes are staged until apply_annotations() is called.

Args: table_name: Name of the table. context: The context to modify (e.g., "detailed", "*"). new_order: The new order specification. Can be: - List of indices: [2, 0, 1] reorders by current positions - List of foreign key refs: [["schema", "fkey1"], ...] specifies exact order

Returns: JSON with the reordered foreign key list for the context.

Examples: # Reorder by indices (move item at index 2 to front) reorder_visible_foreign_keys("Subject", "detailed", [2, 0, 1])

# Reorder by specifying exact foreign key order
reorder_visible_foreign_keys("Subject", "detailed", [
    ["domain", "Diagnosis_Subject_fkey"],
    ["domain", "Image_Subject_fkey"]
])

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contextYes
new_orderYes
table_nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations, the description carries full responsibility and does so well. It discloses that changes are staged until apply_annotations() is called, describes both input formats (indices or explicit foreign key refs), and states the return value. This is rich behavioral detail for a reordering 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 well-structured with Args, Returns, and Examples sections. Every sentence adds value, there is no redundancy, and the formatting makes it easy to scan and understand.

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

Completeness5/5

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

Given the tool's complexity (two order formats, staging behavior, context-specific action), the description covers all essential aspects: purpose, parameters, return type, and workflow integration with apply_annotations(). The presence of an output schema means return details need not be verbose, so completeness is high.

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

Parameters5/5

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

Schema description coverage is 0%, but the description fully documents all three parameters. It defines table_name, provides examples for context, and explains new_order in detail with two acceptable formats and illustrative examples, completely compensating for the schema gap.

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?

The description clearly states the tool reorders foreign keys in the visible-foreign-keys list for a specific context. This distinct action is immediately distinguishable from sibling tools like set_visible_foreign_keys, add_visible_foreign_key, and reorder_visible_columns.

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

Usage Guidelines4/5

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

It positions itself as a convenience tool that avoids manually reconstructing the list, which gives clear context for when to use it. The mention of staging until apply_annotations() is called further clarifies the workflow, though it does not explicitly contrast with alternatives like set_visible_foreign_keys.

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/informatics-isi-edu/deriva-mcp'

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