Skip to content

MCP feedback for agents: feature summary, warnings, check, solid_box, print tools - #162

Merged
jackControls merged 2 commits into
mainfrom
feat/agent-feedback
Sep 25, 2026
Merged

jackControls merged 2 commits into
mainfrom
feat/agent-feedback

Conversation

@jackControls

Copy link
Copy Markdown
Owner

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_interface script results 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").
  • warnings for the silent mistakes: hole_position_ignored (a positions list that leaves out position, 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 where test asked for and the values actually present at those pointers; an unknown result name lists similar earlier names.

Expected versus built

Two new cad_interface actions read the current document the same way: summary returns the feature summary, and check compares an expected feature table (bbox, holes with x, y, optional z, diameter, counterbore_diameter, through, depth) with the built model within tolerance_mm, reporting matched holes with offsets, missing holes with the nearest built one, and extras.

solid_box

A 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, png only; PDF pages render through pdftoppm) 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) and print_symbols (drawn circles and dots matched against the model). holes defaults to the current document; frame: "bbox_min" shifts them to the bodies' lower-left corner.

Tool results that carry a picture now include an image content 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 groups solid/primitives and print/read.

… 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.

@jeffglousher jeffglousher left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@jackControls
jackControls merged commit f8fad83 into main Sep 25, 2026
16 checks passed
@jackControls
jackControls deleted the feat/agent-feedback branch September 25, 2026 14:55
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants