MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / ifc_edit

Method ifc_edit

src/ifcmcp/ifcmcp/core.py:337–357  ·  view source on GitHub ↗

Execute an ifcopenshell.api mutation. params may be: - JSON string - dict (from tool calling / JS) - JsProxy (handled upstream in embedded.py)

(self, function_path: str, params: Any = "{}")

Source from the content-addressed store, hash-verified

335 return function_docs(module, function)
336
337 def ifc_edit(self, function_path: str, params: Any = "{}") -> dict:
338 """Execute an ifcopenshell.api mutation.
339
340 params may be:
341 - JSON string
342 - dict (from tool calling / JS)
343 - JsProxy (handled upstream in embedded.py)
344 """
345 model = self._require_model()
346 module, function = function_path.split(".", 1)
347
348 if isinstance(params, str):
349 raw_kwargs = json.loads(params) if params.strip() else {}
350 elif isinstance(params, dict):
351 raw_kwargs = params
352 else:
353 # e.g. list/None/etc
354 raw_kwargs = dict(params) if params is not None else {}
355
356 res = run_api(model, module, function, raw_kwargs)
357 return _jsonify(res)
358
359 # ------------------------
360 # Extended query + edit tools

Callers 9

ifc_editFunction · 0.80
test_edit_no_modelMethod · 0.80
test_create_entityMethod · 0.80
test_unknown_functionMethod · 0.80
test_bad_jsonMethod · 0.80
test_assign_containerMethod · 0.80

Calls 4

_require_modelMethod · 0.95
run_apiFunction · 0.90
_jsonifyFunction · 0.85
splitMethod · 0.80

Tested by 8

test_edit_no_modelMethod · 0.64
test_create_entityMethod · 0.64
test_unknown_functionMethod · 0.64
test_bad_jsonMethod · 0.64
test_assign_containerMethod · 0.64