Deals table · Apps in ChatGPT for ChatGPT | Prompt Studio
    1. ChatGPT
    2. Apps in ChatGPT
    3. Deals table
    ChatGPT · Apps in ChatGPTCRM

    Deals table

    Widget that lists deals and their status inside ChatGPT.

    by Prompt Studio

    apps-sdkwidgetdeals

    License: MITView original

    Contents

    Where it goes: server.ts

    import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
    import { z } from 'zod';
    
    const server = new McpServer({ name: 'deals-lista', version: '1.0.0' });
    
    const html = `<div id="root"></div>
    <style>
      body { font-family: system-ui, sans-serif; margin: 0; }
      table { width: 100%; border-collapse: collapse; }
      td, th { padding: 6px 8px; border-bottom: 1px solid #e5e5e5; text-align: left; }
      .card { border: 1px solid #e5e5e5; border-radius: 12px; padding: 12px; }
      .chip { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #eef; font-size: 12px; }
    </style>
    <script type="module">
    const data = window.openai?.toolOutput ?? { items: [] };
    const cols = ["title", "amount", "currency", "closeDate"];
    document.getElementById('root').innerHTML =
      '<table><tr>' + cols.map(c => '<th>' + c + '</th>').join('') + '<th>estado</th></tr>' +
      data.items.map(i => '<tr>' + cols.map(c => '<td>' + (i[c] ?? '') + '</td>').join('') + '<td><span class="chip">' + i.status + '</span></td></tr>').join('') +
      '</table>';
    </script>`;
    
    // Widget que ChatGPT muestra dentro de la conversación.
    server.registerResource('widget', 'ui://widget/deals-list.html', {}, async () => ({
      contents: [{ uri: 'ui://widget/deals-list.html', mimeType: 'text/html+skybridge', text: html }],
    }));
    
    server.registerTool(
      'listar_deal',
      {
        title: 'Listar oportunidades',
        description: 'Muestra oportunidades en una tabla, con filtro opcional por estado',
        inputSchema: { status: z.enum(["abierta", "ganada", "perdida"]).optional() },
        _meta: { 'openai/outputTemplate': 'ui://widget/deals-list.html' },
      },
      async ({ status }) => {
        const res = await fetch(`https://api.tu-dominio.com/v1/deals${status ? `?status=${encodeURIComponent(status)}` : ''}`, { headers: { authorization: `Bearer ${process.env.API_TOKEN}` } });
        const { items } = await res.json();
        return { structuredContent: { items }, content: [{ type: 'text', text: `${items.length} oportunidades` }] };
      },
    );
    
    // Expón el servidor por HTTP (Streamable HTTP) y agrégalo en ChatGPT → Configuración → Apps y conectores.
    

    More in Apps in ChatGPT

    • Product carousel

      MCP server with a tool that returns products and a carousel widget.

    • Appointment booking

      Shows available slots and confirms the booking inside the chat.

    • KPI dashboard

      Widget with KPI cards that reads data from window.openai.

    • Contacts table

      Widget that lists contacts and their status inside ChatGPT.

    • Contact card

      Card with the full details of one contact.

    • Contact form

      In-chat form that creates a contact in your API.

    See all in Apps in ChatGPT (503) →

    Your ultimate collection of AI prompts. Gather inspiration, explore examples, and create with AI.

    Main hubs

    • Prompts
    • Images
    • Videos
    • Generate Videos
    • Templates
    • Animations
    • Prices
    • About
    • Affiliate

    Browse by type

    • Component kits
    • Image Tags
    • Video Tags
    • Webs

    Popular topics

    • Music
    • Portfolio
    • Gaming
    • Travel
    • Nano Banana Pro

    Legal

    • Terms of Use
    • Privacy Policy
    • Cookie Policy
    • Licenses Policy
    • Refund Policy
    • Affiliate Program Terms
    • Crowdfunding Terms

    Magzin LLC, 800 Third Avenue Associates, New York, NY, 10022, United States

    © 2026 Prompt Studio by Magzin. All rights reserved.