The sequence behind one BOM read
Five calls for one answer, and the line the public example leaves empty
The endpoints and payload shapes come from a public, MIT-licensed community Postman collection; host, port and identifiers are placeholders. The comments mark the two places a tool has to be stricter than the example.
# Teamcenter API: read one product structure through JsonRestServices.
# Every call is POST {web tier}/tc/JsonRestServices/<Library>-<YYYY>-<MM>-<Service>/<operation>
# 1. Session. Carries user, group and role; every later call inherits it.
POST /tc/JsonRestServices/Core-2011-06-Session/login
{ "header": { "state": {}, "policy": {} },
"body": { "credentials": { "user": "<person>", "password": "<from SSO, never a config file>",
"group": "", "role": "", "locale": "" } } }
# 2. Resolve the item to a UID.
POST /tc/JsonRestServices/Core-2007-01-DataManagement/getItemFromId
{ "body": { "infos": [ { "itemId": "<part number>", "revIds": ["A"] } ], "nRev": 1 } }
# 3. Open a BOM window. The public example sends "revRule": "" here. A tool must not:
# pick the rule from Cad-2007-01-StructureManagement/getRevisionRules and name it.
POST /tc/JsonRestServices/Cad-2007-01-StructureManagement/createBOMWindows
{ "body": { "info": [ { "item": "<item uid>",
"revRuleConfigInfo": { "revRule": "<named revision rule>",
"props": { "today": true, "unitNo": -1, "endItem": "", "endItemRevision": "" } } } ] } }
# 4. Expand from the top line.
POST /tc/JsonRestServices/Cad-2007-01-StructureManagement/expandPSAllLevels
{ "body": { "input": { "parentBomLines": ["<top bom line uid>"], "excludeFilter": "None" },
"pref": { "expItemRev": false } } }
# 5. Close the window. Always, including when step 3 or 4 failed.
POST /tc/JsonRestServices/Cad-2007-01-StructureManagement/closeBOMWindows
Five calls, one of them stateful and one of them easy to leave unconfigured. That is the unit an MCP tool should hide: get_structure(part, revision_rule, date) runs all five, closes the window on every path and returns the rule it used next to the lines.