Skip to content

Conversation

christopher-tin-atlan
Copy link
Collaborator

@christopher-tin-atlan christopher-tin-atlan commented Sep 16, 2025

This PR adds comprehensive data domain retrieval capabilities to the Atlan MCP server, enabling AI agents to fetch detailed domain information including hierarchical relationships and stakeholder data within a single API call.

This is a significant improvement over the current asset and lineage tool, as the MCP will provide an optimized alternative.

What's New

  • New MCP Tool: retrieve_domain_tool
  • Retrieve data domains by GUID or qualified name
  • Returns comprehensive domain details with relationship enrichment
  • Supports both parent domains and subdomains with full hierarchy context

Comprehensive Data Return

  • Basic attributes: name, GUID, qualified_name, description, certificate_status
  • Metadata: created_by, updated_by, timestamps, status
  • Domain hierarchy: parent_domain, sub_domains with full details
  • Relationships: stakeholders with enriched information
  • Domain-specific: parent_domain_qualified_name, super_domain_qualified_name

Response Structure

{
  "domain": {
    "guid": "domain-guid-here",
    "name": "Domain Name",
    "qualified_name": "default/domain/domain-name",
    "description": "Domain description",
    "certificate_status": "VERIFIED",
    "created_by": "user.name",
    "sub_domains": [
      {
        "guid": "subdomain-guid",
        "name": "Subdomain Name",
        "qualified_name": "default/domain/domain-name/subdomain",
        // ... full subdomain details
      }
    ],
    "parent_domain": {
      "guid": "parent-guid",
      "name": "Parent Domain",
      // ... full parent details
    },
    "stakeholders": [],
    // ... all other domain attributes
  },
  "error": null
}

- Replace manual attribute mapping with domain.dict() + relationship enrichment
- Eliminate 20+ hardcoded attributes achieving 70% code reduction
- Add PyAtlan nested attribute flattening for clean output structure
- Maintain full relationship enrichment with simplified architecture
- Future-proof: automatically includes new PyAtlan domain attributes
- Update comprehensive docstrings for both function and MCP tool
- Remove unused imports and test code for production readiness
- Improve performance with simplified search setup

This hybrid approach dramatically simplifies domain attribute handling while
maintaining full functionality and eliminating manual maintenance overhead.
@christopher-tin-atlan christopher-tin-atlan changed the title feat: implement hybrid approach for domain retrieval feat: Add Data Domain Retrieval Functionality Sep 16, 2025
Comment on lines +181 to +188
search = FluentSearch()
search = search.where(CompoundQuery.asset_type(DataDomain))

if guid:
logger.debug(f"Searching for domain by GUID: {guid}")
search = search.where(Asset.GUID.eq(guid))
else:
logger.debug(f"Searching for domain by qualified name: {qualified_name}")
Copy link
Collaborator

Choose a reason for hiding this comment

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

instead of a tool, lets add the examples to search_assets_tool

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.

2 participants