Skip to main content
Glama
neka-nat
by neka-nat

get_objects

Retrieve all objects from a specified FreeCAD document to review or modify. Returns a list of objects and a document screenshot.

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

  • MCP tool handler implementation for 'get_objects'. Retrieves all objects from the specified FreeCAD document via RPC proxy, serializes to JSON, and optionally includes a screenshot.
    @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 FreeCADConnection class that forwards the get_objects call 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 FreeCAD document and serializes all its objects using serialize_object.
    def get_objects(self, doc_name):
        doc = FreeCAD.getDocument(doc_name)
        if doc:
            return [serialize_object(obj) for obj in doc.Objects]
        else:
            return []
  • FastMCP decorator that registers the get_objects function as an MCP tool, inferring schema from signature and docstring.
    @mcp.tool()
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 mentions returning 'a list of objects' and 'a screenshot,' which adds some context beyond basic functionality. However, it doesn't address critical behavioral aspects such as whether this is a read-only operation (implied but not stated), potential rate limits, error conditions, or how the screenshot is formatted. For a tool with no annotations, this leaves significant gaps in understanding its behavior.

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 structured with a purpose statement, usage hint, and sections for Args and Returns, which is organized. However, it includes redundant phrasing ('You can use this tool...') and could be more front-loaded by stating the return value earlier. The sentences are clear but not maximally efficient, with some room for trimming without losing information.

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

Completeness4/5

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

Given the tool's low complexity (1 parameter, no nested objects) and the presence of an output schema (which likely details the return structure), the description is reasonably complete. It covers the purpose, parameter meaning, and return types (list and screenshot). However, without annotations, it could benefit from more behavioral details, but the output schema reduces the need to fully explain return values, making it adequate for the context.

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': 'The name of the document to get the objects from.' This clarifies the parameter's role beyond what the schema provides (which has 0% description coverage and only states 'Doc Name' as a title). Since there's only one parameter and the description explains it adequately, this compensates well for the low schema coverage.

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: 'Get all objects in a document.' It specifies the verb ('Get') and resource ('objects in a document'), making it understandable. However, it doesn't explicitly distinguish this from sibling tools like 'get_object' (singular) or 'get_parts_list', which could cause confusion about when to use each.

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 some implied usage guidance: 'to see what you can check or edit.' This suggests a use case for inventorying objects before editing. However, it lacks explicit guidance on when to use this tool versus alternatives like 'get_object' (for a single object) or 'get_parts_list' (which might overlap in functionality). No clear exclusions or prerequisites are stated.

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

Related 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/neka-nat/freecad-mcp'

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