Skip to main content
Glama
mhyrr
by mhyrr

transform_component

Adjust the position, rotation, or scale of a 3D component in Sketchup using the MCP server to enable precise model transformations and scene manipulation.

Instructions

Transform a component's position, rotation, or scale

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
positionNo
rotationNo
scaleNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Handler function for the transform_component tool. It connects to SketchUp via socket, prepares arguments for position, rotation, scale, and sends a JSON-RPC request to SketchUp's transform_component tool.
    def transform_component(
        ctx: Context,
        id: str,
        position: List[float] = None,
        rotation: List[float] = None,
        scale: List[float] = None
    ) -> str:
        """Transform a component's position, rotation, or scale"""
        try:
            sketchup = get_sketchup_connection()
            arguments = {"id": id}
            if position is not None:
                arguments["position"] = position
            if rotation is not None:
                arguments["rotation"] = rotation
            if scale is not None:
                arguments["scale"] = scale
                
            result = sketchup.send_command(
                method="tools/call",
                params={
                    "name": "transform_component",
                    "arguments": arguments
                },
                request_id=ctx.request_id
            )
            return json.dumps(result)
        except Exception as e:
            return f"Error transforming component: {str(e)}"
  • The @mcp.tool() decorator registers this function as an MCP tool named 'transform_component' based on the function name.
    def transform_component(
        ctx: Context,
        id: str,
        position: List[float] = None,
        rotation: List[float] = None,
        scale: List[float] = None
    ) -> str:
        """Transform a component's position, rotation, or scale"""
        try:
            sketchup = get_sketchup_connection()
            arguments = {"id": id}
            if position is not None:
                arguments["position"] = position
            if rotation is not None:
                arguments["rotation"] = rotation
            if scale is not None:
                arguments["scale"] = scale
                
            result = sketchup.send_command(
                method="tools/call",
                params={
                    "name": "transform_component",
                    "arguments": arguments
                },
                request_id=ctx.request_id
            )
            return json.dumps(result)
        except Exception as e:
            return f"Error transforming component: {str(e)}"
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool performs a 'transform' operation, implying mutation, but doesn't clarify if this is destructive (e.g., overwrites existing values), requires specific permissions, has side effects, or how it interacts with other tools. The mention of 'position, rotation, or scale' hints at 3D transformations but lacks details on coordinate systems or units.

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

Conciseness5/5

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

The description is a single, efficient sentence that front-loads the core action ('transform a component') and key parameters. There is no wasted text, making it easy to parse quickly. It appropriately sized for conveying the basic purpose without unnecessary elaboration.

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

Completeness2/5

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

Given the complexity of a mutation tool with 4 parameters, 0% schema coverage, and no annotations, the description is incomplete. It lacks crucial details like error conditions, output format (though an output schema exists, the description doesn't reference it), and how transformations affect the component in context with siblings (e.g., 'get_selection'). This leaves significant gaps for an agent to operate effectively.

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

Parameters2/5

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

The input schema has 0% description coverage, so the description must compensate. It lists the parameters ('position, rotation, or scale') but doesn't explain their semantics beyond naming them. For example, it doesn't specify what 'id' refers to, the format of arrays (e.g., 3D vectors), default behaviors when parameters are null, or constraints. This adds minimal value beyond the schema's property titles.

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 action ('transform') and the resource ('a component's position, rotation, or scale'), making the purpose immediately understandable. However, it doesn't explicitly differentiate this tool from potential sibling operations like 'create_component' or 'delete_component', which would require more specific context about what transformation entails versus creation or deletion.

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 doesn't mention prerequisites (e.g., whether the component must exist), exclusions (e.g., cannot transform deleted components), or comparisons to siblings like 'create_component' or 'set_material'. This leaves the agent to infer usage from context alone.

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

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/mhyrr/sketchup-mcp'

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