microsoft-excel
Installation
SKILL.md
Drive live Excel workbooks via the Microsoft Graph workbook API with
curl + jq. The user's OAuth bearer token is in $MICROSOFT_EXCEL_TOKEN; every
call needs Authorization: Bearer $MICROSOFT_EXCEL_TOKEN. Base URL:
https://graph.microsoft.com/v1.0. The workbook API operates on a drive item
(an .xlsx in OneDrive/SharePoint), so you need its ITEM_ID.
Failures are {"error":{"code","message"}} — show message verbatim. 401 =
token expired (re-install). 403 on a write = the user granted read-only.
G="https://graph.microsoft.com/v1.0"; AUTH="Authorization: Bearer $MICROSOFT_EXCEL_TOKEN"
# Find the workbook by name (then take .id as ITEM_ID)
curl -sS -H "$AUTH" "$G/me/drive/root/search(q='budget.xlsx')" \
| jq '.value[] | {id, name, webUrl}'
# Worksheets in the workbook
curl -sS -H "$AUTH" "$G/me/drive/items/ITEM_ID/workbook/worksheets" \
| jq '.value[] | {id, name, position}'