Skip to main content
Glama
pzfreo

build123d-mcp

list_objects

List all named shapes in the current session with volume, face, edge, and vertex counts to audit state without guessing.

Instructions

List all named shapes registered via show(), each with volume (mm³), face, edge, and vertex counts. Call this to audit session state without guessing what show() has been called on.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Core handler that iterates session.objects, collecting name, volume, faces, edges, vertices for each shape, returning JSON.
    def list_objects(session) -> str:
        if not session.objects:
            return "No named objects in session. Use show(shape, name) to register shapes."
        results = []
        for name, shape in session.objects.items():
            try:
                results.append({
                    "name": name,
                    "volume": round(shape.volume, 4),
                    "faces": len(shape.faces()),
                    "edges": len(shape.edges()),
                    "vertices": len(shape.vertices()),
                })
            except Exception as e:
                results.append({"name": name, "error": str(e)})
        return json.dumps(results, indent=2)
  • MCP tool registration of list_objects via @mcp.tool() decorator, calling WorkerSession.list_objects().
    @mcp.tool()
    def list_objects() -> str:
        """List all named shapes registered via show(), each with volume (mm³), face, edge, and vertex counts. Call this to audit session state without guessing what show() has been called on."""
        return _session.list_objects()
  • WorkerSession method that sends a 'list_objects' RPC call to the worker subprocess.
    def list_objects(self) -> str:
        return self._call("list_objects", {}, self._SHORT_TIMEOUT)
  • Worker subprocess dispatch that imports and calls the list_objects handler when op is 'list_objects'.
    if op == "list_objects":
        from build123d_mcp.tools.list_objects import list_objects
        return list_objects(session)
  • Tests confirming output shape: name, volume, faces, edges, vertices fields.
    def test_list_objects_includes_geometry(session):
        execute_code(session, "show(Box(10, 10, 10), 'cube')")
        data = json.loads(list_objects(session))
        cube = next(item for item in data if item["name"] == "cube")
        assert abs(cube["volume"] - 1000) < 0.1
        assert cube["faces"] == 6
Behavior3/5

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

With no annotations, the description carries full burden. It implies read-only behavior (listing), but does not explicitly state it is non-destructive or safe. It could be more transparent about side effects (none).

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, no wasted words. Front-loaded with the core action and output details.

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?

For a simple tool with no parameters and an output schema, the description is complete: it states what is listed, why to use it, and the specific attributes returned.

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

Parameters4/5

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

The schema has no parameters (0), so baseline is 4. The description adds no parameter info, which is appropriate since none exist.

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 it lists named shapes registered via show(), with specific measurements (volume, face/edge/vertex counts). It distinguishes from sibling tools like session_state by emphasizing auditing session state without guessing.

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?

The description explicitly tells when to use ('to audit session state') and implies not to guess what show() has been called on. It doesn't explicitly mention alternatives, but the context is sufficient.

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/pzfreo/build123d-mcp'

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