fetch_bot_status
Check the current status of open cryptocurrency trades in Freqtrade to monitor active positions and trading bot performance.
Instructions
Retrieve the current status of open trades.
Parameters: ctx (Context): MCP context object for logging and client access.
Returns: str: Stringified JSON response with open trade status, or None if failed.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- __main__.py:76-88 (handler)The fetch_bot_status tool handler function that retrieves the current status of open trades from the Freqtrade bot. It extracts the FtRestClient from the MCP context and calls client.status() to get the trade status, returning it as a stringified JSON response.
@mcp.tool() def fetch_bot_status(ctx: Context) -> str: """ Retrieve the current status of open trades. Parameters: ctx (Context): MCP context object for logging and client access. Returns: str: Stringified JSON response with open trade status, or None if failed. """ client: FtRestClient = ctx.request_context.lifespan_context["client"] return str(client.status()) - __main__.py:76-76 (registration)The @mcp.tool() decorator registers the fetch_bot_status function as an MCP tool with the FastMCP framework, making it available for invocation by MCP clients.
@mcp.tool()