MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / add_action

Method add_action

tests/utils/api_client.py:754–764  ·  view source on GitHub ↗

Add an action and return its actionId. project.action.add takes no params and doesn't echo the new id; ids are sequential indexes so the new action is the last entry. Use update_action(aid, title=...) to populate fields.

(self)

Source from the content-addressed store, hash-verified

752 )
753
754 def add_action(self) -> int:
755 """
756 Add an action and return its actionId.
757
758 project.action.add takes no params and doesn't echo the new id; ids
759 are sequential indexes so the new action is the last entry.
760 Use update_action(aid, title=...) to populate fields.
761 """
762 self.command("project.action.add")
763 actions = self.list_actions()
764 return actions[-1]["actionId"] if actions else -1
765
766 def update_action(self, action_id: int, **fields) -> dict:
767 params = {"actionId": action_id, **fields}

Calls 2

commandMethod · 0.95
list_actionsMethod · 0.95