delete_pie
Remove an investment pie from your Trading 212 portfolio using its unique identifier to manage your investment allocations.
Instructions
Delete an investment pie by ID
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"pieId": "<pieId>"
},
"name": "delete_pie"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pieId | Yes | The unique identifier of the pie to delete |
Implementation Reference
- src/index.ts:785-796 (handler)The MCP tool handler case for 'delete_pie' which parses the input and calls the client method.
case 'delete_pie': { const { pieId } = DeletePieInputSchema.parse(args); await client.deletePie(pieId); return { content: [ { type: 'text', text: `Pie ${pieId} deleted successfully`, }, ], }; } - src/index.ts:525-527 (schema)Input schema for 'delete_pie' validating that pieId is a number.
const DeletePieInputSchema = z.object({ pieId: z.number(), }); - src/client.ts:251-255 (handler)The client method implementation that performs the actual DELETE HTTP request to the Trading 212 API.
async deletePie(pieId: number): Promise<void> { await this.request(`/equity/pies/${pieId}`, { method: 'DELETE', }); }