Skip to content

Conversation

@Hk669
Copy link
Collaborator

@Hk669 Hk669 commented Nov 7, 2025

This pull request adds support for creating Data Domains, Sub Domains, and Data Products in Atlan via a new unified tool and supporting backend logic. The changes introduce new models, backend asset creation logic, and expose the new functionality through the server and tool initialization files.

New functionality for domain-related asset creation:

  • Added new tool create_domains to the server, allowing creation of Data Domains, Sub Domains, and Data Products with a unified interface that auto-detects the type based on the input fields. The tool includes comprehensive documentation and examples.
  • Registered the backend function create_domain_assets in the tool initialization and server, making it available for use. [1] [2] [3]

Backend implementation and models:

  • Implemented modelcontextprotocol/tools/domain.py, which provides functions to create Data Domains, Sub Domains, and Data Products, including input parsing, model instantiation, and bulk asset saving with logging and error handling.
  • Added new Pydantic models (DataDomainSpec, DataSubDomainSpec, DataProductSpec) to validate and structure payloads for the new asset types.

@Hk669 Hk669 requested a review from firecast as a code owner November 7, 2025 19:02
)
else:
logger.debug(f"Creating DataDomain: {spec.name}")
domain = DataDomain.creator(name=spec.name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we just pass None if it doesn't exist and remove this if condition?


domain.user_description = spec.user_description

if spec.certificate_status:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

assets: List[DataProduct] = []
for spec in specs:
# Validate that asset_guids is provided and not empty
if not spec.asset_guids:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets add these validations as part of the DataProductSpec pydantic model

logger.debug(f"Linking {len(spec.asset_guids)} asset(s) to product")

# Build FluentSearch to select assets by their GUIDs
asset_selection = (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the complete asset list to create the data product?

)
product.user_description = spec.user_description

if spec.certificate_status:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as DataDomain

return save_assets(assets)


def create_domain_assets(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just create 2 different tools?

logger.error(f"Error saving assets: {e}")
raise

created_assets = response.mutated_entities.CREATE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets also return updated assets. If we are making this function lets use it elsewhere as well where we are directly saving



@mcp.tool()
def create_domains(items) -> List[Dict[str, Any]]:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets create 2 tools, one for domains and one for products

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants