Skip to content

Commit 415de6c

Browse files
authored
Merge pull request #8 from WebexCommunity/claude/card-webhook-limitations-xgbkc
2 parents 4ab0ee3 + 694cac2 commit 415de6c

2 files changed

Lines changed: 55 additions & 2 deletions

File tree

src/webex_bot_mcp/main.py

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,36 @@ def webex_adaptive_cards_guide():
211211
| `Action.ShowCard` | Expand an inline nested card |
212212
| `Action.ToggleVisibility` | Show/hide elements by ID |
213213
214+
## ⚠️ Webhook Limitation — Card Submissions
215+
216+
**Action.Submit (and any interactive card action) requires a registered webhook to work.**
217+
218+
When a user clicks a submit button on an Adaptive Card, Webex posts the submission
219+
payload to the bot's registered webhook for the `attachmentActions` resource. If no
220+
such webhook exists, **the submission is silently dropped** — the bot never sees it.
221+
222+
This MCP server can *send* cards but cannot *receive* webhook events on its own. Before
223+
using interactive cards (forms, approval buttons, etc.), the user must:
224+
225+
1. Expose a public HTTPS endpoint that can receive POST requests from Webex.
226+
2. Register a webhook via the Webex Webhooks API:
227+
```
228+
POST https://webexapis.com/v1/webhooks
229+
{
230+
"name": "Card Actions",
231+
"targetUrl": "https://your-bot.example.com/webhook",
232+
"resource": "attachmentActions",
233+
"event": "created"
234+
}
235+
```
236+
3. Parse the incoming `attachmentAction` payload in the bot's webhook handler.
237+
238+
**Always inform the user of this requirement when the card contains Action.Submit,
239+
Input.*, or any other interactive element that posts data back to the bot.**
240+
241+
Non-interactive actions (`Action.OpenUrl`, `Action.ShowCard`, `Action.ToggleVisibility`)
242+
work entirely on the client side and do **not** require a webhook.
243+
214244
## Workflow: Build then Send
215245
216246
### Option A — High-level builder (recommended)
@@ -919,7 +949,8 @@ def webex_design_adaptive_card_prompt():
919949
920950
Follow these steps:
921951
922-
1. Read the webex://help/adaptive-cards resource for schema reference.
952+
1. Read the webex://help/adaptive-cards resource for schema reference, including the
953+
Webhook Limitation section.
923954
924955
2. Call build_webex_adaptive_card with appropriate inputs:
925956
- title: concise, action-oriented heading
@@ -936,7 +967,15 @@ def webex_design_adaptive_card_prompt():
936967
- card_body and card_actions from step 2
937968
- fallback_text: a plain-text summary for clients that don't support cards
938969
939-
5. Report the message ID and a summary of what was sent.
970+
5. IMPORTANT — if the card contains any interactive actions (Action.Submit, Input.*
971+
elements, or any action that posts data back to the bot), explicitly warn the user:
972+
"Card submissions will not reach the bot unless you have registered an
973+
attachmentActions webhook pointing at your bot's public HTTPS endpoint. See the
974+
webex://help/adaptive-cards guide for setup instructions."
975+
Skip this warning only if all actions are non-interactive (Action.OpenUrl,
976+
Action.ShowCard, Action.ToggleVisibility).
977+
978+
6. Report the message ID and a summary of what was sent.
940979
941980
If the use case requires custom schema elements not supported by build_webex_adaptive_card
942981
(e.g. Input fields, nested ShowCard actions), construct card_body manually as a list of

src/webex_bot_mcp/tools/messages.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,14 @@ def send_webex_adaptive_card(
430430
Adaptive Cards are rich, interactive message attachments. Clients that do not
431431
support cards will display fallback_text instead.
432432
433+
IMPORTANT — Webhook limitation: Card action submissions (Action.Submit) are
434+
delivered to the bot only if a webhook is registered for the
435+
"attachmentActions" resource on the Webex platform. Without that webhook,
436+
submissions are silently dropped and the bot never receives them. Inform the
437+
user of this limitation whenever the card includes interactive actions. To
438+
receive submissions, a webhook must be created at developer.webex.com or via
439+
the Webex Webhooks API targeting the bot's public HTTPS endpoint.
440+
433441
Args:
434442
room_id: Room ID to send the card to (use this OR to_person_id/to_person_email)
435443
to_person_id: Person ID to send a direct card to
@@ -598,6 +606,12 @@ def send_webex_space_adaptive_card(
598606
Send an Adaptive Card to a Webex space or person.
599607
Note: This is an alias for send_webex_adaptive_card — "room" and "space" are synonymous in Webex.
600608
609+
IMPORTANT — Webhook limitation: Card action submissions (Action.Submit) are
610+
delivered to the bot only if a webhook is registered for the
611+
"attachmentActions" resource on the Webex platform. Without that webhook,
612+
submissions are silently dropped and the bot never receives them. Inform the
613+
user of this limitation whenever the card includes interactive actions.
614+
601615
Args:
602616
space_id: Space ID to send the card to (use this OR to_person_id/to_person_email)
603617
to_person_id: Person ID to send a direct card to

0 commit comments

Comments
 (0)