create_dovetail
Create a dovetail joint between two specified components. Control dimensions such as width, height, depth, angle, and number of tails using tail and pin identifiers.
Instructions
Create a dovetail joint between two components. Dimensions in mm.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tail_id | Yes | ||
| pin_id | Yes | ||
| width | No | ||
| height | No | ||
| depth | No | ||
| angle | No | ||
| num_tails | No | ||
| offset_x | No | ||
| offset_y | No | ||
| offset_z | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/sketchup_mcp/tools.py:159-187 (handler)The create_dovetail tool handler function. It is decorated with @mcp.tool() and delegates to _call() with the Ruby command name 'create_dovetail' and all parameters (tail_id, pin_id, width, height, depth, angle, num_tails, offset_x, offset_y, offset_z).
@mcp.tool() async def create_dovetail( ctx: Context, tail_id: Annotated[str, Field(min_length=1)], pin_id: Annotated[str, Field(min_length=1)], width: Annotated[float, Field(gt=0)] = 50.0, height: Annotated[float, Field(gt=0)] = 50.0, depth: Annotated[float, Field(gt=0)] = 15.0, angle: Annotated[float, Field(gt=0)] = 15.0, num_tails: Annotated[int, Field(gt=0)] = 3, offset_x: float = 0.0, offset_y: float = 0.0, offset_z: float = 0.0, ) -> str: """Create a dovetail joint between two components. Dimensions in mm.""" return await _call( ctx, "create_dovetail", tail_id=tail_id, pin_id=pin_id, width=width, height=height, depth=depth, angle=angle, num_tails=num_tails, offset_x=offset_x, offset_y=offset_y, offset_z=offset_z, ) - src/sketchup_mcp/tools.py:160-172 (schema)Input parameter schema for create_dovetail. Parameters include tail_id (str, min_length=1), pin_id (str, min_length=1), width (float>0, default 50.0), height (float>0, default 50.0), depth (float>0, default 15.0), angle (float>0, default 15.0), num_tails (int>0, default 3), offset_x/y/z (float, default 0.0). All dimensions in mm.
async def create_dovetail( ctx: Context, tail_id: Annotated[str, Field(min_length=1)], pin_id: Annotated[str, Field(min_length=1)], width: Annotated[float, Field(gt=0)] = 50.0, height: Annotated[float, Field(gt=0)] = 50.0, depth: Annotated[float, Field(gt=0)] = 15.0, angle: Annotated[float, Field(gt=0)] = 15.0, num_tails: Annotated[int, Field(gt=0)] = 3, offset_x: float = 0.0, offset_y: float = 0.0, offset_z: float = 0.0, ) -> str: - src/sketchup_mcp/tools.py:159-159 (registration)The @mcp.tool() decorator registers create_dovetail as a FastMCP tool. The 'mcp' instance is imported from sketchup_mcp.app (file src/sketchup_mcp/app.py, line 14)
@mcp.tool() - src/sketchup_mcp/tools.py:21-50 (helper)The _call() helper function that all tools delegate to. It acquires a connection via get_connection(), calls send_command(name, kwargs), handles errors, and unwraps the MCP response format.
async def _call(ctx: Context, name: str, **kwargs) -> str: """Dispatch a tool call to SketchUp and shape the response for Claude. - Connection errors → human-readable string, server keeps running. - SketchUpError → ``format_error`` string. - Successful MCP-shaped result ({content: [{text: "..."}]}) → just the text. - Any other dict result → ``json.dumps``. """ try: sketchup = await get_connection() except ConnectionError as e: return f"SketchUp not running or extension not started: {e}" try: result = await sketchup.send_command(name, kwargs) except ConnectionError as e: # Cached connection was stale and reconnect inside send_command failed: # `_connect_or_raise` re-raises OSError as ConnectionError before the # send/recv try-block, so it escapes past the SketchUpError handler. return f"SketchUp not running or extension not started: {e}" except SketchUpError as e: return format_error(e, debug=config.LOG_LEVEL == "DEBUG") content = result.get("content") if isinstance(result, dict) else None if ( isinstance(content, list) and content and isinstance(content[0], dict) and "text" in content[0] ): return content[0]["text"] return json.dumps(result)