feat: add Get Order Status tool typebot to seed data#176
feat: add Get Order Status tool typebot to seed data#176fjunqueira wants to merge 1 commit intomainfrom
Conversation
Adds a tool-type typebot (settings.general.type = "TOOL") that gets exposed via the MCP server for agents to call. Includes tenant column set to claudia_project for proper workspace scoping. Also adds a published version so the tool is discoverable via /api/mcp. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Este PR adiciona ao seed.sql um novo typebot do tipo TOOL (“Get Order Status”) para ser publicado e descoberto via endpoint /api/mcp sob o tenant claudia_project, permitindo que agentes MCP encontrem e executem a ferramenta.
Changes:
- Inclui um novo registro em
"Typebot"comsettings.general.type = "TOOL",tenant = 'claudia_project'etoolDescription. - Inclui o registro correspondente em
"PublicTypebot"para que o tool fique publicado e elegível para descoberta via MCP.
| 'claudia-workspace-id', | ||
| 'get-order-status-bqgj13c', | ||
| '6', | ||
| '[{"id": "vlvx3yfsvjxrfn2obrd8fe4d", "title": "Captura o numero do pedido do cliente", "blocks": [{"id": "nrvf9rvbdq6wthjz5i3ifxc3", "type": "Declare variables", "outgoingEdgeId": "msnlks3o29wm45a6qiyo56a2", "options": {"variables": [{"variableId": "vbhmqwrbp80wbflf598bulicr", "description": "Numero do pedido do cliente", "required": true}]}}], "graphCoordinates": {"x": 338.46, "y": -105.89}}, {"id": "sl83xjejv2vlelkoshgjx5k3", "title": "Conseguir status", "blocks": [{"id": "thd2s19wujmpv9u26azv3fn7", "type": "Webhook", "outgoingEdgeId": "k8z6rzrsulshbej9zrx2d5cx", "options": {"variablesForTest": [{"id": "e60buzy63h74c47o0wixnf1l"}], "isAdvancedConfig": true, "isCustomBody": true, "webhook": {"url": "https://pnqwzhnyl3llssp4gubtyw5kue0thern.lambda-url.us-east-1.on.aws/", "body": "{\"orderNumber\": \"{{idPedido}}\"}"}}}], "graphCoordinates": {"x": 750.14, "y": -122.53}}, {"id": "rvubb4h2ll94req9q590z64r", "title": "Retorna infos", "blocks": [{"id": "yw9notqt8fwumohxu6ak24tz", "type": "workflow", "options": {"action": "Return Output", "responseType": "Custom JSON", "customJson": "{}"}}], "graphCoordinates": {"x": 1148.19, "y": -119.56}}]'::jsonb, |
There was a problem hiding this comment.
No bloco workflow (ação "Return Output"), o responseType está como "Custom JSON" e o customJson é "{}". Isso faz o tool sempre retornar {} via MCP, ignorando a resposta do Webhook. Ajuste para retornar a "Last HTTP Response" (ou um JSON custom que inclua os campos da resposta do webhook) para que get_order_status realmente devolva o status do pedido.
| '[{"id": "vlvx3yfsvjxrfn2obrd8fe4d", "title": "Captura o numero do pedido do cliente", "blocks": [{"id": "nrvf9rvbdq6wthjz5i3ifxc3", "type": "Declare variables", "outgoingEdgeId": "msnlks3o29wm45a6qiyo56a2", "options": {"variables": [{"variableId": "vbhmqwrbp80wbflf598bulicr", "description": "Numero do pedido do cliente", "required": true}]}}], "graphCoordinates": {"x": 338.46, "y": -105.89}}, {"id": "sl83xjejv2vlelkoshgjx5k3", "title": "Conseguir status", "blocks": [{"id": "thd2s19wujmpv9u26azv3fn7", "type": "Webhook", "outgoingEdgeId": "k8z6rzrsulshbej9zrx2d5cx", "options": {"variablesForTest": [{"id": "e60buzy63h74c47o0wixnf1l"}], "isAdvancedConfig": true, "isCustomBody": true, "webhook": {"url": "https://pnqwzhnyl3llssp4gubtyw5kue0thern.lambda-url.us-east-1.on.aws/", "body": "{\"orderNumber\": \"{{idPedido}}\"}"}}}], "graphCoordinates": {"x": 750.14, "y": -122.53}}, {"id": "rvubb4h2ll94req9q590z64r", "title": "Retorna infos", "blocks": [{"id": "yw9notqt8fwumohxu6ak24tz", "type": "workflow", "options": {"action": "Return Output", "responseType": "Custom JSON", "customJson": "{}"}}], "graphCoordinates": {"x": 1148.19, "y": -119.56}}]'::jsonb, | |
| '[{"id": "vlvx3yfsvjxrfn2obrd8fe4d", "title": "Captura o numero do pedido do cliente", "blocks": [{"id": "nrvf9rvbdq6wthjz5i3ifxc3", "type": "Declare variables", "outgoingEdgeId": "msnlks3o29wm45a6qiyo56a2", "options": {"variables": [{"variableId": "vbhmqwrbp80wbflf598bulicr", "description": "Numero do pedido do cliente", "required": true}]}}], "graphCoordinates": {"x": 338.46, "y": -105.89}}, {"id": "sl83xjejv2vlelkoshgjx5k3", "title": "Conseguir status", "blocks": [{"id": "thd2s19wujmpv9u26azv3fn7", "type": "Webhook", "outgoingEdgeId": "k8z6rzrsulshbej9zrx2d5cx", "options": {"variablesForTest": [{"id": "e60buzy63h74c47o0wixnf1l"}], "isAdvancedConfig": true, "isCustomBody": true, "webhook": {"url": "https://pnqwzhnyl3llssp4gubtyw5kue0thern.lambda-url.us-east-1.on.aws/", "body": "{\"orderNumber\": \"{{idPedido}}\"}"}}}], "graphCoordinates": {"x": 750.14, "y": -122.53}}, {"id": "rvubb4h2ll94req9q590z64r", "title": "Retorna infos", "blocks": [{"id": "yw9notqt8fwumohxu6ak24tz", "type": "workflow", "options": {"action": "Return Output", "responseType": "Last HTTP Response"}}], "graphCoordinates": {"x": 1148.19, "y": -119.56}}]'::jsonb, |
| 'get-order-status-published-id', | ||
| 'get-order-status-tool-id', | ||
| '6', | ||
| '[{"id": "vlvx3yfsvjxrfn2obrd8fe4d", "title": "Captura o numero do pedido do cliente", "blocks": [{"id": "nrvf9rvbdq6wthjz5i3ifxc3", "type": "Declare variables", "outgoingEdgeId": "msnlks3o29wm45a6qiyo56a2", "options": {"variables": [{"variableId": "vbhmqwrbp80wbflf598bulicr", "description": "Numero do pedido do cliente", "required": true}]}}], "graphCoordinates": {"x": 338.46, "y": -105.89}}, {"id": "sl83xjejv2vlelkoshgjx5k3", "title": "Conseguir status", "blocks": [{"id": "thd2s19wujmpv9u26azv3fn7", "type": "Webhook", "outgoingEdgeId": "k8z6rzrsulshbej9zrx2d5cx", "options": {"variablesForTest": [{"id": "e60buzy63h74c47o0wixnf1l"}], "isAdvancedConfig": true, "isCustomBody": true, "webhook": {"url": "https://pnqwzhnyl3llssp4gubtyw5kue0thern.lambda-url.us-east-1.on.aws/", "body": "{\"orderNumber\": \"{{idPedido}}\"}"}}}], "graphCoordinates": {"x": 750.14, "y": -122.53}}, {"id": "rvubb4h2ll94req9q590z64r", "title": "Retorna infos", "blocks": [{"id": "yw9notqt8fwumohxu6ak24tz", "type": "workflow", "options": {"action": "Return Output", "responseType": "Custom JSON", "customJson": "{}"}}], "graphCoordinates": {"x": 1148.19, "y": -119.56}}]'::jsonb, |
There was a problem hiding this comment.
Mesmo problema no snapshot publicado: o bloco workflow ("Return Output") está configurado com responseType: "Custom JSON" e customJson: "{}", então o resultado publicado via /api/mcp ficará sempre {}. Atualize para retornar a "Last HTTP Response" (ou um JSON custom baseado na resposta do webhook).
| '[{"id": "vlvx3yfsvjxrfn2obrd8fe4d", "title": "Captura o numero do pedido do cliente", "blocks": [{"id": "nrvf9rvbdq6wthjz5i3ifxc3", "type": "Declare variables", "outgoingEdgeId": "msnlks3o29wm45a6qiyo56a2", "options": {"variables": [{"variableId": "vbhmqwrbp80wbflf598bulicr", "description": "Numero do pedido do cliente", "required": true}]}}], "graphCoordinates": {"x": 338.46, "y": -105.89}}, {"id": "sl83xjejv2vlelkoshgjx5k3", "title": "Conseguir status", "blocks": [{"id": "thd2s19wujmpv9u26azv3fn7", "type": "Webhook", "outgoingEdgeId": "k8z6rzrsulshbej9zrx2d5cx", "options": {"variablesForTest": [{"id": "e60buzy63h74c47o0wixnf1l"}], "isAdvancedConfig": true, "isCustomBody": true, "webhook": {"url": "https://pnqwzhnyl3llssp4gubtyw5kue0thern.lambda-url.us-east-1.on.aws/", "body": "{\"orderNumber\": \"{{idPedido}}\"}"}}}], "graphCoordinates": {"x": 750.14, "y": -122.53}}, {"id": "rvubb4h2ll94req9q590z64r", "title": "Retorna infos", "blocks": [{"id": "yw9notqt8fwumohxu6ak24tz", "type": "workflow", "options": {"action": "Return Output", "responseType": "Custom JSON", "customJson": "{}"}}], "graphCoordinates": {"x": 1148.19, "y": -119.56}}]'::jsonb, | |
| '[{"id": "vlvx3yfsvjxrfn2obrd8fe4d", "title": "Captura o numero do pedido do cliente", "blocks": [{"id": "nrvf9rvbdq6wthjz5i3ifxc3", "type": "Declare variables", "outgoingEdgeId": "msnlks3o29wm45a6qiyo56a2", "options": {"variables": [{"variableId": "vbhmqwrbp80wbflf598bulicr", "description": "Numero do pedido do cliente", "required": true}]}}], "graphCoordinates": {"x": 338.46, "y": -105.89}}, {"id": "sl83xjejv2vlelkoshgjx5k3", "title": "Conseguir status", "blocks": [{"id": "thd2s19wujmpv9u26azv3fn7", "type": "Webhook", "outgoingEdgeId": "k8z6rzrsulshbej9zrx2d5cx", "options": {"variablesForTest": [{"id": "e60buzy63h74c47o0wixnf1l"}], "isAdvancedConfig": true, "isCustomBody": true, "webhook": {"url": "https://pnqwzhnyl3llssp4gubtyw5kue0thern.lambda-url.us-east-1.on.aws/", "body": "{\"orderNumber\": \"{{idPedido}}\"}"}}}], "graphCoordinates": {"x": 750.14, "y": -122.53}}, {"id": "rvubb4h2ll94req9q590z64r", "title": "Retorna infos", "blocks": [{"id": "yw9notqt8fwumohxu6ak24tz", "type": "workflow", "options": {"action": "Return Output", "responseType": "Last HTTP Response"}}], "graphCoordinates": {"x": 1148.19, "y": -119.56}}]'::jsonb, |
| '[{"id": "ric2dls1axu8xy1i1a359a75", "type": "start", "outgoingEdgeId": "e69c5a6m47azu1uzjpsvek64", "graphCoordinates": {"x": 0, "y": 0}}]'::jsonb, | ||
| 'Busca status do pedido atraves do numero do pedido do cliente.', |
There was a problem hiding this comment.
String de toolDescription contém "atraves" (sem acento). Como é texto exibido ao usuário (descrição do tool), corrija para "através".
| '[{"id": "ric2dls1axu8xy1i1a359a75", "type": "start", "outgoingEdgeId": "e69c5a6m47azu1uzjpsvek64", "graphCoordinates": {"x": 0, "y": 0}}]'::jsonb, | |
| 'Busca status do pedido atraves do numero do pedido do cliente.', | |
| '[{"id": "ric2dls1axu8xy1i1a359a75", "type": "start", "outgoingEdgeId": "e69c5a6m47azu1i1a359a75", "graphCoordinates": {"x": 0, "y": 0}}]'::jsonb, | |
| 'Busca status do pedido através do numero do pedido do cliente.', |
Summary
settings.general.type = "TOOL") to the seed SQLtenant = 'claudia_project'so the tool is scoped correctly for MCP discovery viax-tenantheaderPublicTypebotentry so the tool is published and discoverable via/api/mcpThis tool gets exposed through the MCP server and can be called by claudia-agentic's react agent to look up order statuses.
Test plan
typebot-seedservice and verify the tool appears in the databasePOST /api/mcpwithx-tenant: claudia_projectandtools/listmethod — should returnget_order_status🤖 Generated with Claude Code