fileforge_file_action
Fetch, parse, and convert files, extract text from documents, and decode or inspect Data URIs. Use it for file and embedded asset processing, not HTML page scraping.
Instructions
Fetch, parse and convert files, extract text, and decode data URIs, including those in a page. Use this for documents and embedded assets, and fileforge_scrape_action for HTML pages. Fetches public URLs without your browser session; private addresses need FILEFORGE_ALLOWED_FETCH_HOSTS. Local paths need the output folders of ~/.fileforge or FILEFORGE_ALLOWED_READ_PATHS. Can write files locally.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Target format: json, csv, tsv or txt. csv and tsv need tabular input. | |
| run | No | Run ID that groups output files. | |
| url | No | Public http(s) URL, or a local path in an allowed folder. | |
| from | No | Source format. Inferred from the URL and content type if omitted. | |
| name | No | Output file name. | converted-data-uri |
| limit | No | Maximum items to return. | |
| store | No | Save the result in ~/.fileforge and return a ref. | |
| tabId | No | Tab ID, or "active" for the active tab. | active |
| action | Yes | What to do. Required parameters are in brackets. convert (url, to): Convert a file to another format. extract_text (url): Extract plain text from a file (PDF, DOCX, etc.). parse_data_uri (dataUri): Parse and decode a Data URI. inspect_data_uri (dataUri): Inspect a Data URI: MIME, encoding, decoded size, preview-safe text, image dimensions, and warnings. decode_data_uri (dataUri): Decode a Data URI into a local artifact and return compact metadata. extract_data_uris_from_page: Find Data URIs embedded in the active page DOM, styles, links, images, media, and scripts. convert_data_uri_image (dataUri): Convert an image Data URI to PNG, JPEG, or WebP using the browser canvas and store it as an artifact. fetch_resource (url): Fetch a resource URL and save it locally. parse_resource (url): Fetch and parse a resource (JSON, CSV, XML, etc.). | |
| format | No | Image format for convert_data_uri_image, or the format to parse as for parse_resource. Inferred if omitted when parsing. | png |
| dataUri | No | Data URI to read. | |
| project | No | Project name that groups stored results. | default |
| quality | No | Image quality for lossy formats. | |
| textPreviewLimit | No | Maximum characters in the text preview. | |
| includeTextPreview | No | Include a preview of the text. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | False if the action failed or a check did not pass. | |
| ref | No | Stored result ID, for fileforge_result_action. | |
| data | No | The result. Its shape depends on the action. | |
| meta | No | Tool, action and context. | |
| error | No | Failure code and message. | |
| warnings | No | Notes about a call that still ran. |