> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/stackai-tools/document-processing/parse-files.md).

# Parse Files

Extract text from file URLs and divide it into smaller sections for later processing. Use this tool when another step needs the text of a document, rather than a link to the file.

## Use this tool

1. Provide downloadable addresses in **File URLs**, separated by commas, newlines, or semicolons.
2. Enable **OCR** for scans or images that need text recognition.
3. Choose **Chunking Strategy**, **Chunk Size**, and **Chunk Overlap**. Enable citation references when later answers need to refer to the source.
4. Run the tool and inspect the parsed text. If **Partial Success** is enabled, also inspect **Failed Files**.

## Behavior and limits

With Partial Success disabled, any file failure stops the action. With it enabled, at least one file must succeed and failed downloads or parsing attempts are reported separately. **Store Parsed Text** creates stored JSON files and returns their links in Parsed File URLs. Chunk size and overlap for this tool are measured in characters.

## Inputs

| Field                   | Parameter                 | Description                                                                                                                                                                                                       |
| ----------------------- | ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| File URLs (required)    | `file_urls`               | The URLs of the files to parse, separated by commas, newlines, or semicolons.                                                                                                                                     |
| OCR                     | `ocr`                     | Whether to use OCR for processing images and scanned documents Default: `false`.                                                                                                                                  |
| Chunk Size              | `chunk_size`              | The approximate size of chunks (in characters) that the document will be split into                                                                                                                               |
| Chunk Overlap           | `chunk_overlap`           | Number of characters each chunk shares with the previous one. Overlap keeps context from being split across a boundary.                                                                                           |
| Chunking Strategy       | `chunker_type`            | Chunking strategy: 'sentence' splits on sentence boundaries (better semantic coherence); 'naive' splits on a fixed character window.                                                                              |
| Get citation references | `get_citation_references` | Whether to also produce citation references for the parsed content. When disabled, only the chunked documents and full parsed text are returned. Default: `true`.                                                 |
| Partial Success         | `partial_success`         | If enabled, the action succeeds when at least one file is processed; files that fail to download or parse are reported on the failed\_files output. If disabled, any failure aborts the action. Default: `false`. |
| Store Parsed Text       | `store_parsed_text`       | Store each file’s full parsed text as JSON and return the links in Parsed File URLs. Default: `false`.                                                                                                            |

## Outputs

| Field            | Parameter          | Description                                                                                                                                                                                                            |
| ---------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Documents        | `documents`        | Parsed document sections for use by later processing steps.                                                                                                                                                            |
| Full Parsed Text | `raw_files`        | The full parsed text for each source file.                                                                                                                                                                             |
| Parsed File URLs | `parsed_file_urls` | Links to stored parsed-text JSON files when Store Parsed Text is enabled.                                                                                                                                              |
| Citations        | `citations`        | The extracted citations from all processed files                                                                                                                                                                       |
| Failed Files     | `failed_files`     | Files that could not be processed, with the stage at which they failed: download (URL existed but the fetch failed) or parse (file was downloaded but parsing failed). Only populated when Partial Success is enabled. |

## Related guides

* [Parsing, OCR, and Document Structure](https://docs.stackai.com/technical-reference/files-knowledge-and-retrieval/parsing-ocr-and-document-structure.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stackai.com/stackai-tools/document-processing/parse-files.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
