Skip to main content
Glama
informatics-isi-edu

Deriva MCP Server

Official

set_visible_foreign_keys

Control which related tables show in UI views by setting the visible-foreign-keys annotation. Stage changes until apply_annotations().

Instructions

Set the visible-foreign-keys annotation on a table.

Controls which related tables (via inbound foreign keys) appear in different UI contexts and their order. These show as "related tables" sections in the detailed view.

Changes are staged locally until apply_annotations() is called.

Args: table_name: Name of the table. annotation: The visible-foreign-keys annotation value. Set to null/None to remove.

Visible-Foreign-Keys Annotation Schema (tag:isrd.isi.edu,2016:visible-foreign-keys):

{
    "detailed": [...],  // Related tables in detailed view
    "*": [...]          // Default for all contexts
}

Foreign key directive formats (items in the lists):

  1. Inbound foreign key reference (array of [schema, constraint_name]):

    ["schema_name", "fkey_constraint_name"]

    The constraint must be an INBOUND foreign key (i.e., another table references this table).

  2. Pseudo-column for related entities (object):

    {
        "source": [
            {"inbound": ["schema", "fkey_to_this_table"]},
            {"outbound": ["schema", "fkey_to_related"]},
            "column_name"
        ],
        "sourcekey": "predefined_key",    // OR reference to source-definitions
        "markdown_name": "Related Items",
        "comment": "Tooltip text",
        "display": {
            "markdown_pattern": "...",
            "template_engine": "handlebars"
        }
    }

Returns: JSON with status and the table name.

Examples: # Show specific related tables in detailed view set_visible_foreign_keys("Subject", { "detailed": [ ["domain", "Image_Subject_fkey"], ["domain", "Diagnosis_Subject_fkey"] ] })

# Hide all related tables
set_visible_foreign_keys("Subject", {"detailed": []})

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
annotationNo
table_nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses the staging behavior ('Changes are staged locally until apply_annotations() is called'), explains the annotation schema, and specifies that null removes the annotation. It also describes the return value briefly. It does not mention permissions or failure modes, but the core side effect (staging) is disclosed clearly.

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 long but well-structured and front-loaded: a one-sentence summary, followed by Args, schema definition, directive formats, return info, and examples. Every section serves a clear purpose, and the JSON schema blocks are presented as code, making them scannable. No wasted words.

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?

This is a complex tool dealing with a rich annotation format. The description covers the entire visible-foreign-keys schema, both directive formats (inbound reference and pseudo-column), the meaning of contexts ('detailed' and '*'), staging behavior, return value, and multiple examples. There is no output schema provided, but the 'Returns' line gives at least a basic expectation. It is complete enough for an agent to invoke correctly.

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

Parameters4/5

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

The input schema has no descriptions (0% coverage), so the description compensates substantially. It explains 'annotation' with the full visible-foreign-keys schema, including valid directive formats and examples, and explicitly says setting null/None removes the annotation. 'table_name' is only described as 'Name of the table,' but that is sufficient for a simple string parameter. The deep annotation documentation goes well beyond the schema.

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 and resource: 'Set the visible-foreign-keys annotation on a table.' It clearly explains what the tool controls (which related tables appear in UI contexts) and distinguishes it from sibling tools like set_visible_columns or add_visible_foreign_key by focusing on the entire annotation.

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?

The description provides clear context for when the tool is used: it sets the visible-foreign-keys annotation, and importantly notes that 'Changes are staged locally until apply_annotations() is called.' It gives examples for common use cases (showing specific related tables, hiding all, pseudo-column). However, it does not explicitly contrast with granular siblings like add_visible_foreign_key or reorder_visible_foreign_keys, so alternatives are not named.

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