Skip to main content
Glama

add_blacklist

Prevent specific cryptocurrency trading pairs from being traded by adding them to Freqtrade's exclusion list, helping users avoid undesirable assets.

Instructions

Add a pair to the blacklist.

Parameters: pair (str): Trading pair to 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
NameRequiredDescriptionDefault
pairYes

Implementation Reference

  • The add_blacklist tool handler function that adds a trading pair to the blacklist. It's decorated with @mcp.tool() which registers it as an MCP tool. The function takes a 'pair' parameter (str) and a Context object, retrieves the FtRestClient from the context, and calls either client.add_blacklist(pair) or client.blacklist(pair) depending on method availability. Returns a stringified JSON response.
    @mcp.tool()
    def add_blacklist(pair: str, ctx: Context) -> str:
        """
        Add a pair to the blacklist.
        
        Parameters:
            pair (str): Trading pair to 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, "add_blacklist"):
            response = client.add_blacklist(pair)
        else:
            response = client.blacklist(pair)
        logger.info(f"Added {pair} to blacklist")
        return str(response)
  • __main__.py:272-272 (registration)
    The @mcp.tool() decorator registers the add_blacklist function as an MCP tool with the FastMCP server instance defined at line 34.
    @mcp.tool()
  • The function signature and docstring define the input schema: 'pair' parameter (str) for the trading pair to blacklist, and 'ctx' (Context) for MCP context. The return type is str (stringified JSON response).
    def add_blacklist(pair: str, ctx: Context) -> str:
        """
        Add a pair to the blacklist.
        
        Parameters:
            pair (str): Trading pair to 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.
        """

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/worlddebugger/freqtrade-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server