> ## Documentation Index
> Fetch the complete documentation index at: https://docsapi.wiseapp360.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Protocolo e tools

> Chamadas JSON-RPC, descoberta de tools e envio de arquivos.

O servidor fala **JSON-RPC 2.0** sobre HTTP em `POST /mcp/{account_id}/{slug}`.

## Inicializar e listar tools

```bash initialize theme={null}
curl -X POST https://chat.wiseapp360.com/mcp/1/support_assistant \
  -H "Authorization: Bearer $WISEAPP_MCP_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {} }'
```

```bash tools/list theme={null}
curl -X POST https://chat.wiseapp360.com/mcp/1/support_assistant \
  -H "Authorization: Bearer $WISEAPP_MCP_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": {} }'
```

Cada tool traz `name`, `title`, `description` e `inputSchema` (JSON Schema dos argumentos). O catálogo inclui, por exemplo, `account_context` (metadados da conta do servidor) e `account_actions_list`, além das tools de conversas e mensagens liberadas para o servidor.

## Chamar uma tool

```bash theme={null}
curl -X POST https://chat.wiseapp360.com/mcp/1/support_assistant \
  -H "Authorization: Bearer $WISEAPP_MCP_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 3,
    "method": "tools/call",
    "params": { "name": "account_context", "arguments": {} }
  }'
```

## Enviar arquivos

A tool `outbound_messages_create` aceita um arquivo de três formas:

| Forma | Quando usar |
| - | - |
| `file` com `download_url` HTTPS temporário e `file_id` | Clientes com seletor de arquivo nativo, como o ChatGPT |
| `file` com `file_base64` | Fallback para qualquer cliente JSON |
| ID assinado de um arquivo já existente | Reaproveitar um anexo |

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 5,
  "method": "tools/call",
  "params": {
    "name": "outbound_messages_create",
    "arguments": {
      "body": {
        "inbox_id": 3,
        "recipient": { "phone_number": "+5511999990000" },
        "message": { "type": "media", "content": "Comprovante" }
      },
      "file": {
        "download_url": "https://arquivos-temporarios.exemplo/comprovante.png",
        "file_id": "file_123",
        "mime_type": "image/png",
        "file_name": "comprovante.png"
      }
    }
  }
}
```

> [!NOTE]
>
> URLs temporárias são baixadas apenas por HTTPS, com proteção contra SSRF e validação de tamanho. Arquivos inválidos, expirados ou vazios retornam `422 invalid_attachment` antes da entrega ao canal.

Há também uma extensão **multipart** opcional para arquivos locais: envie o JSON-RPC completo na parte `payload` e os arquivos em `attachments[]`. Ela vale apenas para `tools/call` de `conversation_message_send` e `outbound_messages_create`. Clientes MCP genéricos não a suportam automaticamente.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.