set_material
Assign a specific material to a component in Sketchup using the SketchupMCP integration, enabling precise control over 3D model appearances directly through Claude AI.
Instructions
Set material for a component
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"id": "<id>",
"material": "<material>"
},
"name": "set_material"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| material | Yes |
Implementation Reference
- src/sketchup_mcp/server.py:360-382 (handler)The handler function for the 'set_material' MCP tool. It is decorated with @mcp.tool() for registration and forwards the material setting request to the Sketchup extension via JSON-RPC.
@mcp.tool() def set_material( ctx: Context, id: str, material: str ) -> str: """Set material for a component""" try: sketchup = get_sketchup_connection() result = sketchup.send_command( method="tools/call", params={ "name": "set_material", "arguments": { "id": id, "material": material } }, request_id=ctx.request_id ) return json.dumps(result) except Exception as e: return f"Error setting material: {str(e)}"