Skip to main content
Glama
us-all

openmetadata-mcp-server

by us-all

get-lineage

Retrieve upstream and downstream lineage for a data entity by UUID. Specify entity type and optionally set lineage depth to control the scope.

Instructions

Get upstream and downstream lineage for an entity by UUID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entityYesEntity type
idYesEntity UUID
upstreamDepthNoDepth of upstream lineage (default 1)
downstreamDepthNoDepth of downstream lineage (default 1)

Implementation Reference

  • The handler function for the 'get-lineage' tool. Makes a GET request to /lineage/{entity}/{id} with upstreamDepth and downstreamDepth query parameters.
    export async function getLineage(params: z.infer<typeof getLineageSchema>) {
      const { entity, id, ...query } = params;
      return omClient.get(`/lineage/${entity}/${id}`, query);
    }
  • Zod schema for the 'get-lineage' tool. Defines input params: entity (enum of types like table/topic/dashboard), id (UUID string), upstreamDepth (optional default 1), downstreamDepth (optional default 1).
    export const getLineageSchema = z.object({
      entity: entityTypeEnum,
      id: z.string().describe("Entity UUID"),
      upstreamDepth: z.coerce.number().optional().default(1).describe("Depth of upstream lineage (default 1)"),
      downstreamDepth: z.coerce.number().optional().default(1).describe("Depth of downstream lineage (default 1)"),
    });
  • src/index.ts:203-203 (registration)
    Registration of the 'get-lineage' tool. It is registered in the 'lineage' category using the MCP server.tool() wrapper with schema and handler.
    tool("get-lineage", "Get upstream and downstream lineage for an entity by UUID", getLineageSchema.shape, wrapToolHandler(getLineage));
  • The local 'tool()' helper function that registers each tool with category filtering and wraps the registration via the registry and MCP server.
    function tool(name: string, description: string, schema: any, handler: any): void {
      registry.register(name, description, currentCategory);
      if (registry.isEnabled(currentCategory)) {
        server.tool(name, description, schema, handler);
      }
    }
    
    // --- Search ---
    currentCategory = "search";
    
    tool("search-metadata", "Search OpenMetadata entities (tables, topics, dashboards, pipelines, glossary terms, etc.) by keyword", searchMetadataSchema.shape, wrapToolHandler(searchMetadata));
    tool("suggest-metadata", "Get autocomplete suggestions for OpenMetadata entity names", suggestMetadataSchema.shape, wrapToolHandler(suggestMetadata));
    tool("semantic-search", "Natural-language semantic search over OpenMetadata entities using vector embeddings (requires OM 1.12+ with semantic search enabled)", semanticSearchSchema.shape, wrapToolHandler(semanticSearch));
    
    // --- Tables ---
    currentCategory = "core";
    
    tool("list-tables", "List tables with pagination and optional field expansion", listTablesSchema.shape, wrapToolHandler(listTables));
    tool("get-table", "Get table details by UUID", getTableSchema.shape, wrapToolHandler(getTable));
    tool("get-table-by-name", "Get table details by fully qualified name", getTableByNameSchema.shape, wrapToolHandler(getTableByName));
    tool("create-table", "Create a new table in OpenMetadata", createTableSchema.shape, wrapToolHandler(createTable));
    tool("update-table", "Update a table using JSON Patch operations", updateTableSchema.shape, wrapToolHandler(updateTable));
    tool("delete-table", "Delete a table by UUID", deleteTableSchema.shape, wrapToolHandler(deleteTable));
    
    // --- Databases ---
    
    tool("list-databases", "List databases with pagination and service filtering", listDatabasesSchema.shape, wrapToolHandler(listDatabases));
    tool("get-database", "Get database details by UUID", getDatabaseSchema.shape, wrapToolHandler(getDatabase));
    tool("get-database-by-name", "Get database details by fully qualified name", getDatabaseByNameSchema.shape, wrapToolHandler(getDatabaseByName));
    tool("create-database", "Create a new database in OpenMetadata", createDatabaseSchema.shape, wrapToolHandler(createDatabase));
    tool("update-database", "Update a database using JSON Patch operations", updateDatabaseSchema.shape, wrapToolHandler(updateDatabase));
    tool("delete-database", "Delete a database by UUID", deleteDatabaseSchema.shape, wrapToolHandler(deleteDatabase));
    
    // --- Database Schemas ---
    
    tool("list-schemas", "List database schemas with pagination", listSchemasSchema.shape, wrapToolHandler(listSchemas));
    tool("get-schema", "Get database schema details by UUID", getSchemaSchema.shape, wrapToolHandler(getSchema));
  • src/index.ts:31-34 (registration)
    Import of getLineageSchema and getLineage from src/tools/lineage.ts, which are used in the tool registration.
    import {
      getLineageSchema, getLineage, getLineageByNameSchema, getLineageByName,
      addLineageSchema, addLineage, deleteLineageSchema, deleteLineage,
    } from "./tools/lineage.js";
Behavior2/5

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

No annotations are provided, so the description must fully disclose behavioral traits. While 'Get' implies a read-only operation, there is no mention of potential performance impact, required permissions, or what happens if entities are not found. The description is minimal.

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 a single, front-loaded sentence with no unnecessary words. Every word contributes to the purpose.

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

Completeness3/5

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

For a simple retrieval tool with no output schema and no annotations, the description adequately states the function but lacks details on output format, error handling, or edge cases. It is minimally viable but not fully comprehensive.

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 descriptions already provided for all parameters. The description adds no additional meaning beyond the schema, so a 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?

The description clearly states the verb 'Get', the resource 'lineage', and the scope 'upstream and downstream for an entity by UUID'. It effectively distinguishes from sibling tools like add-lineage, delete-lineage, and get-lineage-by-name.

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 implies usage when you have a UUID and need lineage, but it does not explicitly state when to use alternatives (e.g., get-lineage-by-name if you have a name) or provide any exclusions. No guidance on the depth parameters is given beyond their existence.

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/us-all/openmetadata-mcp-server'

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