generate_fsharp_script
Convert a Word document into an F# script that rebuilds an equivalent file via dotnet fsi. Use it to inspect structure or extend with styles, tables, images, headers/footers, comments, and more.
Instructions
Reads an existing Word document and returns a self-contained F# script (using Kookerella.FsWordDsl) that rebuilds an equivalent file when run via dotnet fsi. Useful for explaining how a file is structured, or as a starting point for a caller who wants the library's full feature set (named styles, tables, images, headers/footers, comments, track changes, content controls, etc.) beyond what create_document exposes.
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": {
"path": "<path>",
"outputFileName": "<outputFileName>"
},
"name": "generate_fsharp_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path to an existing .docx/.docm file to reverse-engineer into F# source. | |
| outputFileName | Yes | The output filename the generated script should save its rebuilt file to, e.g. "output.docx". |