Skip to main content
Glama
mhyrr
by mhyrr

eval_ruby

Evaluate Ruby code directly within Sketchup using the MCP server, enabling prompt-assisted 3D modeling and scene manipulation through script execution.

Instructions

Evaluate arbitrary Ruby code in Sketchup

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'eval_ruby' tool. It proxies the Ruby code to the SketchUp extension via a JSON-RPC socket connection and returns the formatted result.
    @mcp.tool()
    def eval_ruby(
        ctx: Context,
        code: str
    ) -> str:
        """Evaluate arbitrary Ruby code in Sketchup"""
        try:
            logger.info(f"eval_ruby called with code length: {len(code)}")
            
            sketchup = get_sketchup_connection()
            
            result = sketchup.send_command(
                method="tools/call",
                params={
                    "name": "eval_ruby",
                    "arguments": {
                        "code": code
                    }
                },
                request_id=ctx.request_id
            )
            
            logger.info(f"eval_ruby result: {result}")
            
            # Format the response to include the result
            response = {
                "success": True,
                "result": result.get("content", [{"text": "Success"}])[0].get("text", "Success") if isinstance(result.get("content"), list) and len(result.get("content", [])) > 0 else "Success"
            }
            
            return json.dumps(response)
        except Exception as e:
            logger.error(f"Error in eval_ruby: {str(e)}")
            return json.dumps({
                "success": False,
                "error": str(e)
            })
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool evaluates Ruby code but doesn't describe safety implications (e.g., potential for destructive operations, security risks, or performance impacts), execution context (e.g., sandboxed or full access), or error handling. This is inadequate for a tool that executes arbitrary code.

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 with no wasted words. It's front-loaded with the core purpose and appropriately sized for the tool's complexity, making it easy to parse quickly.

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 tool's high complexity (executing arbitrary code) and lack of annotations, the description is insufficient. It doesn't address critical aspects like safety, permissions, or output format, even though an output schema exists. This leaves significant gaps for an agent to understand how to use the tool 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 schema description coverage is 0%, so the description must compensate. It mentions 'Ruby code' but doesn't elaborate on the parameter 'code' beyond that, such as expected syntax, examples, or constraints. This adds minimal value over the schema, which only indicates a required string parameter named 'code'.

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 tool's purpose: 'Evaluate arbitrary Ruby code in Sketchup'. It specifies the action ('evaluate') and the resource ('Ruby code'), and indicates the context ('in Sketchup'). However, it doesn't differentiate from siblings like 'create_component' or 'export_scene', which are more specific operations rather than general code execution.

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, limitations, or scenarios where other tools might be more appropriate, such as using 'create_component' for specific modeling tasks instead of writing custom Ruby code. This leaves the agent with minimal context for decision-making.

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