create_mortise_tenon
Generate precise mortise and tenon joints in Sketchup using predefined parameters for width, height, depth, and offsets, enabling accurate woodworking designs and structural connections.
Instructions
Create a mortise and tenon joint between two components
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| depth | No | ||
| height | No | ||
| mortise_id | Yes | ||
| offset_x | No | ||
| offset_y | No | ||
| offset_z | No | ||
| tenon_id | Yes | ||
| width | No |
Implementation Reference
- src/sketchup_mcp/server.py:406-446 (handler)The @mcp.tool()-decorated handler function that implements the create_mortise_tenon tool. It handles input parameters, logs the call, proxies the command to SketchUp via JSON-RPC, and returns the result or error.@mcp.tool() def create_mortise_tenon( ctx: Context, mortise_id: str, tenon_id: str, width: float = 1.0, height: float = 1.0, depth: float = 1.0, offset_x: float = 0.0, offset_y: float = 0.0, offset_z: float = 0.0 ) -> str: """Create a mortise and tenon joint between two components""" try: logger.info(f"create_mortise_tenon called with mortise_id={mortise_id}, tenon_id={tenon_id}, width={width}, height={height}, depth={depth}, offsets=({offset_x}, {offset_y}, {offset_z})") sketchup = get_sketchup_connection() result = sketchup.send_command( method="tools/call", params={ "name": "create_mortise_tenon", "arguments": { "mortise_id": mortise_id, "tenon_id": tenon_id, "width": width, "height": height, "depth": depth, "offset_x": offset_x, "offset_y": offset_y, "offset_z": offset_z } }, request_id=ctx.request_id ) logger.info(f"create_mortise_tenon result: {result}") return json.dumps(result) except Exception as e: logger.error(f"Error in create_mortise_tenon: {str(e)}") return f"Error creating mortise and tenon joint: {str(e)}"
- src/sketchup_mcp/server.py:406-406 (registration)The @mcp.tool() decorator registers the create_mortise_tenon function as an MCP tool.@mcp.tool()
- src/sketchup_mcp/server.py:407-416 (schema)Function signature defines the input schema with type hints for parameters.def create_mortise_tenon( ctx: Context, mortise_id: str, tenon_id: str, width: float = 1.0, height: float = 1.0, depth: float = 1.0, offset_x: float = 0.0, offset_y: float = 0.0, offset_z: float = 0.0