Teams Message Extension for Incident Lookup Prompt
Design a Teams search-based message extension that lets engineers query incidents, runbooks, and dashboards inline from the compose box and paste rich adaptive cards into any chat or channel.
- Target user
- App developers building search/action message extensions for ChatOps
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a senior Teams app developer who has built message extensions that engineers actually keep installed. I want a search-based (and optionally action-based) message extension so anyone can type `INC-1234` or a service name in the compose box and paste a live incident card into the conversation. I will provide: - My system of record (PagerDuty / ServiceNow / Jira / internal API) and its search API - The card content I want (incident summary, severity, status, commander, links) - Hosting details (bot endpoint, AAD app, SSO availability) - Whether I also want an action command (e.g. "Create incident from this message") Your job: 1. **Pick the extension type(s)** — explain search vs action commands and when to use each. For lookup, default to search; for "create from message", add an action command with a task module form. 2. **Manifest** — produce the `composeExtensions` block: command id, type `query`, parameters, `initialRun`, and any `fetchTask` for action commands. Flag the scopes (`personal`, `team`, `groupchat`). 3. **Query handler** — implement `handleTeamsMessagingExtensionQuery`: debounce, call the backend search, and return a result list where each item has a compact preview card AND a full adaptive card for insertion. Handle empty/zero-result and error states with a helpful card. 4. **SSO / auth** — wire token exchange so the extension calls the backend AS the user (on-behalf-of), with a sign-in result card fallback when consent is missing. Never embed a service token in the card. 5. **Card design** — an adaptive card with severity color, key facts, and buttons (Open in PagerDuty, Open runbook, Join bridge). Keep it readable when pasted into a noisy channel. 6. **Action command flow** (if requested) — task module form → validate → create the record → return a confirmation card with the new id. 7. **Rate limits & caching** — cache hot lookups, respect backend quotas, and degrade gracefully. Output as: (a) the manifest `composeExtensions` JSON, (b) the query + (optional) action handlers in my stack, (c) the SSO token-exchange code, (d) preview + full card templates, (e) a test matrix across personal/channel/group-chat scopes. Bias toward: acting as the user not a service principal, scannable cards, and explicit empty/error states over silent failures.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Teams Search-Based Message Extension with Config Page Prompt
Build a search-based (query) message extension that lets users search a backend (KB, CMDB, runbooks) inline and insert a result card, with a configurable settings page per user.
-
Teams Action Message Extension for Incident Creation Prompt
Design an action-type message extension that opens a task module form from the compose box or a message, collects incident fields, and creates the incident in your tracker — distinct from search/lookup extensions.
-
Teams Link Unfurling Message Extension Prompt
Build a message extension that auto-unfurls pasted incident, PR, dashboard, and runbook URLs into rich Adaptive Card previews directly in the Teams compose box.
-
Teams Adaptive Card Backup Job Status Digest Prompt
Design a Microsoft Teams Adaptive Card that summarizes nightly backup job outcomes — success/failure counts, failed jobs with reason, RPO breaches, and restore-test status — for the platform team.
More Microsoft Teams prompts & error guides
Browse every Microsoft Teams prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.