You are not supposed to set the path. This is calculated based on the parent.  Same goes for the level.
Instead you should set the parent id.

So you can do this:

$this-&gt;magObject = Mage::getModel("catalog/category");
$this-&gt;magObject-&gt;setName($item["name"]);
$this-&gt;magObject-&gt;setData("agilityId",$item["id"]);
$this-&gt;magObject-&gt;setIsActive($this-&gt;isActive);
$this-&gt;magObject-&gt;setIsAnchor($this-&gt;isAnchor);
$this-&gt;magObject-&gt;setPageLayout($this-&gt;pageLayout);
$this-&gt;magObject-&gt;setStoreId(Mage::app()-&gt;setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID)); 
$this-&gt;magObject-&gt;setParentId(2);
$this-&gt;magObject-&gt;save();


saving new category programmatically with setPath
Just got a pair of tubular Vittoria Rally road tyres. They look perfect but the problem is that the valve is 42mm which is no good for my new awesome 50mm rims. Above all the valve core is not removable so the extenders I've got with them are useless.

The question is if there's any mean to extend the valves up to 60-80mm in this situation or should I return it back to the shop?

Thank you in advance for your advised.
