export_scene
Export the current scene from Sketchup in a specified format using the Model Context Protocol, enabling streamlined 3D model sharing and integration.
Instructions
Export the current scene
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "export_scene"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | skp |
Implementation Reference
- src/sketchup_mcp/server.py:384-404 (handler)The handler function decorated with @mcp.tool() that implements the export_scene tool. It connects to Sketchup via socket, sends a JSON-RPC request to call the 'export' tool with the specified format, and returns the JSON result.
@mcp.tool() def export_scene( ctx: Context, format: str = "skp" ) -> str: """Export the current scene""" try: sketchup = get_sketchup_connection() result = sketchup.send_command( method="tools/call", params={ "name": "export", "arguments": { "format": format } }, request_id=ctx.request_id ) return json.dumps(result) except Exception as e: return f"Error exporting scene: {str(e)}"