Skip to content

feat: add Get Order Status tool typebot to seed data#176

Open
fjunqueira wants to merge 1 commit intomainfrom
feat/seed-mcp-tool-typebot
Open

feat: add Get Order Status tool typebot to seed data#176
fjunqueira wants to merge 1 commit intomainfrom
feat/seed-mcp-tool-typebot

Conversation

@fjunqueira
Copy link
Copy Markdown

Summary

  • Adds a "Get Order Status" tool-type typebot (settings.general.type = "TOOL") to the seed SQL
  • Sets tenant = 'claudia_project' so the tool is scoped correctly for MCP discovery via x-tenant header
  • Adds corresponding PublicTypebot entry so the tool is published and discoverable via /api/mcp

This tool gets exposed through the MCP server and can be called by claudia-agentic's react agent to look up order statuses.

Test plan

  • Run typebot-seed service and verify the tool appears in the database
  • Call POST /api/mcp with x-tenant: claudia_project and tools/list method — should return get_order_status

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings March 25, 2026 01:35
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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" com settings.general.type = "TOOL", tenant = 'claudia_project' e toolDescription.
  • 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,
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
'[{"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,

Copilot uses AI. Check for mistakes.
'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,
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
'[{"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,

Copilot uses AI. Check for mistakes.
Comment on lines +57 to +58
'[{"id": "ric2dls1axu8xy1i1a359a75", "type": "start", "outgoingEdgeId": "e69c5a6m47azu1uzjpsvek64", "graphCoordinates": {"x": 0, "y": 0}}]'::jsonb,
'Busca status do pedido atraves do numero do pedido do cliente.',
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

String de toolDescription contém "atraves" (sem acento). Como é texto exibido ao usuário (descrição do tool), corrija para "através".

Suggested change
'[{"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.',

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants