rhinomcp 0.1.3.2__py3-none-any.whl → 0.1.3.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- rhinomcp/tools/get_object_info.py +21 -6
- rhinomcp/tools/get_selected_objects_info.py +7 -3
- {rhinomcp-0.1.3.2.dist-info → rhinomcp-0.1.3.3.dist-info}/METADATA +1 -1
- {rhinomcp-0.1.3.2.dist-info → rhinomcp-0.1.3.3.dist-info}/RECORD +7 -7
- {rhinomcp-0.1.3.2.dist-info → rhinomcp-0.1.3.3.dist-info}/WHEEL +0 -0
- {rhinomcp-0.1.3.2.dist-info → rhinomcp-0.1.3.3.dist-info}/entry_points.txt +0 -0
- {rhinomcp-0.1.3.2.dist-info → rhinomcp-0.1.3.3.dist-info}/top_level.txt +0 -0
@@ -1,13 +1,28 @@
|
|
1
1
|
from mcp.server.fastmcp import Context
|
2
2
|
import json
|
3
3
|
from rhinomcp import get_rhino_connection, mcp, logger
|
4
|
+
from typing import Dict, Any
|
4
5
|
|
5
6
|
@mcp.tool()
|
6
|
-
def get_object_info(ctx: Context, id: str = None, name: str = None) -> str:
|
7
|
+
def get_object_info(ctx: Context, id: str = None, name: str = None) -> Dict[str, Any]:
|
7
8
|
"""
|
8
9
|
Get detailed information about a specific object in the Rhino document.
|
10
|
+
The information contains the object's id, name, type, all custom user attributes and geometry info.
|
9
11
|
You can either provide the id or the object_name of the object to get information about.
|
10
12
|
If both are provided, the id will be used.
|
13
|
+
|
14
|
+
Returns:
|
15
|
+
- A dictionary containing the object's information
|
16
|
+
- The dictionary will have the following keys:
|
17
|
+
- "id": The id of the object
|
18
|
+
- "name": The name of the object
|
19
|
+
- "type": The type of the object
|
20
|
+
- "layer": The layer of the object
|
21
|
+
- "material": The material of the object
|
22
|
+
- "color": The color of the object
|
23
|
+
- "bounding_box": The bounding box of the object
|
24
|
+
- "geometry": The geometry info of the object
|
25
|
+
- "attributes": A dictionary containing all custom user attributes of the object
|
11
26
|
|
12
27
|
Parameters:
|
13
28
|
- id: The id of the object to get information about
|
@@ -15,10 +30,10 @@ def get_object_info(ctx: Context, id: str = None, name: str = None) -> str:
|
|
15
30
|
"""
|
16
31
|
try:
|
17
32
|
rhino = get_rhino_connection()
|
18
|
-
|
19
|
-
|
20
|
-
# Just return the JSON representation of what Rhino sent us
|
21
|
-
return json.dumps(result, indent=2)
|
33
|
+
return rhino.send_command("get_object_info", {"id": id, "name": name})
|
34
|
+
|
22
35
|
except Exception as e:
|
23
36
|
logger.error(f"Error getting object info from Rhino: {str(e)}")
|
24
|
-
return
|
37
|
+
return {
|
38
|
+
"error": str(e)
|
39
|
+
}
|
@@ -3,11 +3,15 @@ import json
|
|
3
3
|
from rhinomcp import get_rhino_connection, mcp, logger
|
4
4
|
|
5
5
|
@mcp.tool()
|
6
|
-
def get_selected_objects_info(ctx: Context) -> str:
|
7
|
-
"""Get detailed information about the currently selected objects in Rhino
|
6
|
+
def get_selected_objects_info(ctx: Context, include_attributes: bool = False) -> str:
|
7
|
+
"""Get detailed information about the currently selected objects in Rhino
|
8
|
+
|
9
|
+
Parameters:
|
10
|
+
- include_attributes: Whether to include the custom user attributes of the objects in the response
|
11
|
+
"""
|
8
12
|
try:
|
9
13
|
rhino = get_rhino_connection()
|
10
|
-
result = rhino.send_command("get_selected_objects_info")
|
14
|
+
result = rhino.send_command("get_selected_objects_info", {"include_attributes": include_attributes})
|
11
15
|
return json.dumps(result, indent=2)
|
12
16
|
except Exception as e:
|
13
17
|
logger.error(f"Error getting selected objects from Rhino: {str(e)}")
|
@@ -9,16 +9,16 @@ rhinomcp/tools/delete_layer.py,sha256=MjvN2-AKHD1dbMIMqfrb3Bevjj63ooWGzqlFpOopju
|
|
9
9
|
rhinomcp/tools/delete_object.py,sha256=-Vz1AZlw0-hPQZ9wNVTpa5sRDJ2qLiDnfjSYKp2wafc,987
|
10
10
|
rhinomcp/tools/execute_rhinoscript_python_code.py,sha256=iHaXptYxGc0YY_oxBn_qwYr3l14ycjirRW96Q78eEPY,1585
|
11
11
|
rhinomcp/tools/get_document_info.py,sha256=poPyqfO0KeV5Au3jks9Q3o6tTZVDfEuCm9BZWCLfpqY,613
|
12
|
-
rhinomcp/tools/get_object_info.py,sha256=
|
12
|
+
rhinomcp/tools/get_object_info.py,sha256=LRVY__C8CA_-Wux9GGRaXHB3W7FHcrQa1DCXAOiZWgg,1564
|
13
13
|
rhinomcp/tools/get_or_set_current_layer.py,sha256=xIvwvrmWXjnxC0WDLEMFxLAUOUjL8LD-8sQ2OYPO-nw,1493
|
14
14
|
rhinomcp/tools/get_rhinoscript_python_code_guide.py,sha256=phS1tCive-lwlWOrE4UW4Ydl1CDuGfqCYU9x6MuQgKY,928
|
15
15
|
rhinomcp/tools/get_rhinoscript_python_function_names.py,sha256=YLDtE8TIFXlMqcUSSpMLshoyB5bxPYiiwcsVY1phsSQ,1360
|
16
|
-
rhinomcp/tools/get_selected_objects_info.py,sha256=
|
16
|
+
rhinomcp/tools/get_selected_objects_info.py,sha256=TG9pUz1NscYOoSUQN-vnl-zuILbjd9GAouJtT9oxUbk,780
|
17
17
|
rhinomcp/tools/modify_object.py,sha256=OVQa75PAmuVx-YslxSC2ITdFbp6cCELVaacI77sJ7Zg,1912
|
18
18
|
rhinomcp/tools/modify_objects.py,sha256=52okeGwV5IQiuBSBH9HcyDCxWbCNF4eA7LoLuhLlgp4,1498
|
19
19
|
rhinomcp/tools/select_objects.py,sha256=J9QjfnD9gdepTCqalBDqOi9nJEX9D3sLPJKImTcJciI,1935
|
20
|
-
rhinomcp-0.1.3.
|
21
|
-
rhinomcp-0.1.3.
|
22
|
-
rhinomcp-0.1.3.
|
23
|
-
rhinomcp-0.1.3.
|
24
|
-
rhinomcp-0.1.3.
|
20
|
+
rhinomcp-0.1.3.3.dist-info/METADATA,sha256=yu5RvHWmT_KjtAlEEfiwSO9_Zb4lZswVFdWlR17GAnY,920
|
21
|
+
rhinomcp-0.1.3.3.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
|
22
|
+
rhinomcp-0.1.3.3.dist-info/entry_points.txt,sha256=OserOidtKWCl-_h3O1c2e9La6wYmJ9rE5F_T5wRLX9w,50
|
23
|
+
rhinomcp-0.1.3.3.dist-info/top_level.txt,sha256=sw73qoWC7GQp5upujkME6pRWc8OxBydEeDwQqu-qv4U,9
|
24
|
+
rhinomcp-0.1.3.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|