Skip to main content
Glama

get_parts_list

Retrieve available parts from the FreeCAD parts library to use in 3D designs. This tool provides access to components for building CAD models.

Instructions

Get the list of parts in the parts library addon.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler for 'get_parts_list'. Fetches the parts list through the FreeCADConnection RPC client and formats it as JSON text content, or provides an error message if unavailable.
    @mcp.tool()
    def get_parts_list(ctx: Context) -> list[str]:
        """Get the list of parts in the parts library addon.
        """
        freecad = get_freecad_connection()
        parts = freecad.get_parts_list()
        if parts:
            return [
                TextContent(type="text", text=json.dumps(parts))
            ]
        else:
            return [
                TextContent(type="text", text=f"No parts found in the parts library. You must add parts_library addon.")
            ]
  • Core implementation that scans the 'parts_library' directory in FreeCAD's user app data for all .FCStd files and returns their relative paths. Uses caching for efficiency.
    @cache
    def get_parts_list() -> list[str]:
        parts_lib_path = os.path.join(FreeCAD.getUserAppDataDir(), "Mod", "parts_library")
    
        if not os.path.exists(parts_lib_path):
            raise FileNotFoundError(f"Not found: {parts_lib_path}")
    
        parts = []
    
        for root, _, files in os.walk(parts_lib_path):
            for file in files:
                if file.endswith(".FCStd"):
                    relative_path = os.path.relpath(os.path.join(root, file), parts_lib_path)
                    parts.append(relative_path)
    
        return parts
  • RPC server method in FreeCADRPC class that delegates to the parts_library.get_parts_list() function.
    def get_parts_list(self):
        return get_parts_list()
  • Proxy method in FreeCADConnection class that forwards the call to the XML-RPC server.
    def get_parts_list(self) -> list[str]:
        return self.server.get_parts_list()
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 retrieves a list but doesn't mention any behavioral traits such as read-only nature, potential rate limits, authentication needs, or what happens if no parts exist. This leaves significant gaps for a tool that likely interacts with a library system.

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, clear sentence that directly states the tool's purpose without any wasted words. It's front-loaded and efficiently communicates the essential information, making it easy for an agent to parse quickly.

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

Completeness3/5

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

Given the tool has 0 parameters, an output schema exists (which handles return values), and no annotations, the description is minimally adequate. However, it lacks context about the 'parts library addon' or how this tool fits with siblings, leaving room for improvement in guiding the agent's understanding of the broader system.

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 tool has 0 parameters, and the input schema has 100% description coverage (though empty). The description doesn't need to add parameter details, so it appropriately avoids redundancy. A baseline of 4 is assigned since no parameters exist, and the description doesn't introduce unnecessary complexity.

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 ('Get') and resource ('list of parts in the parts library addon'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_objects' or 'get_object', which might retrieve different types of data, so it misses the highest score for sibling distinction.

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. With siblings like 'get_objects' and 'insert_part_from_library' available, there's no indication of context, prerequisites, or exclusions, leaving the agent to infer usage based on tool names 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

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/heok-yongssun/freecad-mcp'

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