get_selection
Retrieve currently selected components in Sketchup for prompt-assisted 3D modeling, enabling direct interaction and control through the Model Context Protocol (MCP).
Instructions
Get currently selected components
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/sketchup_mcp/server.py:343-358 (handler)MCP tool handler for 'get_selection'. Proxies the call to SketchUp's get_selection tool and returns the JSON result.@mcp.tool() def get_selection(ctx: Context) -> str: """Get currently selected components""" try: sketchup = get_sketchup_connection() result = sketchup.send_command( method="tools/call", params={ "name": "get_selection", "arguments": {} }, request_id=ctx.request_id ) return json.dumps(result) except Exception as e: return f"Error getting selection: {str(e)}"