teams-api-1-microsoft-graph-api-client
БесплатноБез исполняемых скриптовНе проверенSub-skill of teams-api: 1. Microsoft Graph API Client.
от vamseeachanta★ 21 звезда на GitHubОб этом скилле
1. Microsoft Graph API Client
1. Microsoft Graph API Client
# graph_client.py
# ABOUTME: Microsoft Graph API client for Teams operations
# ABOUTME: Handles authentication and common API calls
from azure.identity import ClientSecretCredential
from msgraph import GraphServiceClient
from msgraph.generated.models.chat_message import ChatMessage
from msgraph.generated.models.item_body import ItemBody
from msgraph.generated.models.body_type import BodyType
import os
from dotenv import load_dotenv
load_dotenv()
class TeamsGraphClient:
"""Microsoft Graph client for Teams operations"""
def __init__(self):
self.credential = ClientSecretCredential(
tenant_id=os.environ["AZURE_TENANT_ID"],
client_id=os.environ["AZURE_CLIENT_ID"],
client_secret=os.environ["AZURE_CLIENT_SECRET"]
)
self.client = GraphServiceClient(
credentials=self.credential,
scopes=["https://graph.microsoft.com/.default"]
)
async def send_channel_message(
self,
team_id: str,
channel_id: str,
content: str,
content_type: str = "html"
):
"""Send a message to a Teams channel"""
message = ChatMessage(
body=ItemBody(
content_type=BodyType.Html if content_type == "html" else BodyType.Text,
content=content
)
)
result = await self.client.teams.by_team_id(team_id) \
.channels.by_channel_id(channel_id) \
.messages.post(message)
return result
async def send_chat_message(
self,
chat_id: str,
content: str
):
"""Send a message to a chat (1:1 or group)"""
message = ChatMessage(
body=ItemBody(
content_type=BodyType.Html,
content=content
)
)
result = await self.client.chats.by_chat_id(chat_id) \
.messages.post(message)
return result
async def list_teams(self):
"""List all teams the app has access to"""
result = await self.client.groups.get()
teams = [g for g in result.value if g.resource_provisioning_options
and "Team" in g.resource_provisioning_options]
return teams
async def list_channels(self, team_id: str):
"""List channels in a team"""
result = await self.client.teams.by_team_id(team_id) \
.channels.get()
return result.value
async def get_channel_messages(
self,
team_id: str,
channel_id: str,
top: int = 50
):
"""Get recent messages from a channel"""
result = await self.client.teams.by_team_id(team_id) \
.channels.by_channel_id(channel_id) \
.messages.get(
request_configuration=lambda config:
setattr(config.query_parameters, 'top', top)
)
return result.value
async def reply_to_message(
self,
team_id: str,
channel_id: str,
message_id: str,
content: str
):
"""Reply to a channel message"""
reply = ChatMessage(
body=ItemBody(
content_type=BodyType.Html,
content=content
)
)
result = await self.client.teams.by_team_id(team_id) \
.channels.by_channel_id(channel_id) \
.messages.by_chat_message_id(message_id) \
.replies.post(reply)
return result
async def create_online_meeting(
self,
subject: str,
start_time: str,
end_time: str,
attendees: list
):
"""Create an online meeting"""
from msgraph.generated.models.online_meeting import OnlineMeeting
from msgraph.generated.models.meeting_participants import MeetingParticipants
from msgraph.generated.models.meeting_participant_info import MeetingParticipantInfo
from msgraph.generated.models.identity_set import IdentitySet
from msgraph.generated.models.identity import Identity
participant_list = [
MeetingParticipantInfo(
identity=IdentitySet(
user=Identity(id=attendee)
)
)
for attendee in attendees
]
meeting = OnlineMeeting(
subject=subject,
start_date_time=start_time,
end_date_time=end_time,
participants=MeetingParticipants(
attendees=participant_list
)
)
result = await self.client.me.online_meetings.post(meeting)
return result
async def get_user_by_email(self, email: str):
"""Get user details by email"""
result = await self.client.users.by_user_id(email).get()
return result
# Usage example
async def main():
client = TeamsGraphClient()
# List teams
Установить teams-api-1-microsoft-graph-api-client в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл teams-api-1-microsoft-graph-api-client?
Sub-skill of teams-api: 1. Microsoft Graph API Client.
Как установить скилл teams-api-1-microsoft-graph-api-client?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл teams-api-1-microsoft-graph-api-client запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic