Skip to main content
Glama

get_workflow_tool_list

Retrieve a list of tools within a specific workflow using its ID. This function enables efficient workflow analysis and management by providing detailed insight into tool composition.

Instructions

Get the list of tools in a workflow by the workflow ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workflow_idYes

Implementation Reference

  • Main handler implementation in AYXMCPTools class: Downloads workflow package (.yxzp), extracts it, parses the main .yxmd/.yxwz XML file using xmltodict, extracts Node elements as tools, cleans UI properties, and returns a pprint-formatted dictionary of tool configurations keyed by ToolID.
    def get_workflow_tool_list(self, workflow_id: str): """Get the list of the workflow tools and the tool properties by the workflow ID""" try: api_response = self.workflows_api.workflows_get_workflow(workflow_id) if api_response is None: return "Error: Workflow not found" # Download the workflow file api_response = self.workflows_api.workflows_download_workflow(workflow_id) if api_response is None: return "Error: Failed to download workflow" temp_directory = self.configuration.temp_directory # normalize the temp directory temp_directory = os.path.normpath(temp_directory) if not os.path.exists(temp_directory): os.makedirs(temp_directory) with open( f"{temp_directory}/{workflow_id}.yxzp", "wb" if not os.path.exists(f"{temp_directory}/{workflow_id}.yxzp") else "wb+", ) as f: f.write(api_response) new_directory = f"{temp_directory}/{workflow_id}" if os.path.exists(new_directory): shutil.rmtree(new_directory) os.makedirs(new_directory) with zipfile.ZipFile(f"{temp_directory}/{workflow_id}.yxzp", "r") as zip_ref: zip_ref.extractall(new_directory) yxmd_files = [file for file in os.listdir(new_directory) if file.endswith(".yxmd") or file.endswith(".yxwz")] if len(yxmd_files) == 0: return "Error: Workflow XML file not found after unzipping" yxmd_file = yxmd_files[0] # Read as binary first, then decode as UTF-8 with open(f"{new_directory}/{yxmd_file}", "rb") as f: binary_content = f.read() try: # Try to decode as UTF-8 xml_content = binary_content.decode('utf-8') except UnicodeDecodeError: # If UTF-8 fails, return the binary content as a string representation xml_content = binary_content # Parse the XML content using xmltodict xml_dict = xmltodict.parse(xml_content) # extract the tools list tools_list = xml_dict['AlteryxDocument']['Nodes']['Node'] # if tools_list is a list, then we need to iterate through it tools_dict = {} if isinstance(tools_list, list): for tool in tools_list: tool_id = tool['@ToolID'] tool_type = tool['GuiSettings']['@Plugin'] tool_dict = tool['Properties']['Configuration'] # Add the tool type to the tool dictionary tool_dict['ToolType'] = tool_type # Remove all properties BG_Image, Font, TextColor, FillColor, Justification, TextSize tool_dict.pop('BG_Image', None) tool_dict.pop('Font', None) tool_dict.pop('TextColor', None) tool_dict.pop('FillColor', None) tool_dict.pop('Justification', None) tool_dict.pop('TextSize', None) # Remove the data encoded in the tool tool_dict.pop('Data', None) tools_dict[tool_id] = tool_dict else: tool_id = tools_list['@ToolID'] tool_type = tools_list['GuiSettings']['@Plugin'] tool_dict = tools_list['Properties']['Configuration'] # Add the tool type to the tool dictionary tool_dict['ToolType'] = tool_type # Remove all properties BG_Image, Font, TextColor, FillColor, Justification, TextSize tool_dict.pop('BG_Image', None) tool_dict.pop('Font', None) tool_dict.pop('TextColor', None) tool_dict.pop('FillColor', None) tool_dict.pop('Justification', None) tool_dict.pop('TextSize', None) # Remove the data encoded in the tool tool_dict.pop('Data', None) # Add the tool dictionary to the tools dictionary tools_dict[tool_id] = tool_dict return pprint.pformat(tools_dict) except Exception as e: return f"Error: {str(e)}"
  • MCP tool registration via FastMCP @app.tool() decorator on a thin wrapper function that delegates execution to AYXMCPTools.get_workflow_tool_list(workflow_id). The function signature and docstring auto-generate the tool schema.
    @self.app.tool() def get_workflow_tool_list(workflow_id: str): """Get the list of tools in a workflow by the workflow ID""" return self.tools.get_workflow_tool_list(workflow_id)

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/jupiterbak/AYX-MCP-Wrapper'

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