소스 정보
- 저장소
- fabioc-aloha/BrainBenchmark
- 최근 소스 활동
- 2026년 3월 8일 18:06
- 감지된 SKILL.md 언어
- 영어
- 스타
- 0
- 포크
- 0
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/fabioc-aloha/BrainBenchmark --skill microsoft-graph-api명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
Patterns for thesis writing, dissertations, research papers, literature reviews, scholarly work, and venue-specific publication drafting
Debug skill/hook/agent loading issues using VS Code's Agent Debug Panel
**Domain**: AI/ML Architecture
SOC 직업 분류 기준
SKILL.md 표시 중
| name | microsoft-graph-api |
| description | Comprehensive Microsoft Graph API reference for M365 service integration |
| user-invokable | false |
Comprehensive reference for Microsoft Graph API integration including endpoints, authentication, rate limiting, and best practices.
Microsoft Graph APIs evolve frequently. Permissions, endpoints, and authentication flows may change.
Refresh triggers:
Last validated: February 2026 (Graph v1.0, MSAL 2.x)
Check current state: Graph Explorer, Graph API Reference
| Environment | URL |
|---|---|
| Production (v1.0) | https://graph.microsoft.com/v1.0 |
| Beta | https://graph.microsoft.com/beta |
| China (21Vianet) | https://microsoftgraph.chinacloudapi.cn/v1.0 |
Best Practice: Use v1.0 for production. Beta endpoints can change without notice.
| Method | Header | Use Case |
|---|---|---|
| Delegated (user) | Authorization: Bearer {token} | Interactive apps — acts on behalf of signed-in user |
| Application | Authorization: Bearer {token} | Background services — acts as the app itself |
Token Acquisition (VS Code Extension):
// Progressive scope acquisition — request minimal scopes initially
const INITIAL_SCOPES = ['User.Read'];
const FULL_SCOPES = [
'User.Read',
'Calendars.Read',
'Mail.Read',
'Presence.Read',
'People.Read',
'Group.Read.All'
];
async function getGraphToken(): Promise<string | null> {
const session = await vscode.authentication.getSession(
'microsoft',
FULL_SCOPES,
{ createIfNone: false }
);
return session?.accessToken ?? null;
}
| Scope | Purpose |
|---|---|
User.Read | Read signed-in user profile |
User.ReadBasic.All | Read basic profile of all users |
Mail.Read | Read user mail |
Mail.Send | Send mail as the user |
Calendars.Read | Read user calendar events |
Calendars.ReadWrite | Create/update calendar events |
Presence.Read | Read user presence status |
People.Read | Read user's relevant people |
Group.Read.All | Read all groups |
Sites.Read.All | Read SharePoint sites |
Files.Read.All | Read all files user can access |
Tasks.Read | Read user's tasks (To Do) |
Tasks.ReadWrite | Create/update tasks (Planner/To Do) |
| Scope | Purpose |
|---|---|
User.Read.All | Read all user profiles (app-only) |
Group.Read.All | Read all groups (app-only) |
Mail.Read | Read all users' mail (requires admin consent) |
AuditLog.Read.All | Read audit logs |
Reports.Read.All | Read M365 usage reports |
ServiceHealth.Read.All | Read M365 service health |
Principle of Least Privilege: Request only the scopes your app actually needs. Start with
User.Readand add incrementally.
| Operation | Method | Endpoint |
|---|---|---|
| Get current user | GET | /me |
| Get user by ID/UPN | GET | /users/{id-or-upn} |
| List users | GET | /users |
| Get user photo | GET | /me/photo/$value |
| Get manager | GET | /me/manager |
| Get direct reports | GET | /me/directReports |
| Operation | Method | Endpoint |
|---|---|---|
| List messages | GET | /me/messages |
| Get message | GET | /me/messages/{message-id} |
| Send mail | POST | /me/sendMail |
| List mail folders | GET | /me/mailFolders |
| Operation | Method | Endpoint |
|---|---|---|
| List events | GET | /me/calendar/events |
| Calendar view | GET | /me/calendarView?startDateTime={start}&endDateTime={end} |
| Create event | POST | /me/calendar/events |
| Get event | GET | /me/events/{event-id} |
| Operation | Method | Endpoint |
|---|---|---|
| Get my presence | GET | /me/presence |
| Get user presence | GET | /users/{id}/presence |
| Get presence for multiple | POST | /communications/getPresencesByUserId |
| Operation | Method | Endpoint |
|---|---|---|
| List relevant people | GET | /me/people |
| Get trending docs | GET | /me/insights/trending |
| Get used docs | GET | /me/insights/used |
| Get shared docs | GET | /me/insights/shared |
| Operation | Method | Endpoint |
|---|---|---|
| List sites | GET | /sites |
| Get site by path | GET | /sites/{hostname}:/{server-relative-path} |
| List drives | GET | /me/drives |
| List drive items | GET | /me/drive/root/children |
| Search files | GET | /me/drive/root/search(q='{query}') |
| Upload file | PUT | /me/drive/items/{parent-id}:/{filename}:/content |
| Operation | Method | Endpoint |
|---|---|---|
| List plans for group | GET | /groups/{group-id}/planner/plans |
| List tasks in plan | GET | /planner/plans/{plan-id}/tasks |
| Create task | POST | /planner/tasks |
| Update task | PATCH | /planner/tasks/{task-id} |
| Get user tasks | GET | /me/planner/tasks |
Note: Planner only supports delegated permissions. Application permissions are not available.
| Operation | Method | Endpoint |
|---|---|---|
| List task lists | GET | /me/todo/lists |
| Create task list | POST | /me/todo/lists |
| List tasks | GET | /me/todo/lists/{list-id}/tasks |
| Create task | POST | /me/todo/lists/{list-id}/tasks |
| Update task | PATCH | /me/todo/lists/{list-id}/tasks/{task-id} |
| Operation | Method | Endpoint |
|---|---|---|
| List groups | GET | /groups |
| Get group | GET | /groups/{group-id} |
| List group members | GET | /groups/{group-id}/members |
| List joined teams | GET | /me/joinedTeams |
| Get team channels | GET | /teams/{team-id}/channels |
| Post channel message | POST | /teams/{team-id}/channels/{channel-id}/messages |
| Operation | Method | Endpoint | Scope |
|---|---|---|---|
| List health overviews | GET | /admin/serviceAnnouncement/healthOverviews | ServiceHealth.Read.All |
| List active issues | GET | /admin/serviceAnnouncement/issues | ServiceHealth.Read.All |
| Get issue detail | GET | /admin/serviceAnnouncement/issues/{id} | ServiceHealth.Read.All |
| List message center | GET | /admin/serviceAnnouncement/messages | ServiceMessage.Read.All |
Rate limit: 1,500 requests / 10 minutes
| Operation | Method | Endpoint | Scope |
|---|---|---|---|
| List directory audits | GET | /auditLogs/directoryAudits | AuditLog.Read.All |
| List sign-in logs | GET | /auditLogs/signIns | AuditLog.Read.All |
| List provisioning logs | GET | /auditLogs/provisioning | AuditLog.Read.All |
Rate limit: Security endpoints = 150 requests / 10 minutes
| Operation | Method | Endpoint | Scope |
|---|---|---|---|
| List labels | GET | /informationProtection/policy/labels | InformationProtectionPolicy.Read |
| Evaluate classification | POST | /informationProtection/policy/labels/evaluateClassificationResults | InformationProtectionPolicy.Read |
| Extract label | POST | /informationProtection/policy/labels/extractLabel | InformationProtectionPolicy.Read |
export class GraphRateLimitError extends Error {
public readonly retryAfter: number;
constructor(retryAfter: number, message = '') {
super(`Rate limited. Retry after ${retryAfter}s. ${message}`);
this.name = 'GraphRateLimitError';
this.retryAfter = retryAfter;
}
}
export class GraphApiError extends Error {
public readonly statusCode: number;
public readonly errorCode: string;
constructor(statusCode: number, errorCode: string, message: string) {
super(`Graph API ${statusCode} (${errorCode}): ${message}`);
this.name = 'GraphApiError';
this. = statusCode;
. = errorCode;
}
}
const GRAPH_ENDPOINT = 'https://graph.microsoft.com/v1.0';
const DEFAULT_TIMEOUT_MS = 30000;
const DEFAULT_MAX_RETRIES = 3;
async function graphRequest<T>(
method: 'GET' | 'POST' | 'PATCH' | 'DELETE',
endpoint: string,
options: RequestInit = {},
config: { timeoutMs?: number; maxRetries?: number; throwOnError?: boolean } = {}
): Promise<T | null> {
const token = await getGraphToken();
if (!token) return null;
const { timeoutMs = DEFAULT_TIMEOUT_MS, maxRetries = DEFAULT_MAX_RETRIES, throwOnError = false } = config;
for (let attempt = 0; attempt <= maxRetries; attempt++) {
const controller = new AbortController();
const timeoutId = setTimeout(() => controller.abort(), timeoutMs);
{
response = (, {
method,
...options,
: controller.,
: { : , ...options. }
});
(timeoutId);
(response. === ) {
retryAfter = (response..() || );
(attempt < maxRetries) {
( (r, retryAfter * ));
;
}
(throwOnError) (retryAfter);
;
}
(response. >= && attempt < maxRetries) {
( (r, .(, attempt) * ));
;
}
(!response.) {
(throwOnError) {
err = response.().( ({}));
(response., err?.?. || , err?.?. || response.);
}
;
}
response.();
} (error) {
(timeoutId);
(error && error. === && attempt < maxRetries) {
( (r, .(, attempt) * ));
;
}
error;
}
}
;
}
Graph supports standard OData query parameters:
| Parameter | Example | Purpose |
|---|---|---|
$select | ?$select=id,displayName,mail | Return only specified properties |
$filter | ?$filter=department eq 'Engineering' | Filter results server-side |
$orderby | ?$orderby=displayName | Sort results |
$top | ?$top=10 | Limit result count |
$skip | ?$skip=20 | Skip N results (not all APIs) |
$expand | ?$expand=manager | Include related resources inline |
$count | ?$count=true | Include total count in response |
$search | ?$search="displayName:Fabio" | Full-text search |
Combining parameters:
GET /users?$select=id,displayName,department&$filter=department eq 'Analytics'&$top=25&$orderby=displayName
Not all endpoints support all parameters. Check specific endpoint docs.
Graph uses @odata.nextLink for pagination:
async function graphFetchAll<T>(path: string): Promise<T[]> {
const token = await getGraphToken();
if (!token) return [];
const results: T[] = [];
let url: string | null = `${GRAPH_ENDPOINT}${path}`;
while (url) {
const response = await fetch(url, {
headers: { 'Authorization': `Bearer ${token}` }
});
const data = await response.json();
results.push(...(data.value || []));
url = data['@odata.nextLink'] || null;
}
return results;
}
Combine up to 20 requests in a single HTTP call:
interface BatchRequest {
id: string;
method: 'GET' | 'POST' | 'PATCH' | 'DELETE';
url: string;
body?: unknown;
}
async function graphBatch<T>(requests: BatchRequest[]): Promise<Map<string, T>> {
if (requests.length > 20) {
console.warn('Batch limit is 20, use graphBatchAll() for unlimited');
requests = requests.slice(0, 20);
}
const response = await graphPost<{ responses: Array<{ id: string; status: number; body: T }> }>(
'/$batch',
{ requests }
);
const results = new Map<string, T>();
for (const resp of response?.responses || []) {
if (resp.status >= 200 && resp.status < ) {
results.(resp., resp.);
}
}
results;
}
graphBatchAll<T>(: []): <<, T>> {
allResults = <, T>();
( i = ; i < requests.; i += ) {
chunk = requests.(i, i + );
chunkResults = graphBatch<T>(chunk);
( [id, body] chunkResults) {
allResults.(id, body);
}
}
allResults;
}
function buildBatchRequest(
method: 'GET' | 'POST' | 'PATCH' | 'DELETE',
url: string,
body?: unknown,
requestId?: string
): BatchRequest {
return {
id: requestId || Math.random().toString(36).substring(2, 10),
method,
url,
body,
};
}
| Service | Per App per Tenant | Notes |
|---|---|---|
| Outlook (Mail/Calendar) | 10,000 requests / 10 min | Standard throttling |
| Teams | Varies by endpoint | Channel messages more restrictive |
| SharePoint/OneDrive | Based on concurrent calls | Use batching |
| Directory (Users/Groups) | 10,000 requests / 10 min | Standard throttling |
| Service Health | 1,500 requests / 10 min | Lower limit - cache results |
| Security (Alerts/Incidents) | 150 requests / 10 min | Much lower - batch carefully |
| Audit Logs | 1,000 requests / 10 min | Lower limit - paginate wisely |
HTTP/1.1 429 Too Many Requests
Retry-After: 30
$select to request only needed properties$filter server-side instead of fetching all and filtering locally| Token | Default Lifetime |
|---|---|
| Access token | 60-90 minutes |
| Refresh token | Up to 90 days |
| ID token | 60 minutes |
Always use MSAL rather than raw OAuth. MSAL handles caching, refresh, and retry automatically.
| Language | Package | Notes |
|---|---|---|
| TypeScript/JS | @microsoft/microsoft-graph-client | Official SDK |
| Python | msgraph-sdk-python | Official SDK |
| PowerShell | Microsoft.Graph | Install-Module Microsoft.Graph |
| .NET | Microsoft.Graph | NuGet package |
| Feature | Endpoint | Alex Usage |
|---|---|---|
| Calendar context | /me/calendarView | Meeting prep, scheduling awareness |
| Email context | /me/messages | Communication context |
| Send email | /me/sendMail | Proactive notifications, weekly reports |
| Presence | /me/presence | Availability in status |
| People | /me/people | Org context, relevant contacts |
| OneDrive | /me/drive | Knowledge file sync |
| OneDrive upload | /me/drive/root:/{path}:/content | File archival, exports |
| Service Health | /admin/serviceAnnouncement/healthOverviews | Alex-aware service status |
| Service Issues | /admin/serviceAnnouncement/issues | Proactive troubleshooting |
| Sensitivity Labels | /me/informationProtection/sensitivityLabels | Document classification |
→ [enterprise-integration skill] AUTH_PATTERNS_AND_SCOPES (strong, bidirectional)
→ [vscode-extension-patterns skill] VSCODE_AUTH_SESSION_API (strong, outbound)
→ [alex-core] ENTERPRISE_MODE_GATING (strong, inbound)
→ [localization skill] USER_PREFERRED_LANGUAGE_FROM_GRAPH (moderate, outbound)
→ [GI-heir-promotion-pattern-graph-api-2026-02-12] PROMOTION_CASE_STUDY (strong, origin)
→ [FishbowlGovernance DK-MICROSOFT-GRAPH.md] HEIR_SOURCE_KNOWLEDGE (strong, inbound)
→ [error-handling-patterns] CUSTOM_ERROR_TYPES (moderate, outbound)
→ [api-design patterns] BATCH_AUTO_CHUNKING_PATTERN (strong, outbound)