MCPcopy Create free account
hub / github.com/Surfer-Org/Protocol / get

Method get

sdk/python/surfer_protocol/client.py:18–43  ·  view source on GitHub ↗

Get the most recent run for a specific platform. Raises: ConnectionError: If connection to desktop app fails ValueError: If no successful runs are found for the platform

(self, platform_id: str)

Source from the content-addressed store, hash-verified

16
17
18 def get(self, platform_id: str) -> dict:
19 """Get the most recent run for a specific platform.
20
21 Raises:
22 ConnectionError: If connection to desktop app fails
23 ValueError: If no successful runs are found for the platform
24 """
25 try:
26 response = self.session.post(f"{self.base_url}/get", json={"platformId": platform_id})
27
28 # Handle 404 status codes specifically
29 if response.status_code == 404:
30 error_data = response.json()
31 raise ValueError(error_data['error'])
32
33 # Handle other HTTP errors
34 response.raise_for_status()
35
36 data = response.json()
37 if not data.get('success'):
38 raise ValueError(data.get('error', 'Unknown error occurred'))
39
40 return data
41
42 except requests.exceptions.RequestException as e:
43 raise ConnectionError(f"Failed to get most recent run: {str(e)}") from e
44
45 def export(self, platform_id: str) -> dict:
46 """Trigger an export for a specific platform.

Callers 15

current_db.pyFile · 0.80
vectorize.pyFile · 0.80
mainFunction · 0.80
setupExpressServerFunction · 0.80
createWindowFunction · 0.80
getTwitterCredentialsFunction · 0.80
linkedin.pyFile · 0.80
app.pyFile · 0.80
display_graphFunction · 0.80
save_graphFunction · 0.80
neighbourhoodHighlightFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected