skill-m365-copilot-mail-search

Search Outlook emails and calendar events via the Microsoft Graph Search API.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/tobiascm/vobes-agent-vscode --skill skill-m365-copilot-mail-search
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: skill-m365-copilot-mail-search
Source: https://github.com/tobiascm/vobes-agent-vscode/tree/main/.agents/skills/skill-m365-copilot-mail-search
Command: npx skills add https://github.com/tobiascm/vobes-agent-vscode --skill skill-m365-copilot-mail-search

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires requests, and includes scripts (resource) components.

What problem does it solve?

This skill enables fast discovery of relevant Outlook emails and calendar events by querying the Microsoft Graph Search API, reducing manual triage time and surfacing contextual information.

Core Features & Use Cases

  • Perform mail searches across the user's mailbox using Graph Search endpoint /v1.0/search/query, retrieving subject, sender, date, and a preview.
  • Optionally search calendar events with the --events mode, returning event basics and a link, for planning or follow-ups.
  • Handle token resolution via dedicated m365_copilot_mail_search_token.py, support Mail.Read and Calendars.Read scopes, and provide robust error handling for scope gaps and token expiry.

Quick Start

Run a query like "from:alex subject:budget" to fetch matching mails (and calendar events if requested) and view concise results.

Frequently Asked Questions about skill-m365-copilot-mail-search

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I search Outlook emails by sender and subject using Microsoft Graph?

You can search Outlook emails by querying the Microsoft Graph Search API with parameters like sender, subject, or date to return compact results including previews and attachments.

Can I retrieve calendar events from Microsoft Graph in the same query as mail?

Yes, you can fetch calendar events alongside mail search by using the --events mode, which returns event basics and a link, requiring Calendars.Read token scope.

What permissions are required to access Outlook mail through the Graph Search API?

Accessing Outlook mail requires a Bearer token with the Mail.Read scope, while searching calendar events requires the Calendars.Read scope to authenticate Graph API requests.

How does token resolution work for Microsoft Graph mail and calendar queries?

Token resolution uses a dedicated Python resolver backed by a Playwright bridge, providing error handling for missing scopes or expired tokens during Graph API authentication.

What is the best way to find Outlook emails with attachments via Graph API?

The best way to find Outlook emails with attachments is using the hasAttachment query parameter within the Graph Search API endpoint to filter and retrieve matching messages.

Why does my Microsoft Graph search query fail with a token scope error?

Graph search queries fail with token scope errors when the Bearer token lacks required permissions like Mail.Read, or when the token has expired and needs re-resolving.