Skip to main content
Glama
jupiterbak

AYX-MCP-Wrapper

by jupiterbak

download_workflow_package_file

Download workflow package files from Alteryx Server by specifying the workflow ID and output directory for local storage.

Instructions

Download a workflow package file by its ID and save it to the local directory

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workflow_idYes
output_directoryYes

Implementation Reference

  • The core handler function in AYXMCPTools class that downloads the workflow package (.yxzp) from Alteryx server using the V3 API and saves it to the configured temp directory.
    def download_workflow_package_file(self, workflow_id: str):
        """Download a workflow package file by its ID and save it to the local directory"""
        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"
            
            # Create the output directory if it doesn't exist
            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)
            
            # Save the workflow file to the output 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)
    
            return (
                f"Workflow {workflow_id} downloaded successfully. File saved to '{temp_directory}/{workflow_id}.yxzp'"
            )
        except ApiException as e:
            return f"Error: {e.body}"
  • The MCP tool registration using @self.app.tool() decorator, which wraps the underlying tools.py handler and delegates to it. Note: wrapper adds output_directory param not used in handler.
    @self.app.tool()
    def download_workflow_package_file(workflow_id: str, output_directory: str):
        """Download a workflow package file by its ID and save it to the local directory"""
        return self.tools.download_workflow_package_file(workflow_id, output_directory)

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