Skip to main content
Glama
tas1337

MCP A2A AP2 Food Delivery & Payments

by tas1337
interfaces.ts7.18 kB
// ============================================================================= // INTERFACES // ============================================================================= // All interfaces in one place. // ============================================================================= // ============================================================================= // DOMAIN // ============================================================================= export interface Restaurant { id: string; name: string; cuisine: string; rating: number; deliveryTime: number; deliveryFee: number; service: 'doordash' | 'ubereats' | 'grubhub'; } export interface MenuItem { id: string; name: string; description?: string; price: number; category: string; } export interface Menu { restaurantId: string; restaurantName: string; items: MenuItem[]; } export interface DeliveryEstimate { restaurantId: string; restaurantName: string; estimatedTime: number; deliveryFee: number; minimumOrder: number; service: 'doordash' | 'ubereats' | 'grubhub'; } export interface OrderItem { itemId: string; quantity: number; } export interface Order { orderId: string; status: string; service: 'doordash' | 'ubereats' | 'grubhub'; } export interface OrderStatus { orderId: string; status: string; currentStage: string; service: 'doordash' | 'ubereats' | 'grubhub'; } // ============================================================================= // A2A PROTOCOL // ============================================================================= export interface AgentCard { agentId: string; name: string; version: string; endpoint: string; capabilities: string[]; description?: string; } export interface JSONRPCRequest { jsonrpc: '2.0'; id: string | number | null; method: string; params?: Record<string, unknown>; } export interface JSONRPCResponse { jsonrpc: '2.0'; id: string | number | null; result?: unknown; error?: JSONRPCError; } export interface JSONRPCError { code: number; message: string; data?: string; } // ============================================================================= // A2A RESPONSES // ============================================================================= export interface SearchResponse { restaurants: Restaurant[]; service: 'doordash' | 'ubereats' | 'grubhub'; } export interface MenuResponse { menu: Menu; service: 'doordash' | 'ubereats' | 'grubhub'; } export interface DeliveryResponse { estimatedTime: number; deliveryFee: number; minimumOrder: number; service: 'doordash' | 'ubereats' | 'grubhub'; } export interface OrderResponse { orderId: string; status: string; service: 'doordash' | 'ubereats' | 'grubhub'; } export interface OrderStatusResponse { orderId: string; status: string; currentStage: string; service: 'doordash' | 'ubereats' | 'grubhub'; } // ============================================================================= // A2A REQUEST PARAMS // ============================================================================= export interface SearchParams { query: string; location: string; } export interface MenuParams { restaurantId: string; } export interface DeliveryParams { restaurantId: string; location: string; } export interface PlaceOrderParams { restaurantId: string; items: OrderItem[]; deliveryAddress: string; } export interface OrderStatusParams { orderId: string; } // ============================================================================= // AP2 PAYMENT // ============================================================================= export interface PaymentRequest { amount: number; currency: string; paymentMethod: 'credit_card' | 'debit_card' | 'paypal' | 'apple_pay' | 'google_pay' | 'digital_wallet'; orderId: string; customerId?: string; metadata?: Record<string, unknown>; } export interface PaymentResponse { transactionId: string; status: 'pending' | 'processing' | 'completed' | 'failed' | 'refunded' | 'cancelled'; amount: number; currency: string; timestamp: string; message?: string; } export interface PaymentStatusResponse { transactionId: string; status: 'pending' | 'processing' | 'completed' | 'failed' | 'refunded' | 'cancelled'; amount: number; currency: string; timestamp: string; paymentMethod: 'credit_card' | 'debit_card' | 'paypal' | 'apple_pay' | 'google_pay' | 'digital_wallet'; orderId: string; } export interface PaymentStatusParams { transactionId: string; } export interface RefundRequest { transactionId: string; amount?: number; reason?: string; } export interface RefundResponse { refundId: string; transactionId: string; amount: number; currency: string; status: 'pending' | 'processing' | 'completed' | 'failed' | 'refunded' | 'cancelled'; timestamp: string; message?: string; } // ============================================================================= // AP2 MANDATES // ============================================================================= export interface Mandate { userId: string; agentId: string; action: 'payment' | 'refund'; maxAmount: number; currency: string; orderId: string; issuedAt: string; expiresAt: string; signature: string; } export interface MandateRequest { userId: string; agentId: string; action: 'payment' | 'refund'; maxAmount: number; currency: string; orderId: string; expiresInSeconds?: number; } export interface MandateVerification { valid: boolean; reason?: string; } export interface MandatePayload { userId: string; agentId: string; action: 'payment' | 'refund'; maxAmount: number; currency: string; orderId: string; issuedAt: string; expiresAt: string; } export interface PaymentRequestWithMandate extends PaymentRequest { mandate: Mandate; } export interface RefundRequestWithMandate extends RefundRequest { mandate: Mandate; } export interface PaymentResponseWithMandate extends PaymentResponse { mandate: Mandate; } export interface RefundResponseWithMandate extends RefundResponse { mandate: Mandate; } // ============================================================================= // TOOL HANDLER ARGS // ============================================================================= export interface ProcessPaymentArgs { amount: number; currency: string; paymentMethod: string; orderId: string; userId: string; } export interface ProcessRefundArgs { transactionId: string; orderId: string; userId: string; amount?: number; reason?: string; } export interface PlaceOrderArgs { restaurantId: string; items: OrderItem[]; totalAmount: number; paymentMethod: string; } export interface PlaceOrderResult { orderId: string; status: string; service: string; payment: { transactionId: string; status: string; amount: number; currency: string; }; mandate: { userId: string; agentId: string; action: string; maxAmount: number; currency: string; orderId: string; issuedAt: string; expiresAt: string; signature: string; }; }

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/tas1337/mcp-a2a-ap2-im-hungry'

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