Skip to main content
Glama
zinin

sketchup-mcp2

by zinin

chamfer_edge

Chamfer all edges of a selected group or component by a specified distance in millimeters.

Instructions

Chamfer all edges of a group/component by distance (mm).

Default 5mm — visible on the documented 100mm-cube use case. Ruby tool name is chamfer_edges (plural); Python parameter id maps to Ruby entity_id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
distanceNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The `chamfer_edge` async function is the MCP tool handler. It is decorated with @mcp.tool(), accepts `id` (str) and `distance` (float, default 5.0) parameters, and delegates to `_call(ctx, 'chamfer_edges', entity_id=id, distance=distance)`. The docstring notes the Ruby tool name is 'chamfer_edges' (plural) and the Python `id` maps to Ruby `entity_id`.
    @mcp.tool()
    async def chamfer_edge(
        ctx: Context,
        id: Annotated[str, Field(min_length=1)],
        distance: Annotated[float, Field(gt=0)] = 5.0,
    ) -> str:
        """Chamfer all edges of a group/component by ``distance`` (mm).
    
        Default 5mm — visible on the documented 100mm-cube use case. Ruby tool name
        is ``chamfer_edges`` (plural); Python parameter ``id`` maps to Ruby ``entity_id``.
        """
        return await _call(ctx, "chamfer_edges", entity_id=id, distance=distance)
  • Input schema is defined inline via type annotations: `id: Annotated[str, Field(min_length=1)]` and `distance: Annotated[float, Field(gt=0)] = 5.0`. Return type is `str`. The `@mcp.tool()` decorator auto-generates the JSON Schema for MCP.
    @mcp.tool()
    async def chamfer_edge(
        ctx: Context,
        id: Annotated[str, Field(min_length=1)],
        distance: Annotated[float, Field(gt=0)] = 5.0,
    ) -> str:
  • Registration is done via the `@mcp.tool()` decorator on the `chamfer_edge` function. The `mcp` FastMCP instance is imported from `sketchup_mcp.app`, and the side-effect import in `app.py` (line 51: `import sketchup_mcp.tools`) ensures tools are registered on the MCP server.
    @mcp.tool()
  • The `_call` helper function centralizes dispatching tool calls to the SketchUp connection. It handles `ConnectionError` and `SketchUpError`, unwraps the response dict, and returns a string. `chamfer_edge` delegates to this with tool_name='chamfer_edges'.
    async def _call(ctx: Context, tool_name: str, /, **kwargs) -> str:
        """Dispatch a tool call to SketchUp and shape the response for Claude.
    
        Same external contract as before — kept for compatibility with the 22
        existing string-returning tools. Now delegates to :func:`_raw_call`
        for connection acquisition and converts the result to a string.
        Connection failures surface as the canonical legacy string so the LLM
        sees a stable, actionable hint.
        """
        try:
            result = await _raw_call(ctx, tool_name, **kwargs)
        except ConnectionError as e:
            return f"SketchUp not running or extension not started: {e}"
        except SketchUpError as e:
            return format_error(e, debug=config.LOG_LEVEL == "DEBUG")
        content = result.get("content") if isinstance(result, dict) else None
        if (
            isinstance(content, list)
            and content
            and isinstance(content[0], dict)
            and "text" in content[0]
        ):
            return content[0]["text"]
        return json.dumps(result)
  • The `_raw_call` helper acquires the connection via `get_connection()` and calls `sketchup.send_command(tool_name, kwargs)`. This is the lowest-level dispatch layer that `_call` delegates to.
    async def _raw_call(ctx: Context, tool_name: str, /, **kwargs) -> dict:
        """Acquire the connection and execute one tools/call.
    
        Returns the raw MCP-shaped result dict
        (``{"content": [...], "isError": False}``).
    
        ``tool_name`` is positional-only (PEP 570) so wrappers can forward
        user kwargs containing a ``name`` key via ``**args`` without
        colliding with this parameter — see ``find_components`` /
        ``create_layer`` callers below for the pattern.
    
        Does **not** translate :class:`ConnectionError` to anything — that
        is each caller's responsibility, since callers have divergent
        strategies for unavailable-server (string-returning tools surface a
        graceful string, Image-returning tools raise). Centralising the
        conversion here would introduce brittle string-based detection in
        callers and lose the canonical error text shared by the 22 existing
        text-returning tools.
    
        See the design's §5.8 for the rationale on error-handling asymmetry
        between text-returning and Image-returning tools.
        """
        sketchup = await get_connection()              # may raise ConnectionError
        return await sketchup.send_command(tool_name, kwargs)  # raises SketchUpError
Behavior2/5

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

No annotations provided; the description only states it modifies geometry but does not disclose whether it is destructive, requires permissions, or has side effects (e.g., undoing). The mapping to Ruby tool name is technical but not behavioral.

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

Conciseness4/5

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

Two sentences, front-loaded with main purpose. Efficient, though the Ruby tool name detail could be omitted or moved.

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 presence of an output schema, the description does not explain return values or error handling. Missing information about behavior on multiple edges or edge cases, making it incomplete for a geometric operation.

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

Parameters3/5

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

With 0% schema description coverage, the description adds some value: explains 'distance' (unit, default, use case) and maps 'id' to Ruby entity_id. However, it does not clarify what 'id' represents (e.g., group/component identifier).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('chamfer'), target ('all edges of a group/component'), and the key parameter ('distance' in mm). It explicitly distinguishes from sibling tools like 'fillet_edge' by using 'chamfer'.

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?

No guidance on when to use this tool versus alternatives like 'fillet_edge' or 'boolean_operation'. Missing context on prerequisites or suitable scenarios.

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

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/zinin/sketchup-mcp2'

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