| name | microsoft-365 |
| description | Microsoft 365 integration via Graph API. Create, read, modify, and delete SharePoint sites, lists, list items, document libraries, and files (Excel, Word, PowerPoint). Read/write Excel cells and ranges directly. Upload/download files to SharePoint drives. Use when interacting with Microsoft 365, SharePoint, OneDrive for Business, or Office documents on SharePoint.
|
Microsoft 365 — Graph API Skill
Authentication
Source the auth helper to get $GRAPH_TOKEN / $GRAPH_ACCESS_TOKEN:
source skills/microsoft-365/scripts/graph-auth.sh
Requires these values exported in the environment or via all-agents secrets export:
AZURE_VICTORIA_TENANT_ID
AZURE_VICTORIA_CLIENT_ID
AZURE_VICTORIA_CLIENT_SECRET
Do not put client secrets in command lines or checked-in files. All Graph API calls use:
-H "Authorization: Bearer $GRAPH_TOKEN".
Base URL: https://graph.microsoft.com/v1.0
Quick Reference
Sites
GET /sites?search=*
GET /sites/{site-id}
SharePoint Lists
GET /sites/{site-id}/lists
POST /sites/{site-id}/lists
{"displayName":"MyList","list":{"template":"genericList"},"columns":[{"name":"Col1","text":{}},{"name":"Col2","number":{}}]}
POST /sites/{site-id}/lists/{list-id}/items
{"fields":{"Title":"Item1","Col1":"value","Col2":42}}
PATCH /sites/{site-id}/lists/{list-id}/items/{item-id}/fields
{"Col1":"newValue"}
DELETE /sites/{site-id}/lists/{list-id}/items/{item-id}
DELETE /sites/{site-id}/lists/{list-id}
Files (Drive)
GET /sites/{site-id}/drive/root/children
PUT /sites/{site-id}/drive/root:/{filename}:/content
POST /sites/{site-id}/drive/root:/{filename}:/createUploadSession
GET /sites/{site-id}/drive/items/{item-id}/content
DELETE /sites/{site-id}/drive/items/{item-id}
GET /sites/{site-id}/drive/root:/{filename}
Excel (Online)
Read/write cells directly via workbook API — no download/reupload needed:
GET /sites/{site-id}/drive/items/{item-id}/workbook/worksheets/{sheet}/range(address='A1:B3')
PATCH /sites/{site-id}/drive/items/{item-id}/workbook/worksheets/{sheet}/range(address='A1:B2')
{"values":[["Name","Score"],["Alice",95]]}
POST /sites/{site-id}/drive/items/{item-id}/workbook/worksheets
{"name":"Sheet2"}
GET /sites/{site-id}/drive/items/{item-id}/workbook/worksheets
POST /sites/{site-id}/drive/items/{item-id}/workbook/tables/add
{"address":"A1:C5","hasHeaders":true}
POST /sites/{site-id}/drive/items/{item-id}/workbook/tables/{table-id}/rows
{"values":[["val1","val2","val3"]]}
Word & PowerPoint
Graph API does not support in-place content editing for Word/PowerPoint. Workflow:
- Create locally using
python-docx / python-pptx (pip packages)
- Upload via drive PUT endpoint
- Modify: Download → edit locally with python libs → re-upload
python3 -c "
from docx import Document
d = Document()
d.add_heading('Title', 0)
d.add_paragraph('Content here')
d.save('/tmp/output.docx')
"
python3 -c "
from pptx import Presentation
from pptx.util import Inches
p = Presentation()
slide = p.slides.add_slide(p.slide_layouts[0])
slide.shapes.title.text = 'Title'
slide.placeholders[1].text = 'Subtitle'
p.save('/tmp/output.pptx')
"
Python packages required: openpyxl, python-docx, python-pptx
Capabilities Matrix
| Feature | Supported | Method |
|---|
| SharePoint Sites — list/get | ✅ | Graph API |
| SharePoint Lists — full CRUD | ✅ | Graph API |
| SharePoint List columns — add/modify | ✅ | Graph API |
| Document Libraries — list/upload/download/delete | ✅ | Graph API |
| Excel — read/write cells & ranges | ✅ | Graph Workbook API (online) |
| Excel — create workbooks | ✅ | openpyxl → upload |
| Excel — add worksheets/tables | ✅ | Graph Workbook API |
| Word — create documents | ✅ | python-docx → upload |
| Word — modify existing | ✅ | Download → python-docx → re-upload |
| Word — in-place edit via API | ❌ | Not supported by Graph |
| PowerPoint — create presentations | ✅ | python-pptx → upload |
| PowerPoint — modify existing | ✅ | Download → python-pptx → re-upload |
| PowerPoint — in-place edit via API | ❌ | Not supported by Graph |
| Files >4MB upload | ✅ | Upload session (resumable) |
| Create SharePoint sites | ⚠️ | Requires Sites.FullControl.All |
| OneNote | ⚠️ | Separate API, not covered here |
| Outlook/Teams | ⚠️ | Separate skills needed |
Notes
- Excel workbook API works on files already in SharePoint/OneDrive — upload first, then manipulate
- Add
Prefer: respond-async header for long-running Excel operations
- SharePoint list item IDs are integers, file item IDs are alphanumeric
- For file operations, get item ID via:
GET /sites/{site-id}/drive/root:/{filename}
- Token is app-only (client credentials) — actions appear as "SharePoint App" in audit logs