MCP server › Sample workflows

Audit the collection estate

A compliance question an auditor has to be able to answer without touching anything: what collectors exist, what is each one scoped to, and is anything running right now? This walkthrough covers the collector-inventory and monitoring tools end to end. The sample runs against the DataTap-hosted Enron corpus, whose seeded tenant carries four collectors including one scoped to all six collected mailboxes. Read-only throughout.

The tool sequence

Step 1 lists every collector. Step 2 inspects one individually. Step 3 filters the inventory to what is currently running. Steps 4–5 check the tenant-wide monitoring view, which uses a different response envelope than the plain inventory list:

// 1 · Enumerate every configured collector.
//     Note the envelope: a bare array, not the { Items, Options, Total }
//     page the monitoring tools below use.
{"tool": "list_collectors", "arguments": {}}
// → [{ Id, Name, Type: "BACKUP", State, Policy: { "$type": "…", … } }, …]

// 2 · Inspect one collector in full, by Id from step 1.
{"tool": "get_collector", "arguments": { "collectorId": "<id-from-step-1>" }}
// → Policy.$type selects the connector at runtime — one of
//   "exchange-backup" | "onedrive-backup" | "sharepoint-backup" | "teams-backup"

// 3 · Filter to only the collectors currently running.
{"tool": "list_collectors", "arguments": { "running": true } }
// → a subset of step 1's Ids — never a superset.

// 4 · Check what is running right now, across the whole tenant.
//     Uses the { Items, Options, Total } page envelope, even when
//     nothing is running (Total: 0, Items: []) rather than an error.
{"tool": "list_running_collectors", "arguments": {}}

// 5 · Narrow the running check to one connector.
{"tool": "list_running_collectors", "arguments": { "connector": "EXCHANGE" }}

The seeded estate

The corpus tenant carries four named collectors — an Exchange backup and a OneDrive backup scoped to the sample accounts, a narrower “3 folders” OneDrive collector, and one Exchange collector scoped to all six collected custodians at once:

NamePolicy $type
Exchange Backup — Enron Sampleexchange-backup
OneDrive Backup — Enron Sampleonedrive-backup
Viewer — 3 Foldersonedrive-backup
Enron Corpus — 6 Shared Mailboxes Backupexchange-backup

How a collector is scoped

Inspecting “Enron Corpus — 6 Shared Mailboxes Backup” via get_collector shows its Policy.Users array holding exactly six entries — one per collected custodian. Each entry addresses its mailbox by Item.Id, a bare node guid, never by email address: passing an email where the tool expects this node id silently collects nothing, since the scoping match is on the guid alone. The six Item.Name values across those entries are exactly the six accounts get_collection_stats reports on the capacity review dashboard.

Extend it. Combine list_collectors with get_collector_status (per-task) or get_running_collector_accounts (per-account, for a running job) to build a live dashboard rather than a point-in-time snapshot.

← Previous sample: Quarterly capacity review · Back to MCP server →