list_simulations
Retrieve detailed information on all traffic simulations, including IDs, names, status, and execution timeframes, within the Fujitsu Social Digital Twin MCP Server for analysis and management.
Instructions
Returns a comprehensive list of all traffic simulations in the system, including their IDs, names, status, and execution timeframes.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ctx | No |
Implementation Reference
- src/fujitsu_sdt_mcp/server.py:448-454 (handler)The primary handler function for the 'list_simulations' tool. Decorated with @mcp.tool() for registration and executes the logic by instantiating FujitsuSocialDigitalTwinClient and calling its get_simulations method.async def list_simulations(ctx: Optional[Context] = None) -> Dict[str, Any]: """Returns a comprehensive list of all traffic simulations in the system, including their IDs, names, status, and execution timeframes.""" async with await get_http_client() as client: api_client = FujitsuSocialDigitalTwinClient(client) result = await api_client.get_simulations() return result
- src/fujitsu_sdt_mcp/server.py:58-68 (helper)Supporting utility method in FujitsuSocialDigitalTwinClient class that performs the HTTP GET request to '/api/simulations' and handles responses/errors, formatting the result.async def get_simulations(self) -> Dict[str, Any]: try: response = await self.client.get("/api/simulations") response.raise_for_status() return format_simulation_result(response.json()) except httpx.HTTPStatusError as e: logger.error(f"Simulation list retrieval error: {e}") return format_api_error(e.response.status_code, str(e)) except Exception as e: logger.error(f"Unexpected error retrieving simulations: {e}") return format_api_error(500, str(e))
- src/fujitsu_sdt_mcp/server.py:47-51 (helper)Helper function to format successful API responses into a standard structure with success=True and data.def format_simulation_result(result: Dict[str, Any]) -> Dict[str, Any]: return { "success": True, "data": result }
- src/fujitsu_sdt_mcp/server.py:30-38 (helper)Utility to create and return configured httpx.AsyncClient for API calls.async def get_http_client(): return httpx.AsyncClient( base_url=FUJITSU_API_BASE_URL, headers={ "Content-Type": "application/json", "Authorization": f"Bearer {FUJITSU_API_KEY}" }, timeout=30.0 )
- src/fujitsu_sdt_mcp/server.py:448-448 (registration)The @mcp.tool() decorator registers the list_simulations function as an MCP tool.async def list_simulations(ctx: Optional[Context] = None) -> Dict[str, Any]: