counterpart_propose_filaments
Proposes the nearest loaded AMS spool for each model filament by color and material, then validates chosen spools against the current AMS load before slicing.
Instructions
Counterpart contract (counterpart/1): which loaded AMS spool prints each of a model's colours, before slicing. Reads the live AMS once. trays lists the spools a person may choose (label like "A2", a person-readable name, colour, material, feed). proposal gives each filament its nearest spool in OKLab colour with the asked-for material preferred, and a verdict: same-colour, closest (that colour isn't loaded; note says so), no-colour or none. One print feeds from one source. Pass chosen to check the person's spools against what is loaded now; mapping then lists every filament slot's spool (painted slots included), and problems says why a choice can't print.
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": {
"filaments": "<filaments>"
},
"name": "counterpart_propose_filaments"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | No | Hostname or IP of the printer (default: value from env) | |
| chosen | No | The person's spool for each filament, in the same order: checked against what is loaded now. Omit for the proposal alone. | |
| sliced | No | The file is already sliced: its materials are fixed, so only spools of the same material qualify. | |
| painted | No | Filament slots no part names (painted regions). Each follows the chosen spools' feed; prints false when the selected plate never uses it. | |
| filaments | Yes | The model's filaments a person sees, in project order: 1-based index, part name, the colour it belongs in and its material when known. | |
| bambu_model | No | Printer model; defaults to BAMBU_MODEL. Selects the filament profiles that decide which spools can slice. | |
| bambu_token | No | Access token (default: value from env); never returned. | |
| bambu_serial | No | Serial number (default: value from env) | |
| nozzle_diameter | No | Nozzle diameter (default NOZZLE_DIAMETER or 0.4). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| trays | Yes | ||
| mapping | No | ||
| contract | Yes | ||
| problems | Yes | ||
| proposal | Yes |