get_view
Capture a screenshot of the active view in FreeCAD by specifying the desired orientation, such as Isometric, Front, Top, or other predefined views. Ideal for documenting or analyzing 3D designs.
Instructions
Get a screenshot of the active view.
Args:
view_name: The name of the view to get the screenshot of.
The following views are available:
- "Isometric"
- "Front"
- "Top"
- "Right"
- "Back"
- "Left"
- "Bottom"
- "Dimetric"
- "Trimetric"
Returns:
A screenshot of the active view.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| view_name | Yes |
Implementation Reference
- src/freecad_mcp/server.py:438-465 (handler)The main handler function for the 'get_view' MCP tool. It is decorated with @mcp.tool(), which handles both the schema (input/output types and docstring) and registration. The function connects to FreeCAD, sets the view, captures a screenshot, and returns it as ImageContent or an error message.@mcp.tool() def get_view(ctx: Context, view_name: Literal["Isometric", "Front", "Top", "Right", "Back", "Left", "Bottom", "Dimetric", "Trimetric"]) -> list[ImageContent | TextContent]: """Get a screenshot of the active view. Args: view_name: The name of the view to get the screenshot of. The following views are available: - "Isometric" - "Front" - "Top" - "Right" - "Back" - "Left" - "Bottom" - "Dimetric" - "Trimetric" Returns: A screenshot of the active view. """ freecad = get_freecad_connection() screenshot = freecad.get_active_screenshot(view_name) if screenshot is not None: return [ImageContent(type="image", data=screenshot, mimeType="image/png")] else: return [TextContent(type="text", text="Cannot get screenshot in the current view type (such as TechDraw or Spreadsheet)")]