Skip to main content
Glama

get_view

Capture screenshots of 3D CAD designs from specific viewpoints like Isometric, Front, Top, and other orientations for documentation and review purposes.

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
NameRequiredDescriptionDefault
view_nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The primary handler for the 'get_view' tool. It is registered via the @mcp.tool() decorator and implements the logic to retrieve a screenshot from the specified FreeCAD view by calling the helper method.
    @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)")]
  • Supporting helper method in the FreeCADConnection class used by get_view to safely obtain a screenshot, including view compatibility checks.
        def get_active_screenshot(self, view_name: str = "Isometric") -> str | None:
            try:
                # Check if we're in a view that supports screenshots
                result = self.server.execute_code("""
    import FreeCAD
    import FreeCADGui
    
    if FreeCAD.Gui.ActiveDocument and FreeCAD.Gui.ActiveDocument.ActiveView:
        view_type = type(FreeCAD.Gui.ActiveDocument.ActiveView).__name__
        
        # These view types don't support screenshots
        unsupported_views = ['SpreadsheetGui::SheetView', 'DrawingGui::DrawingView', 'TechDrawGui::MDIViewPage']
        
        if view_type in unsupported_views or not hasattr(FreeCAD.Gui.ActiveDocument.ActiveView, 'saveImage'):
            print("Current view does not support screenshots")
            False
        else:
            print(f"Current view supports screenshots: {view_type}")
            True
    else:
        print("No active view")
        False
    """)
    
                # If the view doesn't support screenshots, return None
                if not result.get("success", False) or "Current view does not support screenshots" in result.get("message", ""):
                    logger.info("Screenshot unavailable in current view (likely Spreadsheet or TechDraw view)")
                    return None
    
                # Otherwise, try to get the screenshot
                return self.server.get_active_screenshot(view_name)
            except Exception as e:
                # Log the error but return None instead of raising an exception
                logger.error(f"Error getting screenshot: {e}")
                return None
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('Get a screenshot') and return value, but lacks details on permissions, rate limits, file formats, or error handling. For a tool that likely involves visual output and system interaction, this is a significant gap in transparency.

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

Conciseness4/5

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

The description is well-structured with clear sections for Args and Returns, making it easy to parse. It's front-loaded with the core purpose. However, the list of views is somewhat lengthy and could be more concise, though it's necessary for completeness. Overall, it's efficient with minimal waste.

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

Completeness3/5

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

Given the tool's moderate complexity (single parameter with enum), no annotations, and an output schema (implied by 'Returns'), the description is adequate but incomplete. It covers the parameter well and states the return, but lacks behavioral context like how the screenshot is delivered (e.g., as an image file or data URL). This leaves gaps for an AI agent to use it effectively.

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

Parameters5/5

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

The description adds substantial meaning beyond the input schema. The schema has 0% description coverage, only providing an enum list. The description explains that 'view_name' is 'The name of the view to get the screenshot of' and lists all available views with examples, compensating fully for the schema's lack of context. This is excellent parameter clarification.

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?

The description clearly states the tool's purpose: 'Get a screenshot of the active view.' It specifies the verb ('Get') and resource ('screenshot of the active view'), making the function unambiguous. However, it doesn't differentiate from sibling tools like 'get_object' or 'get_objects', which might also retrieve visual data, so it doesn't reach the highest score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It lists available views but doesn't explain scenarios for choosing one view over another or when to use this tool compared to siblings like 'get_object' for object-specific screenshots. This lack of contextual advice limits its utility for an AI agent.

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/heok-yongssun/freecad-mcp'

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