Skip to main content
Glama

get_objects

Retrieve all objects from a FreeCAD document to identify available elements for inspection or modification, including a screenshot of the current design.

Instructions

Get all objects in a document. You can use this tool to get the objects in a document to see what you can check or edit.

Args:
    doc_name: The name of the document to get the objects from.

Returns:
    A list of objects in the document and a screenshot of the document.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
doc_nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The primary MCP tool handler for 'get_objects'. Retrieves all objects from the specified FreeCAD document using the RPC proxy, serializes them to JSON, and returns them with an optional screenshot of the current view.
    @mcp.tool()
    def get_objects(ctx: Context, doc_name: str) -> list[dict[str, Any]]:
        """Get all objects in a document.
        You can use this tool to get the objects in a document to see what you can check or edit.
    
        Args:
            doc_name: The name of the document to get the objects from.
    
        Returns:
            A list of objects in the document and a screenshot of the document.
        """
        freecad = get_freecad_connection()
        try:
            screenshot = freecad.get_active_screenshot()
            response = [
                TextContent(type="text", text=json.dumps(freecad.get_objects(doc_name))),
            ]
            return add_screenshot_if_available(response, screenshot)
        except Exception as e:
            logger.error(f"Failed to get objects: {str(e)}")
            return [
                TextContent(type="text", text=f"Failed to get objects: {str(e)}")
            ]
  • Proxy method in the FreeCADConnection class that forwards the get_objects request to the underlying XML-RPC server.
    def get_objects(self, doc_name: str) -> list[dict[str, Any]]:
        return self.server.get_objects(doc_name)
  • Core implementation in the FreeCAD RPC server. Fetches the document by name and returns a list of serialized objects using the serialize_object helper.
    def get_objects(self, doc_name):
        doc = FreeCAD.getDocument(doc_name)
        if doc:
            return [serialize_object(obj) for obj in doc.Objects]
        else:
            return []
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions that the tool returns a list of objects and a screenshot, which adds some context beyond basic functionality. However, it doesn't cover important aspects like whether this is a read-only operation, potential performance impacts, error conditions, or how the screenshot is formatted, leaving significant gaps for a tool that retrieves document data.

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

Conciseness3/5

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

The description is reasonably concise with three sentences, but the second sentence ('You can use this tool...') is somewhat redundant with the first. The structured 'Args' and 'Returns' sections are helpful, but overall it could be more front-loaded and streamlined without losing essential information.

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's moderate complexity (retrieving objects and a screenshot from a document), no annotations, and an output schema present, the description is minimally adequate. It covers the basic purpose and return values, but lacks details on behavioral traits, error handling, or integration with sibling tools, which would enhance completeness for effective agent use.

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 description adds meaningful context for the single parameter 'doc_name' by explaining it's 'The name of the document to get the objects from', which clarifies its purpose beyond the schema's basic title. Since schema description coverage is 0% and there's only one parameter, this adequately compensates, though it doesn't specify format or constraints for the document name.

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 with a specific verb ('Get') and resource ('all objects in a document'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'get_object' (singular) or 'get_parts_list', which would require a more precise distinction.

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

Usage Guidelines3/5

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

The description provides implied usage guidance by stating 'to see what you can check or edit', suggesting this tool is for inspection before editing. However, it lacks explicit guidance on when to use this versus alternatives like 'get_object' (for a single object) or 'get_parts_list', and doesn't mention prerequisites or exclusions.

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