Skip to main content
Glama
zinin

sketchup-mcp2

by zinin

list_components

List groups and component instances in a SketchUp model, returning their IDs, names, types, layers, depths, and bounding boxes. Optionally recurse into nested components with a configurable maximum depth.

Instructions

List groups and component instances in the model.

Returns each as {id, name, type, layer, depth, bbox_mm}. Bounds are in world coordinates. Set recursive=true to descend into nested components (bounded by max_depth, default 3).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
recursiveNo
max_depthNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'list_components' tool. It is registered via @mcp.tool() decorator, accepts optional recursive (bool) and max_depth (int, 1-10) parameters, and delegates to _call() which sends the command to the SketchUp Ruby backend.
    @mcp.tool()
    async def list_components(
        ctx: Context,
        recursive: bool = False,
        max_depth: Annotated[int, Field(ge=1, le=10)] = 3,
    ) -> str:
        """List groups and component instances in the model.
    
        Returns each as {id, name, type, layer, depth, bbox_mm}. Bounds are in
        world coordinates. Set recursive=true to descend into nested components
        (bounded by max_depth, default 3).
        """
        return await _call(ctx, "list_components", recursive=recursive, max_depth=max_depth)
  • Input schema/parameters for list_components: recursive (bool, default False) and max_depth (int, ge=1 le=10, default 3).
    recursive: bool = False,
    max_depth: Annotated[int, Field(ge=1, le=10)] = 3,
  • The tool is registered via the @mcp.tool() decorator on the list_components function. The 'mcp' FastMCP instance is imported from sketchup_mcp.app (line 15), and tools.py is imported as a side-effect in app.py (line 51) to ensure registration happens on startup.
    @mcp.tool()
  • The _call() helper function that list_components delegates to. It acquires the connection, sends the command, and formats the response as a string.
    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)
  • list_components is listed in _RETRY_SAFE_TOOLS (read-only whitelist), so connection retries are allowed for this tool.
    "list_components",
Behavior4/5

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

With no annotations, the description carries full burden. It discloses that bounds are in world coordinates and that recursive descend is bounded by max_depth. It does not mention side effects, but as a list operation, it is likely read-only. Adequate transparency.

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?

Two sentences: first covers purpose and output format, second covers parameter behavior. Front-loaded and no verbose or redundant information.

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

Completeness5/5

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

Given the presence of output schema and the straightforward nature of the tool, the description covers all essential aspects: what it does, what it returns (with world coordinate context), and how parameters work. No notable gaps.

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

Parameters5/5

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

Schema descriptions are absent (0% coverage), but the description fully explains both parameters: recursive triggers nested traversal and max_depth limits depth with defaults and bounds, adding all necessary semantics.

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 tool lists groups and component instances, specifies the return format (id, name, type, layer, depth, bbox_mm), and distinguishes from siblings like find_components and get_component_info by focusing on listing all top-level or nested components.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It provides explicit guidance on when to use recursive and max_depth parameters, but does not directly compare with siblings like find_components for when to use listing vs searching. However, the context is clear enough for an agent to decide.

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