Agent skill

Msgraph

by merill in merill/msgraph

Up-to-date Microsoft Graph API knowledge for AI agents. An agent skill from merill/msgraph.

MITAuto-check passedBackend & APIs

Install Msgraph

skills CLI
$ npx skills add merill/msgraph --skill msgraph -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install merill/msgraph msgraph --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/merill/msgraph.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/msgraph .claude/skills/msgraph && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
msgraph
GitHub stars
114
Token cost
~3.2k tokens
SKILL.md length
1,276 words
Files
26 (incl. scripts, references)
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Up-to-date Microsoft Graph API knowledge for AI agents. An agent skill from merill/msgraph.

  • Works in 5 steps: Your own knowledge — try first for… → sample-search — curated, hand-verified… → api-docs-search — per-endpoint… → …
  • The agent needs to find
  • SKILL.md covers What's Included, How to Run, Finding the Right API and Using with MCP Servers, plus 6 more sections
  • Calls bash; needs MSGRAPH_CLIENT_SECRET

What it does

Msgraph is an agent skill from merill/msgraph. Up-to-date Microsoft Graph API knowledge for AI agents. Search 27,700+ Graph APIs, endpoint docs, resource schemas, and community samples — all locally, no network calls. Use when the agent needs to find, understand, or call Microsoft Graph endpoints.

Its SKILL.md is about 3.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 28 other files, including scripts and reference files (for example `CONTRIBUTING.md`, `references/REFERENCE.md` and `references/api-docs-index.json`).

It sits in Backend & APIs. It works with Microsoft 365 and OpenAPI. The repository describes itself as: Microsoft Graph Skill for Agents. The licence is MIT.

When your agent uses it

  • The agent needs to find
  • Call Microsoft Graph endpoints

Example prompts

  • “/msgraph”

Requirements

  • A credential in MSGRAPH_CLIENT_SECRET

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Your own knowledge — try first for well-known endpoints (/me, /users, /groups).
  2. sample-search — curated, hand-verified samples. Highest quality. Use for common tasks and multi-step workflows.
  3. api-docs-search — per-endpoint permissions, supported query parameters, required headers, default vs $select-only properties, and resource…
  4. openapi-search — full catalog of 27,700 Graph APIs. Use when you cannot find the endpoint any other way.
  5. Reference files — concept docs on query parameters, advanced queries, paging, batching, throttling, errors, and best practices. Read only…

What it can do on your machine

Read from SKILL.md and the folder at commit 756eb31. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/, which the agent can run.

    Shell commands in SKILL.md call:

    • bash

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • lokka.dev

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • MSGRAPH_CLIENT_SECRET

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Msgraph loads about 3.2k tokens when it runs, and up to ~11.1M if it reads all its reference files. Until then it costs about 65 tokens; SKILL.md has 1,276 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~65
When it runs · the whole SKILL.md, loaded when a task matches
~3.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~11.1M

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from merill/msgraph at commit 756eb31, republished under its MIT licence (© merill). 1,276 words, ~3,217 tokens.

Download SKILL.mdSave it as .claude/skills/msgraph/SKILL.md (or your agent's skills folder). This skill also uses 25 other files; get the full folder from GitHub.
name
msgraph
description
Up-to-date Microsoft Graph API knowledge for AI agents. Search 27,700+ Graph APIs, endpoint docs, resource schemas, and community samples — all locally, no network calls. Use when the agent needs to find, understand, or call Microsoft Graph endpoints.
license
MIT
metadata.author
merill
metadata.version
1.0.19

Microsoft Graph Agent Skill

Search, look up, and call any of the 27,700+ Microsoft Graph APIs — all locally, no network calls needed. Use the three search commands to find the right endpoint, check permissions and parameters, then optionally execute calls directly or hand off to a Graph MCP server.

What's Included

The Microsoft Graph API has 27,700+ endpoints updated weekly — well past LLM training cutoffs. This skill bundles the complete API surface as local indexes that you search instantly with no network calls.

IndexCountWhat it contains
OpenAPI endpoints27,700+Path, method, summary, description, permission scopes
Endpoint docs6,200+Permissions (delegated/app), query parameters, required headers, default vs $select-only properties
Resource schemas4,200+All properties with types, supported $filter operators, default/select-only flags
Community samplesGrowingHand-verified queries mapping natural-language tasks to exact API calls

How to Run

The msgraph CLI is bundled with this skill. Run all commands through the launcher script in this skill's directory:

  • macOS / Linux: bash <path-to-this-skill>/scripts/run.sh <command> [args...]
  • Windows: powershell <path-to-this-skill>/scripts/run.ps1 <command> [args...]

For example, to search for mail-related APIs on macOS:

bash /home/user/.opencode/skills/msgraph/scripts/run.sh openapi-search --query "send mail"

In all examples below, msgraph is shorthand for the full launcher invocation.

Finding the Right API

This is the primary purpose of the skill. Follow this progressive lookup strategy — each level adds detail:

  1. Your own knowledge — try first for well-known endpoints (/me, /users, /groups).
  2. sample-search — curated, hand-verified samples. Highest quality. Use for common tasks and multi-step workflows.
  3. api-docs-search — per-endpoint permissions, supported query parameters, required headers, default vs $select-only properties, and resource property details with filter operators.
  4. openapi-search — full catalog of 27,700 Graph APIs. Use when you cannot find the endpoint any other way.
  5. Reference files — concept docs on query parameters, advanced queries, paging, batching, throttling, errors, and best practices. Read only when you need specific guidance.

This order is guidance — adapt based on the task. For example, jump straight to api-docs-search if you already know the endpoint but need its permissions.

Search curated community samples that map natural-language tasks to exact Microsoft Graph API queries:

msgraph sample-search --query "conditional access policies"
msgraph sample-search --product entra
msgraph sample-search --query "managed devices" --product intune
FlagDescription
--queryFree-text search (searches intent and query fields)
--productFilter by product: entra, intune, exchange, teams, sharepoint, security, general
--limitMax results (default 10)

At least one of --query or --product is required. Results include multi-step workflows.

Look up detailed documentation for a specific endpoint or resource type:

msgraph api-docs-search --endpoint /users --method GET
msgraph api-docs-search --resource user
msgraph api-docs-search --query "ConsistencyLevel"
FlagDescription
--endpointSearch by endpoint path (e.g. /users, /me/messages)
--resourceSearch by resource type name (e.g. user, group, message)
--methodFilter by HTTP method: GET, POST, PUT, PATCH
--queryFree-text search across all fields
--limitMax results (default 10)

At least one of --endpoint, --resource, or --query is required.

Endpoint results include: required permissions (delegated work/school, delegated personal, application), supported OData query parameters, required headers, default properties, and endpoint-specific notes.

Resource results include: all properties with types, supported $filter operators (eq, ne, startsWith, etc.), and whether each property is returned by default or requires $select.

Search the full OpenAPI catalog of 27,700 Microsoft Graph APIs:

msgraph openapi-search --query "send mail"
msgraph openapi-search --resource messages --method GET
FlagDescription
--queryFree-text search (searches path, summary, description)
--resourceFilter by resource name (e.g. users, groups, messages)
--methodFilter by HTTP method
--limitMax results (default 20)

At least one of --query, --resource, or --method is required.

Using with MCP Servers

If the agent has access to a Microsoft Graph MCP server (such as lokka.dev or any other Microsoft Graph MCP server), use the search tools above to find the right endpoint, permissions, and request syntax, then use the information with the MCP server for execution.

In this mode, no authentication through this skill is needed. The skill acts purely as a knowledge layer — the MCP server handles authentication and API execution.

Direct Microsoft Graph API Execution

When no Graph MCP server is available, this skill can authenticate to Microsoft 365 and execute Microsoft Graph API calls directly.

Authentication

The tool supports delegated (user) and app-only (application) authentication, auto-detected from environment variables.

Quick start:

msgraph auth status          # check if signed in
msgraph auth signin          # sign in (opens browser) - recommended
msgraph auth signin --device-code  # sign in via device code (headless)
msgraph auth signout         # clear the session
  • Delegated auth (default): Interactive browser sign-in, with device code fallback for headless environments. Supports incremental consent — on 403, the tool re-authenticates with required scopes and retries automatically.
  • App-only auth: Auto-detected when MSGRAPH_CLIENT_SECRET, MSGRAPH_CLIENT_CERTIFICATE_PATH, MSGRAPH_FEDERATED_TOKEN_FILE, or MSGRAPH_AUTH_METHOD=managed-identity is set. Requires MSGRAPH_TENANT_ID.

For detailed authentication configuration including certificates, managed identity, workload identity federation, and all environment variables, see references/docs/authentication.md.

Making Graph API Calls

IMPORTANT: Run msgraph auth status before the first graph-call in a session to verify authentication.

msgraph graph-call <METHOD> <URL> [flags]
Read Operations
msgraph graph-call GET /me
msgraph graph-call GET /users --select "displayName,mail" --top 10
msgraph graph-call GET /me/messages --filter "isRead eq false" --top 5 --select "subject,from,receivedDateTime"
msgraph graph-call GET /users --filter "startsWith(displayName,'John')"
Write Operations

IMPORTANT: YOU MUST ask the user for confirmation before any write operation. Write operations require the --allow-writes flag.

msgraph graph-call POST /me/sendMail --body '{"message":{"subject":"Hello","body":{"content":"Hi"},"toRecipients":[{"emailAddress":{"address":"user@example.com"}}]}}' --allow-writes
msgraph graph-call PATCH /me --body '{"jobTitle":"Engineer"}' --allow-writes

DELETE is always blocked regardless of flags.

Show full SKILL.md (521 more words)Show less
graph-call Flags
FlagDescriptionExample
--selectOData $select--select "displayName,mail"
--filterOData $filter--filter "isRead eq false"
--topOData $top (limit results)--top 10
--expandOData $expand--expand "members"
--orderbyOData $orderby--orderby "displayName desc"
--api-versionv1.0 or beta (default: beta)--api-version v1.0
--scopesRequest additional permission scopes--scopes "Mail.Read"
--headersCustom HTTP headers--headers "ConsistencyLevel:eventual"
--bodyRequest body (JSON)--body '{"key":"value"}'
--outputjson (default) or raw--output raw
--allow-writesAllow POST/PUT/PATCH (requires user confirmation)

Critical Rules

Always (search and knowledge)
  1. Never guess or fabricate Microsoft Graph endpoints — always verify via search before calling. This skill exists because agents hallucinate endpoints; use it.
  2. Use the progressive lookup strategy — start with what you know, then sample-search, api-docs-search, openapi-search as needed.
  3. Use --select to reduce response size — only request fields you need.
  4. Use --top to limit results — avoid fetching thousands of records.
  5. ConsistencyLevel header is required for $count and $search on directory objects (users, groups, etc.). Use --headers "ConsistencyLevel:eventual".
  6. Default API version is beta — use --api-version v1.0 for production-stable endpoints.
When using direct execution (graph-call)
  1. Check auth status before the first graph-call in a session.
  2. GET is the default — no special flags needed.
  3. Write operations require --allow-writes — YOU MUST confirm with the user first.
  4. DELETE is always blocked — inform the user this is not supported.
  5. 403 triggers automatic re-auth — the tool requests additional scopes and retries (delegated auth only).
  6. All output is JSON — parse statusCode and body fields from the response.

Error Handling

StatusMeaningAction
401Token expiredRun msgraph auth signin again
403Insufficient permissionsTool auto-retries with incremental consent. If still fails, user needs admin consent.
404Resource not foundVerify the endpoint path
429Rate limitedWait for Retry-After duration, then retry

Environment Variables

VariableDescriptionDefault
MSGRAPH_CLIENT_IDCustom Entra ID app client IDMicrosoft Graph CLI Tools app
MSGRAPH_TENANT_IDTarget tenant ID (required for app-only)common
MSGRAPH_API_VERSIONDefault API versionbeta
MSGRAPH_INDEX_DB_PATHPath to OpenAPI index databaseAuto-detected
MSGRAPH_SAMPLES_DB_PATHPath to samples index databaseAuto-detected
MSGRAPH_API_DOCS_DB_PATHPath to API docs index databaseAuto-detected
MSGRAPH_NO_TOKEN_CACHEDisable persistent token cache (in-memory only)false

For the full list of authentication environment variables, see references/docs/authentication.md.

Compatibility

Search tools run fully offline with no network access required. Direct API execution requires network access to login.microsoftonline.com and graph.microsoft.com. A system browser is used for interactive auth; falls back to device code flow in headless environments.

Reference Files

Load these on demand when you need specific guidance. Do NOT load them preemptively.

FileWhen to ReadSize
references/REFERENCE.mdCommon resource paths, OData patterns, permission scopes~230 lines
references/docs/authentication.mdDetailed auth configuration: certificates, managed identity, workload identity, all env vars~200 lines
references/docs/query-parameters.mdOData $select, $filter, $expand, $top, $orderby, $search syntax and gotchas~300 lines
references/docs/advanced-queries.mdConsistencyLevel header, $count, $search, ne/not/endsWith on directory objects~190 lines
references/docs/paging.md@odata.nextLink pagination, server-side vs client-side paging~50 lines
references/docs/batching.md$batch endpoint, combining multiple requests, dependsOn sequencing~280 lines
references/docs/throttling.md429 handling, Retry-After, backoff strategy~90 lines
references/docs/errors.mdHTTP status codes, error response format, error codes~105 lines
references/docs/best-practices.md$select for performance, pagination, delta queries, batching~155 lines

© merill, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 25 other files (scripts, references) in skills/msgraph of merill/msgraph.

  • SKILL.md
  • CONTRIBUTING.md
  • references/REFERENCE.md
  • references/api-docs-index.db
  • references/api-docs-index.json
  • references/docs/advanced-queries.md
  • references/docs/authentication.md
  • references/docs/batching.md
  • references/docs/best-practices.md
  • references/docs/errors.md
  • references/docs/paging.md
  • references/docs/query-parameters.md
  • references/docs/throttling.md
  • references/graph-api-index.db
  • references/graph-api-index.json
  • references/samples-index.db
  • references/samples-index.json
  • scripts/bin
  • … and 8 more

Open the folder on GitHubat commit 756eb31

Compare with similar skills

Msgraph next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Msgraph compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Msgraph this skillmerill/msgraph114—~3.2kAutomated safety check: PassMIT
ToolJet Marketplace Plugin BuilderToolJet/ToolJet41k—~2.1kAutomated safety check: PassAGPL-3.0
Step Partsearthtojake/text-to-cad18k1 repos~1.5kAutomated safety check: PassMIT
API DesignerJeffallan/claude-skills12k2 repos~2kAutomated safety check: PassMIT
OpenAPI to MCP Servermcp-use/mcp-use11k—~5.2kAutomated safety check: PassApache-2.0
Use Yaakmountain-loop/yaak19k—~1.9kAutomated safety check: PassMIT

Similar skills

  • Turns an API description, such as an OpenAPI file or a Postman collection, into a connector plugin for ToolJet's marketplace and checks it with the repo's validator.

    41k GitHub stars~2.1k tokensUpdated today
    Backend & APIsAuto-check passed
  • Step Parts

    earthtojake/text-to-cad

    Find, evaluate, and download common purchasable CAD parts from step.parts, including named off-the-shelf actuators, servos, motors, electronics boards, connectors, screws, bolts, nuts, washers…

    18k GitHub starsUsed in 1 repo~1.5k tokens
    Backend & APIsAuto-check passed
  • API Designer

    Jeffallan/claude-skills

    Designs REST and GraphQL APIs from resource modeling to an OpenAPI 3.1 contract, with versioning, pagination and RFC 7807 error handling.

    12k GitHub starsUsed in 2 repos~2k tokens
    Backend & APIsAuto-check passed
  • OpenAPI to MCP Server

    mcp-use/mcp-use

    Turns an OpenAPI or Swagger spec into an MCP server with the mcp-use TypeScript SDK, mapping each operation to a tool, wiring auth, testing and deploying.

    11k GitHub stars~5.2k tokensUpdated today
    Backend & APIsAuto-check passed
  • Use Yaak

    mountain-loop/yaak

    A skill your agent uses when the user mentions Yaak, a Yaak workspace, or the yaak command, or asks to call, hit, or smoke test HTTP/REST endpoints, save or organize API requests for reuse or manual…

    19k GitHub stars~1.9k tokensUpdated today
    Backend & APIsAuto-check passed
  • Use whenever asked to add, create, or scaffold a CRUD endpoint, router, or entity in this repo's server (create/list/get/update/delete handlers, new…

    23k GitHub stars~461 tokensUpdated today
    Backend & APIsAuto-check passed

Categories

Questions about Msgraph

What does Msgraph do?

Up-to-date Microsoft Graph API knowledge for AI agents. An agent skill from merill/msgraph. Msgraph is an agent skill from merill/msgraph. Up-to-date Microsoft Graph API knowledge for AI agents.

When should I use Msgraph?

Msgraph fits situations like: the agent needs to find; call Microsoft Graph endpoints.

How do I install Msgraph in Claude Code?

Run `npx skills add merill/msgraph --skill msgraph -a claude-code`. Or copy the skill folder (skills/msgraph in merill/msgraph) into .claude/skills/msgraph in your project. Claude Code loads it when a task matches its description.

How do I install Msgraph in Codex?

Run `npx skills add merill/msgraph --skill msgraph -a codex`. Or copy the skill folder (skills/msgraph in merill/msgraph) into .agents/skills/msgraph in your project. Codex loads it when a task matches its description.

Can I use Msgraph in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add merill/msgraph --skill msgraph -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/msgraph, .gemini/skills/msgraph, .github/skills/msgraph and .opencode/skills/msgraph in your project.

What does Msgraph need to run?

Going by SKILL.md and its folder, Msgraph needs the command-line tools its instructions call (bash) and credentials named MSGRAPH_CLIENT_SECRET. Our summary lists: A credential in MSGRAPH_CLIENT_SECRET.

Does Msgraph access the network?

SKILL.md names 1 domain. As links in the text: lokka.dev. This is read from the text; nothing was executed.

Is Msgraph safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Msgraph use?

Msgraph is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Msgraph use?

About 3.2k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 11.1M tokens, read only when the agent opens those files.

What are the alternatives to Msgraph?

Skills that share tags, products or a category with Msgraph: ToolJet Marketplace Plugin Builder (ToolJet/ToolJet, 41k stars), Step Parts (earthtojake/text-to-cad, 18k stars), API Designer (Jeffallan/claude-skills, 12k stars) and OpenAPI to MCP Server (mcp-use/mcp-use, 11k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Msgraph?

merill (a GitHub user) maintains it in merill/msgraph, which has 114 GitHub stars. The repository was last updated on October 6, 2026.

Source: merill/msgraph on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.