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
| Name | Required | Description | Default |
|---|---|---|---|
| entity | Yes | Entity type | |
| id | Yes | Entity UUID | |
| upstreamDepth | No | Depth of upstream lineage (default 1) | |
| downstreamDepth | No | Depth of downstream lineage (default 1) |
Implementation Reference
- src/tools/lineage.ts:18-21 (handler)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); } - src/tools/lineage.ts:11-16 (schema)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)); - src/index.ts:159-195 (helper)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";