Convert Local Workspace File (Opt-In)
convert_fileConvert a local workspace file when explicitly opted in (TWEEKIT_ALLOW_LOCAL_FILES=1).
Disabled by default and over HTTP, strictly confined to TWEEKIT_ALLOWED_DIRS with symlink
rejection (lstat + O_NOFOLLOW), dotfile/credential blocking, and non-overwrite protection.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"file_path": "<file_path>",
"outfmt": "<outfmt>"
},
"name": "convert_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x1 | No | Left crop coordinate in source pixels. | |
| x2 | No | Right crop coordinate in source pixels. | |
| y1 | No | Top crop coordinate in source pixels. | |
| y2 | No | Bottom crop coordinate in source pixels. | |
| page | No | Page number to convert for multi-page inputs. | |
| alpha | No | Preserve alpha transparency when producing raster formats. | |
| inext | No | Override for the input file extension (inferred from file_path when omitted). | |
| width | No | Optional pixel width for the converted output. | |
| height | No | Optional pixel height for the converted output. | |
| outfmt | Yes | Requested output format (e.g., pdf, png, webp, txt). | |
| bgColor | No | Background color (hex RGB) to composite behind transparent pixels. | |
| file_path | Yes | Path within TWEEKIT_ALLOWED_DIRS to the input document or image (requires TWEEKIT_ALLOW_LOCAL_FILES=1 and TWEEKIT_ALLOWED_DIRS). | |
| noRasterize | No | Forward to TweekIT to disable rasterization when supported. | |
| output_path | No | Optional destination path within TWEEKIT_ALLOWED_DIRS (refuses symlinks and existing files unless TWEEKIT_ALLOW_OVERWRITE=1). |