Skip to content

API Reference parrot_tools.o365.base

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_tools.o365.base

View source

Office365 Tools for AI-Parrot.

Base classes and utilities for Office365 integration tools. Supports multiple authentication modes:

  • Direct (admin/client credentials)
  • On-Behalf-Of (OBO)
  • Delegated (interactive user login)

Alias AbstractTool

Re-exported from parrot_tools.abstract.AbstractTool.

Alias AbstractToolArgsSchema

Re-exported from parrot_tools.abstract.AbstractToolArgsSchema.

Class O365AuthMode

Authentication modes for Office365 tools.

Class O365Tool

Base class for Office365 tools that interact with Microsoft Graph API.

This class provides:

  • Integration with O365Client
  • Multiple authentication modes
  • Error handling and logging
  • Async execution support

Subclasses should implement:

  • _execute_graph_operation(): Perform the actual Graph API operation

Authentication Modes:

  1. DIRECT: Uses client credentials (app-only access)

    • Best for: Admin operations, bulk operations
    • Requires: client_id, client_secret, tenant_id
  2. ON_BEHALF_OF: Uses OBO flow with user assertion

    • Best for: Acting on behalf of authenticated user
    • Requires: client_id, client_secret, tenant_id, user_assertion
  3. DELEGATED: Interactive user login

    • Best for: User-specific operations with full permissions
    • Requires: Interactive browser login
  4. CACHED: Reuse cached interactive session

    • Best for: Subsequent operations after interactive login
    • Requires: Previous interactive_login() call
Parameter Type Default Description
credentials Optional[Dict[str, Any]] None Dict with O365 credentials (client_id, client_secret, tenant_id, etc.)
default_auth_mode str O365AuthMode.DIRECT Default authentication mode to use
scopes Optional[List[str]] None List of Graph API scopes
**kwargs {} Additional arguments for AbstractTool

Attributes:

Attribute Type Description
name str
description str
args_schema Type[BaseModel]
return_direct bool

Method O365Tool.cleanup

Clean up resources.

cleanup()

Class O365ToolArgsSchema

Base schema for Office365 tool arguments.

Attributes:

Attribute Type Description
auth_mode Optional[str]
user_assertion Optional[str]
user_id Optional[str]

Alias ToolResult

Re-exported from parrot_tools.abstract.ToolResult.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally