Skip to main content
Glama
informatics-isi-edu

Deriva MCP Server

Official

add_visible_foreign_key

Add an inbound foreign key to the visible-foreign-keys list for a context, so related tables display on record views. Changes are staged until apply_annotations() is called.

Instructions

Add a foreign key to the visible-foreign-keys list for a specific context.

This is a convenience tool for adding related tables without replacing the entire visible-foreign-keys annotation. Changes are staged until apply_annotations() is called.

Args: table_name: Name of the table. context: The context to modify (typically "detailed" or "*"). foreign_key: Foreign key to add. Can be: - List: inbound foreign key reference (e.g., ["schema", "Other_Table_fkey"]) - Dict: pseudo-column definition for complex relationships position: Position to insert at (0-indexed). If None, appends to end.

Contexts for visible-foreign-keys:

Context

Description

When Used

*

Default for all contexts

Fallback when specific context not set

detailed

Full record view

Related tables shown on single record page

Important: Only INBOUND foreign keys are valid - these are foreign keys from OTHER tables that reference THIS table. Use list_foreign_keys() to see which inbound foreign keys are available.

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

Examples: # Add inbound foreign key to detailed view add_visible_foreign_key("Subject", "detailed", ["domain", "Image_Subject_fkey"])

# Add at specific position
add_visible_foreign_key("Subject", "detailed", ["domain", "Diagnosis_Subject_fkey"], 0)

# Add pseudo-column for complex relationship
add_visible_foreign_key("Subject", "detailed", {
    "source": [{"inbound": ["domain", "Image_Subject_fkey"]}],
    "markdown_name": "Subject Images"
})

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contextYes
positionNo
table_nameYes
foreign_keyYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations provided, the description fully carries the behavioral disclosure burden. It discloses the staging behavior ('Changes are staged until apply_annotations() is called'), the return value (JSON with updated foreign key list), the inbound-only constraint for foreign keys, and the optional position behavior. This gives the agent a clear model of side effects and expectations.

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 efficiently structured: a one-sentence summary, then parameter explanations, a compact context table, a critical constraint note, return description, and concrete examples. Each section earns its place, and the most important operational details (staging, inbound-only) are prominently placed.

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 moderate complexity, zero annotations, and zero schema-level parameter descriptions, the description is exceptionally complete. It covers all parameters, valid values, side effects, return format, and practical examples. The presence of a rich description fully compensates for the lack of structured metadata.

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%, so the description must compensate. It explains every parameter: table_name, context (with a table describing supported contexts), foreign_key (list vs dict forms with examples), and position (0-indexed, None appends). This is far richer than the bare schema and fully disambiguates the flexible foreign_key parameter.

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 opens with a specific verb+resource statement: 'Add a foreign key to the visible-foreign-keys list for a specific context.' It clearly distinguishes this from sibling tools like set_visible_foreign_keys (replace entire annotation) and remove_visible_foreign_key (removal), making the tool's unique role evident.

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

Usage Guidelines5/5

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

The description explicitly frames this as a 'convenience tool' for adding related tables without replacing the entire visible-foreign-keys annotation, contrasting it with set_visible_foreign_keys. It also notes that changes are staged until apply_annotations() is called, and instructs users to use list_foreign_keys() to find valid inbound foreign keys, providing clear when-to-use and how-to-use context.

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