delete_blacklist
Remove a trading pair from the Freqtrade bot's blacklist to allow trading of previously restricted assets.
Instructions
Remove a pair from the blacklist.
Parameters: pair (str): Trading pair to remove from blacklist (e.g., "ETH/USDT"). ctx (Context): MCP context object for logging and client access.
Returns: str: Stringified JSON response with updated blacklist, or error if failed.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pair | Yes |
Implementation Reference
- __main__.py:292-310 (handler)The delete_blacklist tool handler function that removes a trading pair from the blacklist. It retrieves the Freqtrade client from context, checks for version compatibility by attempting to call client.delete_blacklist() directly, or falls back to using the _client_delete helper with a DELETE request to the 'blacklist' endpoint with the pair parameter. Logs the removal action and returns the response as a string.
@mcp.tool() def delete_blacklist(pair: str, ctx: Context) -> str: """ Remove a pair from the blacklist. Parameters: pair (str): Trading pair to remove from blacklist (e.g., "ETH/USDT"). ctx (Context): MCP context object for logging and client access. Returns: str: Stringified JSON response with updated blacklist, or error if failed. """ client: FtRestClient = ctx.request_context.lifespan_context["client"] if hasattr(client, "delete_blacklist"): response = client.delete_blacklist(pair) else: response = _client_delete(client, "blacklist", params={"blacklist": pair}) logger.info(f"Removed {pair} from blacklist") return str(response) - __main__.py:292-293 (registration)The @mcp.tool() decorator registers the delete_blacklist function as an MCP tool with the FastMCP server, making it available for invocation by MCP clients.
@mcp.tool() def delete_blacklist(pair: str, ctx: Context) -> str: - __main__.py:54-55 (helper)Helper function that wraps the _call_client_method utility to make DELETE requests to the Freqtrade REST API. Used as a fallback mechanism in delete_blacklist when the client doesn't have a native delete_blacklist method.
def _client_delete(client: FtRestClient, path: str, params: Dict[str, Any] | None = None): return _call_client_method(client, ["_delete"], path, params=params)