Skip to main content
Glama

delete_lock

Remove a specific trade lock by ID to allow trading operations to proceed in the Freqtrade cryptocurrency trading bot.

Instructions

Delete a specific trade lock by ID.

Parameters: lock_id (int): ID of the trade lock to delete. ctx (Context): MCP context object for logging and client access.

Returns: str: Stringified JSON response with updated locks, or error if failed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lock_idYes

Implementation Reference

  • The delete_lock tool handler function that deletes a trade lock by ID. It takes a lock_id parameter, accesses the FtRestClient from the MCP context, calls client.delete_lock(lock_id), logs the action, and returns the stringified JSON response.
    @mcp.tool()
    def delete_lock(lock_id: int, ctx: Context) -> str:
        """
        Delete a specific trade lock by ID.
        
        Parameters:
            lock_id (int): ID of the trade lock to delete.
            ctx (Context): MCP context object for logging and client access.
        
        Returns:
            str: Stringified JSON response with updated locks, or error if failed.
        """
        client: FtRestClient = ctx.request_context.lifespan_context["client"]
        response = client.delete_lock(lock_id)
        logger.info(f"Deleted lock with ID {lock_id}")
        return str(response)
  • __main__.py:312-312 (registration)
    The @mcp.tool() decorator registers the delete_lock function as an MCP tool with the FastMCP server instance 'mcp'.
    @mcp.tool()
  • The function signature and docstring define the input schema: lock_id (int) is the ID of the trade lock to delete. The return type is str (stringified JSON response).
    def delete_lock(lock_id: int, ctx: Context) -> str:
        """
        Delete a specific trade lock by ID.
        
        Parameters:
            lock_id (int): ID of the trade lock to delete.
            ctx (Context): MCP context object for logging and client access.
        
        Returns:
            str: Stringified JSON response with updated locks, or error if failed.
        """
  • Retrieves the FtRestClient from the MCP lifespan context and calls client.delete_lock(lock_id) to perform the actual API operation.
    client: FtRestClient = ctx.request_context.lifespan_context["client"]
    response = client.delete_lock(lock_id)

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