/copilot-managed-runtime:add-office365from copilot-managed-runtime
Adds the Office 365 Outlook connector via /add-data-source (api-id shared_office365) and guides method selection for Outlook mail and calendar operations.
Ships in copilot-managed-runtime. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
📋 Shared Instructions: shared-instructions.md — Cross-cutting concerns.
This skill is a thin wrapper. Use /add-data-source as the single implementation path.
Invoke /add-data-source with:
api-id: shared_office365mode: actionAfter the connector is added, you'll have access to Office365OutlookService with 20+ methods. Use this guide to select the right method for your use case.
GetEventsCalendarViewV2Best for: Meeting lists, calendar views, event queries between two dates (e.g., "past 7 days", "next 30 days").
Key Parameters:
calendarId (string) — Always discover using CalendarGetTables() firststartDateTimeOffset (ISO 8601 string) — Use .toISOString()endDateTimeOffset (ISO 8601 string) — Use .toISOString()top, skip (optional) — For pagination (200-1000 range typical)Pattern:
import { Office365OutlookService } from '../../generated/services/Office365OutlookService'
// Step 1: Discover calendar ID (validate and prefer primary calendar)
const calendarsResult = await Office365OutlookService.CalendarGetTables()
if (!calendarsResult.success) {
throw new Error(calendarsResult.error?.message ?? 'Failed to list calendars')
}
const calendars = calendarsResult.data?.value ?? []
if (calendars.length === 0) {
throw new Error('No calendars found in Office 365 connection')
}
// Prefer primary 'calendar' (by DisplayName), fall back to first
const defaultCalendar =
calendars.find((c: any) => (c.DisplayName ?? '').toLowerCase() === 'calendar')
?? calendars[0]
const calendarId = defaultCalendar?.Name ?? calendars[0]?.Name
if (!calendarId) {
throw new Error('Could not determine calendar ID from response')
}
// Step 2: Query events with pagination
const eventsResult = await Office365OutlookService.GetEventsCalendarViewV2(
calendarId,
startDate.toISOString(),
endDate.toISOString(),
undefined, // filter (optional)
undefined, // select (optional)
200, // top - results per page
0 // skip - pagination offset
)
if (!eventsResult.success) {
throw new Error(eventsResult.error?.message ?? 'Failed to fetch events')
}
const meetings = eventsResult.data?.value ?? []
Response Structure:
CalendarEventClientReceiveStringEnums (access via .data.value)Subject, Start, End, Id, Organizer, RequiredAttendees, OptionalAttendeesOnUpcomingEventsV3Best for: "Show me my next meeting" queries using a minutes-based time window.
Key Parameters:
table (string) — Calendar IDminutesWindow (number) — Time window in minutes (e.g., 60 for next hour, 1440 for next 24 hours)V3CalendarPostItemParameters:
table — Calendar IDitem — CalendarEventHtmlClient object with Subject, Start, End (required)CalendarPatchItemParameters:
table — Calendar IDid — Event IDitem — Updated event propertiesCalendarDeleteItemParameters:
table — Calendar IDid — Event IDCalendarGetTablesPurpose: List available calendars to discover correct calendar IDs (required before using other calendar methods)
SendEmailV2Best for: Sending notifications, alerts, summaries.
Pattern:
const result = await Office365OutlookService.SendEmailV2({
To: '[email protected]',
Subject: 'Meeting Summary',
Body: '<p>Here is your meeting summary...</p>',
Importance: 'Normal'
})
GetEmailsParameters:
folderPath (string) — E.g., "Inbox", "Drafts"fetchOnlyUnread (boolean) — Filter for unread emailstop (number) — LimitGetEmailParameters:
messageId (string) — Email IDMarkAsReadParameters:
messageId (string) — Email IDReplyToV3Parameters:
messageId (string) — Email ID to reply tobody (string) — Reply text📋 Generic connector response handling: shared-instructions.md — Error handling, array access (.data.value), empty results, and response structure patterns apply to all connectors, including Office 365.
1. Always discover calendar ID first using CalendarGetTables()
This ensures you have the correct calendar ID for the user (don't hardcode "Calendar").
2. Use ISO date strings for date parameters
Use .toISOString() when passing dates to Office 365 methods.
3. Calendar ID Discovery - CRITICAL
⚠️ NEVER use hardcoded 'Calendar' as calendar ID. Always discover from the user's actual calendars.
// ❌ BROKEN - Will fail for users whose primary calendar isn't named 'Calendar'
const calendarId = 'Calendar'
// ✅ CORRECT - Discover actual calendar IDs
const calendarsResult = await Office365OutlookService.CalendarGetTables()
const calendars = calendarsResult.data?.value ?? []
// Validate calendars exist
if (calendars.length === 0) {
throw new Error('No calendars found')
}
// Prefer primary calendar by DisplayName, otherwise use first
const primaryCalendar =
calendars.find((c: any) => (c.DisplayName ?? '').toLowerCase() === 'calendar')
?? calendars[0]
// Extract the actual calendar ID from response
const calendarId = primaryCalendar?.Name
if (!calendarId) {
throw new Error('Could not extract calendar ID from Office 365 response')
}
Why this matters:
"Calendar""Calendar"What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub microsoft/copilot-managed-runtime --plugin copilot-managed-runtime25 skills in this plugin
/add-azuredevopsAdds Azure DevOps by delegating to `/add-data-source` with `api-id=shared_visualstudioteamservices` and action mode. Use when adding Azure DevOps integration./add-backendAdd a Fabric backend (preview) with `ms app add backend --provider fabric`. Covers database entities and client integration using the Rayfin runtime. Use only when the user explicitly requests a database, /add-backend, Fabric, or Rayfin./add-data-sourceCanonical add flow for Copilot Managed Runtime. Use when adding any data source through `ms app add data-source` (with `--as table` or `--as action`), or when the user wants help discovering which connector / api-id to use.Other plugins' skills for the same job