upload_file_content
Upload a CAD file by writing its content out yourself. Use this only when a direct curl upload to /api/upload is not possible - that route costs you no output at all. If you must use this tool, ALWAYS compress first and pass the output as content: (xz -9e -c model.step 2>/dev/null || gzip -9c model.step) | base64 | tr -d '\n' xz writes about a quarter less than gzip; the command falls back to gzip where xz is missing (macOS). xz, bzip2 and gzip are recognised by themselves - no extra argument.
Do not paste the raw file. You have to write out every character you pass here, and a typical STEP solid takes you three minutes raw against twenty seconds compressed - the user watches that happen. Compression shrinks it about fivefold, which brings files up to roughly 80 KB within reach.
NO SHELL AVAILABLE? Then do not use this tool for anything above about 10 KB - you would have to type the whole file out and the user waits minutes for it. Call create_upload_link instead: the user drops the file in a browser and it is done in five seconds. Same if the file is still too large after compressing. Free.
NEXT STEP - do not generate yet. Ask the user:
Which material? Offer the presets (wood, hardwood, plywood, acrylic, aluminum, steel, brass). If theirs is not among them, pick the closest preset AND set spindle_speed, feed_rate, plunge_rate and step_down yourself from known cutting data for that material and cutter.
Which cutter diameters do they actually own? Recommend one from that list: it must fit the smallest inner radius of the part, and a smaller cutter means longer machining time. If you cannot judge the geometry yet, say so and suggest generating once to see the dimensions.
Is the part cut all the way through? Then recommend holding_tabs so it does not come loose on the last pass.
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": {
"filename": "<filename>",
"content": "<content>"
},
"name": "upload_file_content"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | Output of: (xz -9e -c model.step 2>/dev/null || gzip -9c model.step) | base64 | tr -d '\n' - the compressed file, base64 encoded (xz, bzip2 or gzip, detected by itself). | |
| filename | Yes | File name including extension, e.g. bracket.step |