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.
        """
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but only mentions logging via 'ctx' and potential errors. It doesn't disclose critical behavioral traits like permissions needed, rate limits, side effects on the system, or what 'blacklist' entails in this context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded with the main purpose, followed by parameter and return details. It avoids unnecessary fluff, though the mention of 'ctx' not in the schema slightly reduces efficiency.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and a mutation tool (implied by 'Add'), the description is incomplete. It lacks details on what the blacklist is, how it affects the system, error handling specifics, or return format beyond 'stringified JSON', leaving gaps for agent understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaningful semantics: it explains 'pair' as a trading pair with an example ('ETH/USDT'), and mentions 'ctx' for logging and client access. With 0% schema description coverage and 1 parameter, this compensates well beyond the schema, though 'ctx' is not in the input schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the action ('Add a pair to the blacklist') which clarifies the verb and resource, but it doesn't differentiate from sibling tools like 'delete_blacklist' or 'fetch_blacklist'. It's clear what it does but lacks sibling distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'delete_blacklist' or 'fetch_blacklist', nor any context on prerequisites or exclusions. The description only states the basic action without usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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