UiPath Documentation
agents
latest
false

Agents user guide

Last updated May 6, 2026

Analyze Files

Analyze Files

The Analyze Files tool allows agents to process and reason over file content using LLMs.

To add the Analyze Files tool to your agent, take the following steps:

  1. Define file inputs. In the Data Manager panel, add an argument for each file input in your agent schema.

    Figure 1. Creating file input arguments

    docs image

    Input argument must be explicitly referenced in the user prompt using the {{exampleInput}} syntax. Input arguments that are not referenced are ignored and may affect the agent’s score.

    • For a single file, set the argument type to File and reference it in the user prompt. For example: "Analyze the following report and summarize the key findings: {{reportFile}}".
    • To pass multiple files, set the argument type to Array and the item type to File, then reference the argument by name in the user prompt. You can also add optional string arguments for runtime instructions. For example:
    Analyze the following report files and summarize the key findings.
    
    ## Inputs
    - Report files: {{reportFiles}}
    - Additional instructions (optional): {{analysisInstructions}}
    Analyze the following report files and summarize the key findings.
    
    ## Inputs
    - Report files: {{reportFiles}}
    - Additional instructions (optional): {{analysisInstructions}}
    

    In this example, reportFiles is an Array of File argument and analysisInstructions is an optional String argument. Both must be defined in the Data Manager panel.

    Working with an array of files

    Example of an agent with file inputs referenced in the prompt

  2. Add the Analyze Files tool to your agent definition:

    1. Select Add tool in the Tools panel.
    2. From the Built-in tools category, choose Analyze Files.
    3. Update the tool name and description to help the agent reason better about when to use it. The name and description guide the agent's planning phase — they determine when the agent decides to call the tool, not what the tool does with the files at runtime.

    Analyze files

  3. Set the tool’s inputs. The tool comes preconfigured with two main inputs:

    • attachments (array): A prompt-defined input that tells the agent which files to pass to the tool. In this field, describe how the agent should use the file inputs referenced in the user prompt (for example, {{reportFiles}}). The agent automatically maps those referenced files to this input at runtime. Example: "Use the files provided in the user prompt (for example, {{reportFiles}}) as inputs for analysis."
    • analysisTask (string): A runtime instruction telling the LLM what to do with the files once the tool is invoked — for example, "Analyze these reports. Extract the report title, an executive summary, key findings ordered by importance, actionable recommendations, and the overall sentiment." This is distinct from the tool name and description, which control when the agent calls the tool. If your use case involves only one file, you can describe attachments accordingly (for example, "Use the file provided in {{reportFile}}…").
  4. Run the agent with input files.

    1. Open the Debug configuration window:
      1. Navigate to the Project arguments tab.
      2. Upload your input files bound to your reportFiles argument.
    2. Select Save and run the debug session.

    Debugging with multiple files

  5. After running the agent, inspect the execution trace via the bottom panel.

The Analyze Files tool is now added to your agent and configured to process file inputs. The execution trace in the Execution Trail panel shows how each attachment was handled during the run.

File attachment traces

When using the Analyze Files tool, all file inputs and outputs are captured in the Execution Trail panel, in the History tab. The trace provides detailed visibility into how attachments were handled during agent execution.

For each file, the trace shows:

  • ID: A unique identifier for the attachment.

  • Name: Original file name (for example, 1.jpg).

  • MIME type: Detected file type (for example, image/jpeg).

    Figure 2. The file analysis in the execution trail

    docs image

Select the tool call from the execution trace and navigate to the Files tab to download the file.

Figure 3. How to download a file from traces

docs image

Best practices and FAQ

Note:

Refer to Working with files for more details on using files from Maestro processes, RPA workflows, or standalone agent runs.

The Analyze Files tool enables agents to process documents and images using LLMs. While powerful, there are some important limitations and behaviors to be aware of when designing file-driven agents.

Large files may exceed token limits

Agents process files by embedding their contents into LLM prompts, which are constrained by the model’s token limit. Large PDFs or scanned image documents may silently fail or return vague errors like "An error occurred", especially when they exceed the model’s token budget.

To mitigate:

  • Use models with higher token capacity.
  • Use Context Grounding instead of full file embedding, especially for large or multi-page files.
  • Pre-index documents and sync them before or during the agent run via custom tools.

LLMs resize images

When image files (for example, .jpg, .png) are sent as part of the LLM prompt, most models automatically resize them. This can distort aspect ratios or lose pixel-precise data.

Avoid prompts that rely on exact coordinates, bounding boxes, or pixel-aligned comparisons (for example, image diffs requiring specific x/y positioning). For more information, refer to OpenAI's image vision guide for model-specific resizing behavior.

Supported file types

The following file extensions are supported: GIF, JPE, JPEG, PDF, PNG, WEBP.

File-type support varies by LLM provider. For example, PDF support may fail on some Anthropic models depending on file name or encoding.

Handling large PDFs

Large PDFs can exceed the LLM's token budget when processed in full. Split the PDF into smaller chunks or individual pages before passing them to the agent.

File limits

Each file must not exceed 30 MB. There is no enforced limit on the number of files per request.

Tips for better results

  • File names must be clean: Anthropic models, in particular, reject file names with special characters or repeated whitespace.
  • Keep image count low: Some models like GPT-4o support a maximum of 10–50 images per request.
  • Analyze Files
  • File attachment traces
  • Best practices and FAQ

Was this page helpful?

Connect

Need help? Support

Want to learn? UiPath Academy

Have questions? UiPath Forum

Stay updated