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
| Name | Required | Description | Default |
|---|---|---|---|
| dealId | Yes | Deal ID of the order to delete |
Input Schema (JSON Schema)
{
"properties": {
"dealId": {
"description": "Deal ID of the order to delete",
"type": "string"
}
},
"required": [
"dealId"
],
"type": "object"
}
Implementation Reference
- src/services/ig-service.js:294-311 (handler)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; } }
- src/services/mcp-service.js:343-356 (registration)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'], }, },
- src/services/mcp-service.js:668-677 (handler)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), }, ], };
- src/services/mcp-service.js:346-356 (schema)Input schema definition for the tool parameters.inputSchema: { type: 'object', properties: { dealId: { type: 'string', description: 'Deal ID of the order to delete', }, }, required: ['dealId'], }, },