paradex_system_state
Verify Paradex exchange system status to confirm it is operational, not in maintenance mode, and clock synchronized before executing trades.
Instructions
Verify the exchange is fully operational before executing trades.
Use this tool when you need to:
- Check if Paradex is functioning normally before placing important orders
- Verify system status if you encounter unexpected behavior
- Confirm that maintenance periods are not in effect
- Check exchange clock synchronization with your own systems
This is especially important before executing critical trades or when
experiencing unexpected behavior from other API calls.
Example use cases:
- Verifying the exchange is operational before executing a trading strategy
- Checking if maintenance mode is active when experiencing delays
- Confirming exchange status during periods of market volatility
- Diagnosing API issues by checking system healthInput Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| status | Yes | ||
| timestamp | No |
Implementation Reference
- src/mcp_paradex/tools/system.py:53-80 (handler)The main handler function for the 'paradex_system_state' tool. It fetches system state (status) and system time from Paradex and returns them as a SystemState model.
@server.tool(name="paradex_system_state", annotations=ToolAnnotations(readOnlyHint=True)) async def get_system_state(ctx: Context) -> SystemState: """ Verify the exchange is fully operational before executing trades. Use this tool when you need to: - Check if Paradex is functioning normally before placing important orders - Verify system status if you encounter unexpected behavior - Confirm that maintenance periods are not in effect - Check exchange clock synchronization with your own systems This is especially important before executing critical trades or when experiencing unexpected behavior from other API calls. Example use cases: - Verifying the exchange is operational before executing a trading strategy - Checking if maintenance mode is active when experiencing delays - Confirming exchange status during periods of market volatility - Diagnosing API issues by checking system health """ try: client = await get_paradex_client() state = client.fetch_system_state() time = client.fetch_system_time() return SystemState(status=state["status"], timestamp=time["server_time"]) except Exception as e: await ctx.error(f"Error fetching system state: {e!s}") raise e - src/mcp_paradex/models.py:15-19 (schema)The Pydantic model (SystemState) that defines the output schema for the tool: status (str) and timestamp (int).
class SystemState(BaseModel): """Model representing the current state of the Paradex system.""" status: str timestamp: int = Field(default=0) - src/mcp_paradex/tools/system.py:53-53 (registration)The tool registration via the @server.tool() decorator, binding the name 'paradex_system_state' to the get_system_state handler.
@server.tool(name="paradex_system_state", annotations=ToolAnnotations(readOnlyHint=True)) - tests/test_tools.py:189-199 (helper)Test verifying the tool returns correct status and timestamp from the API.
async def test_system_state_returns_status_and_timestamp(mock_client): mock_client.fetch_system_state.return_value = {"status": "ok"} mock_client.fetch_system_time.return_value = {"server_time": 1_700_000_000_000} result = await server.call_tool("paradex_system_state", {}) data = _json(result) assert data["status"] == "ok" assert data["timestamp"] == 1_700_000_000_000 mock_client.fetch_system_state.assert_called_once() mock_client.fetch_system_time.assert_called_once()