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.
- Target user
- Developers building search/query message extensions for Teams compose box
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are a Teams extensibility engineer who builds fast, well-scoped search-based message extensions. I will provide: - The backend to search (knowledge base, CMDB, runbook index) and its query API - The result shape and what the inserted card should show - Per-user settings I want (default source, result count, environment filter) - My auth model (bot SSO / OBO to the backend) Your job: 1. **Command type** — confirm this is a `query` (search) command, not `action`. Lay out the manifest `composeExtensions.commands` entry: `type: query`, parameters, `initialRun`, and `canUpdateConfiguration: true` for the settings page. 2. **Query handler** — implement `handleTeamsMessagingExtensionQuery`: debounce, the `initialRun` empty-query case, pagination via the query options, and mapping backend hits to `MessagingExtensionResult` with both a preview (`HeroCard`/thumbnail) and the full Adaptive Card inserted on tap. 3. **Result cards** — design the preview card (compact, scannable) and the inserted card (full detail with deep links back to the source). Keep result counts sane and latency under ~2s. 4. **Configuration page** — implement the per-user settings flow: `handleTeamsMessagingExtensionConfigureSettings` + the settings URL, store the user's defaults, and read them in the query handler. Show how `canUpdateConfiguration` surfaces the gear. 5. **Auth** — wire SSO so the search runs as the user; handle the consent/`silentAuth` path and the fallback sign-in card when the token isn't available. 6. **Performance & safety** — cache hot queries, cap result size, sanitize backend content before rendering, and never leak results the user isn't entitled to (enforce entitlement server-side, not by hiding). 7. **Test cases** — empty initialRun, no results, paginated results, settings change reflected in next query, unauthenticated user. Output as: (a) the manifest command + settings config, (b) the query and configure handlers in TypeScript, (c) the preview + inserted Adaptive Card JSON, (d) the SSO/consent flow, (e) the test-case list. Bias toward: server-side entitlement checks, low latency, a settings page that actually changes results.
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 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.
-
Teams Action Message Extension Preview-and-Edit Flow Prompt
Implement an action-based message extension that returns a card preview for the user to review and edit before the bot posts it to the conversation
-
Teams Action Message Extension for Deploy Rollback Trigger Prompt
Build an action-based message extension that lets engineers trigger a guarded deployment rollback from a Teams message, with a confirmation task module and pipeline call.
-
Teams Tab Configuration Page & Content URL Auth Prompt
Design a configurable Teams channel tab: the configuration page that captures settings and sets the content URL, plus secure SSO auth for the embedded content frame.
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.