fetch_blacklist
Retrieve the current list of prohibited trading pairs from the Freqtrade cryptocurrency trading bot to avoid restricted assets during automated trading operations.
Instructions
Get the current blacklist of trading pairs.
Parameters: ctx (Context): MCP context object for logging and client access.
Returns: str: Stringified JSON response with blacklist data, or None if failed.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- __main__.py:147-158 (handler)The fetch_blacklist tool handler function that retrieves the current blacklist of trading pairs from the Freqtrade API. It accesses the FtRestClient from the MCP context and calls the blacklist() method to fetch the data, returning it as a stringified JSON response.
def fetch_blacklist(ctx: Context) -> str: """ Get the current blacklist of trading pairs. Parameters: ctx (Context): MCP context object for logging and client access. Returns: str: Stringified JSON response with blacklist data, or None if failed. """ client: FtRestClient = ctx.request_context.lifespan_context["client"] return str(client.blacklist()) - __main__.py:146-146 (registration)The @mcp.tool() decorator registers the fetch_blacklist function as an MCP tool with the FastMCP server instance 'mcp'.
@mcp.tool() - __main__.py:148-155 (schema)The docstring defines the tool's input/output schema: accepts a Context parameter and returns a stringified JSON response containing blacklist data.
""" Get the current blacklist of trading pairs. Parameters: ctx (Context): MCP context object for logging and client access. Returns: str: Stringified JSON response with blacklist data, or None if failed.