Skip to main content
Glama
jupiterbak

AYX-MCP-Wrapper

by jupiterbak

get_job_output_data

Retrieve output data file paths from completed Alteryx jobs to access and analyze workflow results stored in the server's temporary directory.

Instructions

Get the output data generated by a job. This will return a list of file paths to the output data. The output data is stored in the temp directory of the server.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
job_idYes

Implementation Reference

  • The main handler function that implements the logic for get_job_output_data. It checks if the job exists and is completed, then downloads each output file from the Alteryx API, saves them to the temp directory with appropriate extensions based on available formats, and returns the list of saved file paths.
    def get_job_output_data(self, job_id: str):
        """Get the output data for a job"""
        try:
            # check if job exists
            job = self.jobs_api.jobs_get_job_v3(job_id)
            if not job:
                return "Error: Job not found"
            # check if job is completed
            if job.status != "Completed":
                return "Error: Job is not completed"
            
            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)
            all_output_files = []
    
            for output in job.outputs:
                output_id = output.id
                file_name = output.file_name
                available_output_types = output.available_formats
                # get file name with extension from file_name
                # Extract base name without extension if it exists
                base_name = os.path.splitext(os.path.basename(file_name))[0]
                
                # Get the file extension from the file name
                raw_file_extension = os.path.splitext(os.path.basename(file_name))[1]
    
                # Map output format to file extension
                format_extension_map = {
                    'Raw': raw_file_extension if raw_file_extension else '.txt',
                    'Yxdb': '.yxdb',
                    'Shp': '.shp',
                    'Kml': '.kml',
                    'Tab': '.tab',
                    'Mif': '.mif',
                    'Dbf': '.dbf',
                    'Csv': '.csv',
                    'Pdf': '.pdf',
                    'Docx': '.docx',
                    'Xlsx': '.xlsx',
                    'Html': '.html',
                    'Tde': '.tde',
                    'Zip': '.zip'
                }
    
                # Get the extension for the first available format
                output_format = available_output_types[0] if available_output_types else 'Raw'
                file_extension = format_extension_map.get(output_format, raw_file_extension)
                file_name_with_extension = base_name + file_extension
    
                # get the output data
                api_response = self.jobs_api.jobs_get_output_file(job_id, output_id, output_format)
    
                # Convert to bytes if it's a string
                if isinstance(api_response, str):
                    api_response_bytes = api_response.encode('utf-8')
                else:
                    api_response_bytes = api_response
    
                with open(f"{temp_directory}/{job_id}_{output_id}_{file_name_with_extension}", "wb") as f:
                    f.write(api_response_bytes)
    
                all_output_files.append(f"{temp_directory}/{job_id}_{output_id}_{file_name_with_extension}")
    
            return f"Output files saved to:  {pprint.pformat(all_output_files)} \n\n"
        except ApiException as e:
            return f"Error: {e}"
  • The MCP tool registration using @self.app.tool() decorator. This wrapper function delegates the call to the underlying tools instance's get_job_output_data method.
    @self.app.tool()
    def get_job_output_data(job_id: str):
        """Get the output data generated by a job. This will return a list of file paths to the output data. 
        The output data is stored in the temp directory of the server."""
        return self.tools.get_job_output_data(job_id)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions the output is stored in a temp directory, hinting at ephemeral storage, but fails to disclose critical behaviors like authentication needs, rate limits, error conditions, or whether the job must be in a specific state (e.g., finished). This leaves significant gaps for safe invocation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the core purpose and followed by storage details. It avoids redundancy, but the second sentence could be more integrated or omitted if not critical, slightly reducing efficiency.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and low schema coverage, the description is incomplete. It lacks details on return format (e.g., structure of file paths list), error handling, and operational constraints, making it inadequate for a tool that retrieves job outputs without further context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, with one parameter ('job_id') undocumented in the schema. The description adds no specific meaning about the parameter (e.g., format, source, validation). Since coverage is low, the description doesn't compensate, but with only one parameter, the baseline is adjusted to 3 as the gap is minimal but not addressed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('output data generated by a job'), specifying it returns file paths. However, it doesn't explicitly differentiate from sibling tools like 'get_job_by_id' or 'get_workflow_jobs', which focus on job metadata rather than output data, leaving some ambiguity about uniqueness.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., job must be completed), exclusions, or compare to siblings like 'get_all_job_messages' or 'get_job_by_id', leaving the agent to infer usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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