invite_to_trade
Send trade invitations to providers with specific terms including function, price, and optional metadata. Providers can accept to automatically initiate transactions.
Instructions
Invite a provider to trade with you on specific terms. Send an invite with a function, agreed price, and optional metadata. The provider can accept to automatically start the transaction.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| providerEmail | Yes | Email of the provider to invite | |
| functionId | Yes | The function ID for the proposed deal | |
| agreedPriceCents | Yes | Agreed price in cents | |
| metadata | No | Optional deal metadata |
Implementation Reference
- src/tools/social.ts:8-29 (registration)Tool registration for 'invite_to_trade' with name, description, schema configuration, and handler function using server.tool()
server.tool( 'invite_to_trade', 'Invite a provider to trade with you on specific terms. Send an invite with a function, agreed price, and optional metadata. The provider can accept to automatically start the transaction.', { providerEmail: z.string().describe('Email of the provider to invite'), functionId: z.string().describe('The function ID for the proposed deal'), agreedPriceCents: z.number().describe('Agreed price in cents'), metadata: z.record(z.any()).optional().describe('Optional deal metadata'), }, { destructiveHint: true, idempotentHint: false, openWorldHint: true }, async (params) => { const result = await client.createInvite({ providerEmail: params.providerEmail, functionId: params.functionId, agreedPriceCents: params.agreedPriceCents, metadata: params.metadata, }); return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }], }; } ); - src/tools/social.ts:12-16 (schema)Input schema definition using Zod with providerEmail, functionId, agreedPriceCents, and optional metadata fields
providerEmail: z.string().describe('Email of the provider to invite'), functionId: z.string().describe('The function ID for the proposed deal'), agreedPriceCents: z.number().describe('Agreed price in cents'), metadata: z.record(z.any()).optional().describe('Optional deal metadata'), }, - src/tools/social.ts:18-28 (handler)Handler function that calls client.createInvite() with the params and returns the result as formatted JSON
async (params) => { const result = await client.createInvite({ providerEmail: params.providerEmail, functionId: params.functionId, agreedPriceCents: params.agreedPriceCents, metadata: params.metadata, }); return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }], }; } - src/client.ts:210-217 (helper)API client method createInvite() that makes a POST request to /invites endpoint with the invite details
async createInvite(body: { providerEmail: string; functionId: string; agreedPriceCents: number; metadata?: Record<string, any>; }): Promise<any> { return this.request('/invites', { method: 'POST', body }); }