list_simulations
Retrieve a complete list of all traffic simulations, including IDs, names, statuses, and execution timeframes, to quickly access and manage simulation data.
Instructions
Returns a comprehensive list of all traffic simulations in the system, including their IDs, names, status, and execution timeframes.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list_simulations"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ctx | No |
Implementation Reference
- src/fujitsu_sdt_mcp/server.py:447-454 (handler)The tool definition and handler function for list_simulations. Decorated with @mcp.tool() and registers the tool 'list_simulations' with FastMCP. Calls get_http_client() to create an HTTP client, instantiates FujitsuSocialDigitalTwinClient, and calls api_client.get_simulations() to retrieve the list.
@mcp.tool() 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:447-447 (registration)The @mcp.tool() decorator registers this function as an MCP tool in the FastMCP server instance named 'mcp' (created on line 28).
@mcp.tool() - src/fujitsu_sdt_mcp/server.py:58-68 (helper)The get_simulations() method on FujitsuSocialDigitalTwinClient, which performs the actual HTTP GET request to /api/simulations, handles errors, and formats the result via format_simulation_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)The format_simulation_result helper function that wraps the API response in a standard {success: True, data: ...} structure.
def format_simulation_result(result: Dict[str, Any]) -> Dict[str, Any]: return { "success": True, "data": result }