-
Notifications
You must be signed in to change notification settings - Fork 20
updated tool naming as per suggestion #125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,17 +4,19 @@ | |
| from typing import Any, Dict, List | ||
| from fastmcp import FastMCP | ||
| from tools import ( | ||
| search_assets, | ||
| get_assets_by_dsl, | ||
| traverse_lineage, | ||
| update_assets, | ||
| create_glossary_category_assets, | ||
| create_glossary_assets, | ||
| create_glossary_term_assets, | ||
| UpdatableAttribute, | ||
| CertificateStatus, | ||
| UpdatableAsset, | ||
| ) | ||
| from tools.glossary import ( | ||
| create_glossary_category_assets as create_glossary_category_assets_impl, | ||
| create_glossary_assets as create_glossary_assets_impl, | ||
| create_glossary_term_assets as create_glossary_term_assets_impl, | ||
| ) | ||
|
||
| from tools.search import search_assets as search_assets_impl | ||
SatabrataPaul-GitAc marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| from tools.dsl import get_assets_by_dsl as get_assets_by_dsl_impl | ||
|
||
| from tools.lineage import traverse_lineage as traverse_lineage_impl | ||
| from tools.assets import update_assets as update_assets_impl | ||
| from pyatlan.model.lineage import LineageDirection | ||
| from utils.parameters import ( | ||
| parse_json_parameter, | ||
|
|
@@ -40,7 +42,7 @@ | |
|
|
||
|
|
||
| @mcp.tool() | ||
| def search_assets_tool( | ||
| def search_assets( | ||
| conditions=None, | ||
| negative_conditions=None, | ||
| some_conditions=None, | ||
|
|
@@ -242,7 +244,7 @@ def search_assets_tool( | |
| domain_guids = parse_list_parameter(domain_guids) | ||
| guids = parse_list_parameter(guids) | ||
|
|
||
| return search_assets( | ||
| return search_assets_impl( | ||
| conditions, | ||
| negative_conditions, | ||
| some_conditions, | ||
|
|
@@ -266,7 +268,7 @@ def search_assets_tool( | |
|
|
||
|
|
||
| @mcp.tool() | ||
| def get_assets_by_dsl_tool(dsl_query): | ||
| def get_assets_by_dsl(dsl_query): | ||
| """ | ||
| Execute the search with the given query | ||
| dsl_query : Union[str, Dict[str, Any]] (required): | ||
|
|
@@ -334,11 +336,11 @@ def get_assets_by_dsl_tool(dsl_query): | |
| }''' | ||
| response = get_assets_by_dsl(dsl_query) | ||
| """ | ||
| return get_assets_by_dsl(dsl_query) | ||
| return get_assets_by_dsl_impl(dsl_query) | ||
|
|
||
|
|
||
| @mcp.tool() | ||
| def traverse_lineage_tool( | ||
| def traverse_lineage( | ||
| guid, | ||
| direction, | ||
| depth=1000000, | ||
|
|
@@ -374,7 +376,7 @@ def traverse_lineage_tool( | |
|
|
||
| Examples: | ||
| # Get lineage with default attributes | ||
| lineage = traverse_lineage_tool( | ||
| lineage = traverse_lineage( | ||
| guid="asset-guid-here", | ||
| direction="DOWNSTREAM", | ||
| depth=1000, | ||
|
|
@@ -391,7 +393,7 @@ def traverse_lineage_tool( | |
| # Parse include_attributes parameter if provided | ||
| parsed_include_attributes = parse_list_parameter(include_attributes) | ||
|
|
||
| return traverse_lineage( | ||
| return traverse_lineage_impl( | ||
| guid=guid, | ||
| direction=direction_enum, | ||
| depth=int(depth), | ||
|
|
@@ -402,7 +404,7 @@ def traverse_lineage_tool( | |
|
|
||
|
|
||
| @mcp.tool() | ||
| def update_assets_tool( | ||
| def update_assets( | ||
| assets, | ||
| attribute_name, | ||
| attribute_values, | ||
|
|
@@ -426,7 +428,7 @@ def update_assets_tool( | |
|
|
||
| Examples: | ||
| # Update certificate status for a single asset | ||
| result = update_assets_tool( | ||
| result = update_assets( | ||
| assets={ | ||
| "guid": "asset-guid-here", | ||
| "name": "Asset Name", | ||
|
|
@@ -438,7 +440,7 @@ def update_assets_tool( | |
| ) | ||
|
|
||
| # Update user description for multiple assets | ||
| result = update_assets_tool( | ||
| result = update_assets( | ||
| assets=[ | ||
| { | ||
| "guid": "asset-guid-1", | ||
|
|
@@ -460,7 +462,7 @@ def update_assets_tool( | |
| ) | ||
|
|
||
| # Update readme for a single asset with Markdown | ||
| result = update_assets_tool( | ||
| result = update_assets( | ||
| assets={ | ||
| "guid": "asset-guid-here", | ||
| "name": "Asset Name", | ||
|
|
@@ -496,7 +498,7 @@ def update_assets_tool( | |
| else: | ||
| updatable_assets = [UpdatableAsset(**asset) for asset in parsed_assets] | ||
|
|
||
| return update_assets( | ||
| return update_assets_impl( | ||
| updatable_assets=updatable_assets, | ||
| attribute_name=attr_enum, | ||
| attribute_values=parsed_attribute_values, | ||
|
|
@@ -557,7 +559,7 @@ def create_glossaries(glossaries) -> List[Dict[str, Any]]: | |
| except json.JSONDecodeError as e: | ||
| return {"error": f"Invalid JSON format for glossaries parameter: {str(e)}"} | ||
|
|
||
| return create_glossary_assets(glossaries) | ||
| return create_glossary_assets_impl(glossaries) | ||
|
|
||
|
|
||
| @mcp.tool() | ||
|
|
@@ -622,7 +624,7 @@ def create_glossary_terms(terms) -> List[Dict[str, Any]]: | |
| except json.JSONDecodeError as e: | ||
| return {"error": f"Invalid JSON format for terms parameter: {str(e)}"} | ||
|
|
||
| return create_glossary_term_assets(terms) | ||
| return create_glossary_term_assets_impl(terms) | ||
|
|
||
|
|
||
| @mcp.tool() | ||
|
|
@@ -691,7 +693,7 @@ def create_glossary_categories(categories) -> List[Dict[str, Any]]: | |
| except json.JSONDecodeError as e: | ||
| return {"error": f"Invalid JSON format for categories parameter: {str(e)}"} | ||
|
|
||
| return create_glossary_category_assets(categories) | ||
| return create_glossary_category_assets_impl(categories) | ||
|
|
||
|
|
||
| def main(): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
responded there.