/**
 * MCP (Model Context Protocol) Types for HTTP MCP Servers
 *
 * Defines types for MCP tool descriptions and responses following
 * the MCP specification for HTTP-based tool servers.
 */

export interface McpTool {
  name: string;
  description: string;
  inputSchema: {
    type: string;
    properties: Record<string, any>;
    required: string[];
  };
}

export interface McpToolsListResponse {
  tools: McpTool[];
}

export interface McpToolCallRequest {
  name: string;
  arguments: Record<string, any>;
}

export interface McpToolCallResponse {
  content: Array<{
    type: 'text' | 'image' | 'resource';
    text?: string;
    data?: string;
    mimeType?: string;
  }>;
  isError?: boolean;
}

export interface McpErrorResponse {
  error: {
    code: string;
    message: string;
  };
  isError: true;
}

/**
 * Compact LLM-friendly customer representation
 */
export interface LlmCustomer {
  id: string;
  name: string;
  email: string;
  phone?: string;
  ordersCount?: number;
  totalSpent?: string;
}

/**
 * Compact LLM-friendly order representation
 */
export interface LlmOrder {
  id: string;
  orderNumber: string;
  customer: {
    name: string;
    email: string;
    phone?: string;
  };
  status: string;
  total: string;
  currency?: string;
  items: Array<{
    name: string;
    quantity: number;
    price: string;
  }>;
  createdAt: string;
}

/**
 * Compact LLM-friendly product representation
 */
export interface LlmProduct {
  id: string;
  name: string;
  sku?: string;
  price?: string;
  currency?: string;
  status?: string;
  description?: string;
  tags?: string[];
}
