Skip to main content
Glama

create_component

Generate and insert a 3D component in SketchUp by specifying dimensions, position, and type. Integrates with Claude AI via SketchupMCP for precise, prompt-driven modeling tasks.

Instructions

Create a new component in Sketchup

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dimensionsNo
positionNo
typeNocube

Implementation Reference

  • The handler function for the 'create_component' tool. It is registered via the @mcp.tool() decorator. The function proxies the tool call to SketchUp's own 'create_component' tool by sending a JSON-RPC request over a socket connection.
    @mcp.tool()
    def create_component(
        ctx: Context,
        type: str = "cube",
        position: List[float] = None,
        dimensions: List[float] = None
    ) -> str:
        """Create a new component in Sketchup"""
        try:
            logger.info(f"create_component called with type={type}, position={position}, dimensions={dimensions}, request_id={ctx.request_id}")
            
            sketchup = get_sketchup_connection()
            
            params = {
                "name": "create_component",
                "arguments": {
                    "type": type,
                    "position": position or [0,0,0],
                    "dimensions": dimensions or [1,1,1]
                }
            }
            
            logger.info(f"Calling send_command with method='tools/call', params={params}, request_id={ctx.request_id}")
            
            result = sketchup.send_command(
                method="tools/call",
                params=params,
                request_id=ctx.request_id
            )
            
            logger.info(f"create_component result: {result}")
            return json.dumps(result)
        except Exception as e:
            logger.error(f"Error in create_component: {str(e)}")
            return f"Error creating component: {str(e)}"

Tool Definition Quality

Score is being calculated. Check back soon.

Install Server

Other Tools

Related 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/BearNetwork-BRNKC/SketchUp-MCP'

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