Skip to main content
Glama
pzfreo

build123d-mcp

interference

Determine if two named objects intersect in 3D space, returning interference status, overlap volume, and bounding region.

Instructions

Check whether two named objects (from show()) intersect. Returns interferes (bool), volume (mm³ of overlap), and bounds of the interference region.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
object_aYes
object_bYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Helper that computes the boolean intersection of two shapes and returns (interferes, volume, bounds).
    def _compute_interference(shape_a: Any, shape_b: Any) -> tuple:
        try:
            inter = shape_a & shape_b
            vol = inter.volume
        except Exception:
            return (False, 0.0, None)
    
        if vol < 1e-6:
            return (False, 0.0, None)
    
        bb = inter.bounding_box()
        return (True, vol, {
            "xmin": bb.min.X, "xmax": bb.max.X,
            "ymin": bb.min.Y, "ymax": bb.max.Y,
            "zmin": bb.min.Z, "zmax": bb.max.Z,
        })
  • Main tool handler: validates object names from session, computes interference via boolean intersection, returns JSON with interferes/volume/bounds.
    def interference(session, object_a: str, object_b: str) -> str:
        for name in (object_a, object_b):
            if not name or name not in session.objects:
                raise ValueError(f"Unknown object '{name}'. Registered: {list(session.objects.keys())}")
    
        shape_a = session.objects[object_a]
        shape_b = session.objects[object_b]
    
        interferes, volume, bounds = _compute_interference(shape_a, shape_b)
    
        if not interferes:
            return json.dumps({"interferes": False, "volume": 0.0}, indent=2)
    
        return json.dumps({
            "interferes": True,
            "volume": volume,
            "bounds": bounds,
        }, indent=2)
  • MCP tool registration: decorates the interference function as a @mcp.tool, delegates to the session's interference method.
    @mcp.tool()
    def interference(object_a: str, object_b: str) -> str:
        """Check whether two named objects (from show()) intersect. Returns interferes (bool), volume (mm³ of overlap), and bounds of the interference region."""
        return _session.interference(object_a, object_b)
  • Session proxy method on the Worker class that delegates the interference call to the worker subprocess via IPC with a 30-second timeout.
    def interference(self, object_a: str, object_b: str) -> str:
        return self._call(
            "interference",
            {"object_a": object_a, "object_b": object_b},
            self._INTERFERENCE_TIMEOUT,
        )
  • Worker dispatch: routes the 'interference' operation to the actual implementation in tools/interference.py.
    if op == "interference":
        from build123d_mcp.tools.interference import interference
        return interference(session, **args)
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided; description reveals return fields but does not disclose behavioral traits like side effects, permissions, or safety. Assumed read-only based on 'check', but not explicit.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence covering purpose, input constraints, and output details. Efficient and front-loaded with no extraneous content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Adequate for a simple check tool with two string parameters and a clear output structure (mentioned in description). Could benefit from noting that objects must exist, but overall sufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema has zero description coverage; description adds that parameters are named objects from show(), which provides crucial context beyond the schema's raw string type.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states the tool checks intersection of two named objects from show(), with specific outputs (bool, volume, bounds). However, it does not explicitly differentiate from sibling tools like shape_compare or measure.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Implies objects must be from show(), providing context, but lacks when-not-to-use or alternatives. No explicit guidance on prerequisites or error conditions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pzfreo/build123d-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server