Skip to main content
Glama

Connect Microsoft 365 Account

connect_m365_account
Destructive

Connect a Microsoft 365 account (or add another one, or sign one in again). Call again after you've authenticated at microsoft.com/devicelogin to finish the connection. Pass include_channel_messages: true to also read Teams channel messages and search them — that permission needs an administrator of your Microsoft 365 organization; without that approval the sign-in is refused and the account keeps its current access.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "connect_m365_account"
  }
}

Input Schema

NameRequiredDescriptionDefault
confirmNoIgnored; kept for older clients.
scopes_forNoAlso request the permission one of these needs: todo (Microsoft To Do), files (OneDrive), sharepoint (SharePoint, work accounts only), contacts (changing contacts), transcripts (reading Teams call transcripts, work accounts only; an administrator of the organization must approve it), meetings (reading Teams meeting transcripts, work accounts only; an administrator of the organization must approve it). Pass the value a consent_required answer names.
account_typeNo"work" (default): a work or school Microsoft 365 account — mail, calendar, contacts, Teams. "personal": an Outlook.com / Hotmail / Live account — mail, calendar and contacts only (Microsoft has no Teams chats or directory for personal accounts, and asking for them makes Microsoft refuse the sign-in as an 'expired code'). Ask the person which one it is when unsure.
include_channel_messagesNoAlso request access to Teams channel messages and message search. Needs an administrator of the Microsoft 365 organization; without that approval this sign-in is refused and the account keeps its current access.

Output Schema

NameRequiredDescriptionDefault
okNo
messageNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / scopes_for
      Added value: +{
      +  "description": "Also request the permission one of these needs: todo (Microsoft To Do), files (OneDrive), sharepoint (SharePoint, work accounts only), contacts (changing contacts), transcripts (reading Teams call transcripts, work accounts only; an administrator of the organization must approve it), meetings (reading Teams meeting transcripts, work accounts only; an administrator of the organization must approve it). Pass the value a consent_required answer names.",
      +  "items": {
      +    "enum": [
      +      "todo",
      +      "files",
      +      "sharepoint",
      +      "contacts",
      +      "transcripts",
      +      "meetings"
      +    ],
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  2. Changed1 schema field changed
    • changedInput schema / properties / confirm / description
      Previous value: -"Must be true to start the sign-in. Without it the call returns a preview and does nothing."New value: +"Ignored; kept for older clients."
  3. Changed1 schema field changed
    • addedInput schema / properties / confirm
      Added value: +{
      +  "description": "Must be true to start the sign-in. Without it the call returns a preview and does nothing.",
      +  "type": "boolean"
      +}
  4. Changed1 schema field changed
    • addedInput schema / properties / account_type
      Added value: +{
      +  "description": "\"work\" (default): a work or school Microsoft 365 account — mail, calendar, contacts, Teams. \"personal\": an Outlook.com / Hotmail / Live account — mail, calendar and contacts only (Microsoft has no Teams chats or directory for personal accounts, and asking for them makes Microsoft refuse the sign-in as an 'expired code'). Ask the person which one it is when unsure.",
      +  "enum": [
      +    "work",
      +    "personal"
      +  ],
      +  "type": "string"
      +}
  5. Changed1 schema field changed
    • addedInput schema / properties / include_channel_messages
      Added value: +{
      +  "description": "Also request access to Teams channel messages and message search. Needs an administrator of the Microsoft 365 organization; without that approval this sign-in is refused and the account keeps its current access.",
      +  "type": "boolean"
      +}
  6. First observed

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare destructiveHint and openWorldHint, so the safety profile is covered. The description adds genuinely useful behavior beyond that: the interactive sign-in flow, the fact that a missing admin approval causes the sign-in to be refused, and that the account keeps its current access on failure — exactly the failure semantics an agent needs to retry intelligently.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, front-loaded with purpose and the re-invocation rule. The trailing include_channel_messages sentence is somewhat duplicative of the schema description and could be trimmed, but nothing is padded or vague.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present and rich annotations, the description does not need to explain returns. It covers the interactive flow and refusal behavior well; the only gap is that it never hints at the scopes_for escalation path, leaving that entirely to the schema, which is acceptable but not ideal.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so all four parameters are already documented in the schema. The description's only parameter-level addition is the include_channel_messages admin caveat, which largely restates the schema text verbatim. Baseline 3 is appropriate when the schema carries the semantics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource (connect a Microsoft 365 account) and explicitly covers the three cases it handles: first connection, adding another account, and re-authenticating. The name makes it trivially distinguishable from disconnect_m365_account and the connect_* siblings for other services.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete when-to guidance for the two-step device flow ("call again after you've authenticated at microsoft.com/devicelogin") and a conditional for the optional permission. It stops short of naming alternatives such as list_m365_accounts for checking whether an account already exists, so it is clear but not fully routing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources