MCP feedback for agents: feature summary, warnings, check, solid_box, print tools - #162
Merged
Merged
Conversation
… print tools Script runs now answer in feature terms: a summary of bodies and holes, warnings for mistakes that raise no error (a hole position left out of positions, overlapping holes, holes off the body, blind depths deeper than the body, unused bindings), and failing selectors that list their candidates or the values actually present. New cad_interface actions summary and check compare an expected feature table with the built model. solid_box builds a block as ordinary editable history in one call. A new host-neutral print crate and four read-only tools read scanned plate prints: outline calibration, millimetre crops with a grid and hole overlay returned as MCP image content, ring scores at model holes, and hole-symbol coverage.
# Conflicts: # Cargo.toml
jeffglousher
approved these changes
Sep 25, 2026
jeffglousher
left a comment
Collaborator
There was a problem hiding this comment.
MCP agent feedback is coherent and on-style: script summaries/warnings, summary/check actions, solid_box as editable history (single trace), and read-only print tools with image content. Host-neutral print crate + MCP/script tests look solid. Approving while MCP acceptance/packages finish (core crates + frontend green).
jeffglousher
added a commit
that referenced
this pull request
Sep 25, 2026
Resolve mcp-server/src/lib.rs keeping both #162's feature summary/check/solid_box pieces and export_script. List export_script and its from selector in the cad_interface schema, repair the spliced tool description, restore the displaced seed_script_baseline_from_model doc comment, drop integration-note HTML comments from docs, and apply cargo fmt.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Agents driving the MCP server got very little back from a script run: a step count, or a one-line error, and a raw scene when they asked. Everything they needed for verification (holes with positions, counts per class, an overlay on the print) had to be rebuilt outside the engine, and the mistakes that cost the most never raised an error at all. This PR moves that feedback into the host.
Script runs answer in feature terms
cad_interfacescriptresults now carry:summary: bodies with bounding boxes and face counts, the hole count and a tally by class (diameter, style, counterbore, thread, through or depth);detail: "full"lists every hole with position, normal, depth, face and thread. Holes come from the feature history; an imported STEP has none, so its cylinders are read back from the geometry (hole_source: "scene").warningsfor the silent mistakes:hole_position_ignored(apositionslist that leaves outposition, so that point is never drilled),holes_overlap,hole_outside_body,blind_depth_exceeds_body,unused_binding.Failing steps are more useful: a selector that matched several entries lists the candidates with the fields that tell them apart; one that matched nothing lists what each
wheretest asked for and the values actually present at those pointers; an unknown result name lists similar earlier names.Expected versus built
Two new
cad_interfaceactions read the current document the same way:summaryreturns the feature summary, andcheckcompares an expected feature table (bbox,holeswithx,y, optionalz,diameter,counterbore_diameter,through,depth) with the built model withintolerance_mm, reporting matched holes with offsets, missing holes with the nearest built one, and extras.solid_boxA rectangular block from an origin corner and a size, as ordinary editable history: an offset construction plane when the origin is off the XY plane, a dimensioned rectangle fixed at its corner, one extrude (
new_body,join,cut,intersect). The script trace records the one call, not its parts. It is a generic primitive; part-specific generators stay in plugins.Reading scanned prints as a host service
New crate
crates/print(host-neutral,pngonly; PDF pages render throughpdftoppm) and four read-only tools:print_calibrate(plate outline by aspect ratio and line weight, skew-aware corners),print_crop(a millimetre window with a tick grid and the document's holes drawn on it, returned as MCP image content),print_probe(what is drawn at or near each model hole: symbol with centre and offset, dot, dashed, none) andprint_symbols(drawn circles and dots matched against the model).holesdefaults to the current document;frame: "bbox_min"shifts them to the bodies' lower-left corner.Tool results that carry a picture now include an
imagecontent block next to the text.Tests and docs
Script-crate tests for the diagnostics; MCP tests for the summary, warnings, check,
solid_box(offset plane, cut, single trace entry) and the print tools on a synthetic sheet (no real drawings in the repository); print-crate tests on synthetic images. README section "Feedback for agents"; crate index; interface catalog groupssolid/primitivesandprint/read.