Skip to main content
Glama
theagoralabs

Theagora MCP Server

by theagoralabs

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
NameRequiredDescriptionDefault
providerEmailYesEmail of the provider to invite
functionIdYesThe function ID for the proposed deal
agreedPriceCentsYesAgreed price in cents
metadataNoOptional deal metadata

Implementation Reference

  • 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) }],
        };
      }
    );
  • 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'),
    },
  • 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) }],
      };
    }
  • 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 });
    }

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/theagoralabs/mcp'

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