create_pie
Build a diversified investment portfolio by allocating percentages to specific instruments and setting dividend reinvestment preferences.
Instructions
Create a new investment pie with specified instruments and allocations
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name of the pie (1-50 characters) | |
| icon | Yes | Icon identifier for the pie | |
| instrumentShares | Yes | Object mapping ticker symbols to their percentage allocation (e.g., {"AAPL": 0.5, "GOOGL": 0.5}) | |
| dividendCashAction | Yes | What to do with dividend cash | |
| goal | No | Optional investment goal amount |
Implementation Reference
- src/index.ts:759-770 (handler)The tool handler for 'create_pie' in the MCP server, which validates the input using CreatePieRequestSchema and calls client.createPie.
case 'create_pie': { const validated = CreatePieRequestSchema.parse(args); const pie = await client.createPie(validated); return { content: [ { type: 'text', text: JSON.stringify(pie, null, 2), }, ], }; } - src/types.ts:235-242 (schema)Input validation schema for creating a pie.
export const CreatePieRequestSchema = z.object({ dividendCashAction: z.enum(['REINVEST', 'TO_ACCOUNT_CASH']), goal: z.number().positive().optional(), icon: z.string(), instrumentShares: z.record(z.string(), z.number()), name: z.string().min(1).max(50), });