Skip to main content
Glama
kea0811
by kea0811

ig_delete_working_order

Remove a working order on IG Trading by specifying the deal ID. Execute deletions quickly to manage trading positions and orders effectively.

Instructions

Delete a working order

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dealIdYesDeal ID of the order to delete

Implementation Reference

  • Core implementation of deleteWorkingOrder method in IGService class, which performs the API DELETE request to remove the working order and fetches confirmation if available.
    async deleteWorkingOrder(dealId) {
      try {
        const response = await this.apiClient.delete(`/workingorders/otc/${dealId}`, {}, 1);
        
        if (response.data.dealReference) {
          const confirmation = await this.getConfirmation(response.data.dealReference);
          return {
            order: response.data,
            confirmation
          };
        }
        
        return response.data;
      } catch (error) {
        logger.error(`Failed to delete working order ${dealId}:`, error.message);
        throw error;
      }
    }
  • Tool registration in the TOOLS array, including name, description, and input schema definition.
    {
      name: 'ig_delete_working_order',
      description: 'Delete a working order',
      inputSchema: {
        type: 'object',
        properties: {
          dealId: {
            type: 'string',
            description: 'Deal ID of the order to delete',
          },
        },
        required: ['dealId'],
      },
    },
  • MCP server dispatch handler for the tool, which calls the IGService method and formats the response.
    case 'ig_delete_working_order':
      const deleteResult = await igService.deleteWorkingOrder(args.dealId);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(deleteResult, null, 2),
          },
        ],
      };
  • Input schema definition for the tool parameters.
      inputSchema: {
        type: 'object',
        properties: {
          dealId: {
            type: 'string',
            description: 'Deal ID of the order to delete',
          },
        },
        required: ['dealId'],
      },
    },
Behavior2/5

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

With no annotations, the description carries full burden but only states the action ('Delete') without behavioral details. It doesn't disclose if deletion is permanent, requires specific permissions, has side effects, or provides confirmation. 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.

Conciseness5/5

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

The description is a single, direct sentence with zero waste. It's front-loaded and efficiently conveys the core action without unnecessary elaboration, making it easy to parse.

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 and no output schema, the description is incomplete. It lacks critical context like irreversible effects, error handling, or response format. Given the complexity and risk of deletion, more behavioral transparency is needed.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents the 'dealId' parameter fully. The description adds no additional meaning beyond what the schema provides, such as format examples or context about valid deal IDs. Baseline 3 is appropriate when schema does the heavy lifting.

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 working order'), making the purpose unambiguous. It distinguishes from siblings like 'ig_close_position' or 'ig_close_all_positions' by specifying deletion rather than closure, though it doesn't explicitly contrast them.

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 working order), exclusions, or comparisons to siblings like 'ig_close_position' or 'ig_get_working_orders'.

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

Related 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/kea0811/ig-trading-mcp'

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