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)
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 offers minimal behavioral insight. It states the action ('Delete') and return type, but lacks critical details: whether deletion is permanent/reversible, required permissions, error conditions (e.g., invalid ID), side effects, or rate limits. This is inadequate for a destructive operation with zero annotation coverage.

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 efficiently structured with a clear purpose statement followed by parameter and return sections. Every sentence adds value (purpose, param meaning, return format). It could be slightly more front-loaded by integrating return info into the first sentence, but it avoids redundancy.

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?

For a destructive tool with no annotations, no output schema, and 0% schema coverage, the description is incomplete. It misses behavioral context (e.g., permanence, errors), usage prerequisites, and output details beyond 'stringified JSON'. The agent lacks sufficient information to invoke this safely and effectively.

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 context for the single parameter ('lock_id'), explaining it's 'ID of the trade lock to delete'—clarifying its role beyond the schema's basic 'integer' type. With 0% schema description coverage and only one parameter, this compensates well, though it doesn't detail ID format or sourcing.

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

Purpose4/5

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

The description clearly states the verb ('Delete') and resource ('a specific trade lock by ID'), making the purpose unambiguous. It distinguishes from sibling tools like 'fetch_locks' (read) and 'place_trade' (create). However, it doesn't explicitly differentiate from other deletion tools (e.g., 'delete_blacklist'), which prevents a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing lock ID from 'fetch_locks'), exclusions (e.g., not for deleting other resources), or comparisons to siblings like 'delete_blacklist'. The agent must infer usage from the name alone.

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