Skip to content

feat(msteams): add list_joined_teams tool and tests#932

Open
NolanJMcCafferty wants to merge 1049 commits intoKlavis-AI:mainfrom
NolanJMcCafferty:feat/msteams-list-joined-teams
Open

feat(msteams): add list_joined_teams tool and tests#932
NolanJMcCafferty wants to merge 1049 commits intoKlavis-AI:mainfrom
NolanJMcCafferty:feat/msteams-list-joined-teams

Conversation

@NolanJMcCafferty
Copy link
Contributor

@NolanJMcCafferty NolanJMcCafferty commented Jan 13, 2026

Description

Add a new tool for the MS Teams MCP Server to list the Teams that the user has joined. This is different from listing all the teams, especially because list_joined_teams does not require Admin consent, it just requires regular OAuth.

Related issue

Type of change

  • New MCP feature (non-breaking change which adds functionality)

How has this been tested?

uv run --with pytest --with pytest-asyncio --with msal --with httpx --with python-dotenv pytest tests/test_tools.py -v
============================================================================== test session starts ==============================================================================
platform linux -- Python 3.12.3, pytest-9.0.2, pluggy-1.6.0 -- /home/nolan-mccafferty/.cache/uv/builds-v0/.tmpWZDIzB/bin/python
cachedir: .pytest_cache
rootdir: /home/nolan-mccafferty/workspace/klavis/mcp_servers/msteams
plugins: asyncio-1.3.0, anyio-4.12.1
asyncio: mode=Mode.STRICT, debug=False, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
collected 14 items                                                                                                                                                              

tests/test_tools.py::TestTeamsTools::test_list_all_teams PASSED                                                                                                           [  7%]
tests/test_tools.py::TestTeamsTools::test_get_team PASSED                                                                                                                 [ 14%]
tests/test_tools.py::TestTeamsTools::test_list_channels PASSED                                                                                                            [ 21%]
tests/test_tools.py::TestTeamsTools::test_create_channel PASSED                                                                                                           [ 28%]
tests/test_tools.py::TestTeamsTools::test_create_channel_without_description PASSED                                                                                       [ 35%]
tests/test_tools.py::TestTeamsTools::test_send_channel_message PASSED                                                                                                     [ 42%]
tests/test_tools.py::TestTeamsTools::test_list_joined_teams PASSED                                                                                                        [ 50%]
tests/test_tools.py::TestChatsTools::test_list_chats PASSED                                                                                                               [ 57%]
tests/test_tools.py::TestChatsTools::test_send_chat_message PASSED                                                                                                        [ 64%]
tests/test_tools.py::TestUsersTools::test_list_users PASSED                                                                                                               [ 71%]
tests/test_tools.py::TestUsersTools::test_get_user PASSED                                                                                                                 [ 78%]
tests/test_tools.py::TestUsersTools::test_get_user_by_principal_name PASSED                                                                                               [ 85%]
tests/test_tools.py::TestMeetingsTools::test_create_online_meeting PASSED                                                                                                 [ 92%]
tests/test_tools.py::TestMeetingsTools::test_list_online_meetings PASSED                                                                                                  [100%]

============================================================================== 14 passed in 0.10s ===============================================================================


and from my client...

nexhelm-klavis-msteams-mcp        | INFO:     172.19.0.12:34032 - "POST /mcp/ HTTP/1.1" 200 OK
nexhelm-klavis-msteams-mcp        | 2026-01-13 22:45:58,716 - mcp.server.lowlevel.server - INFO - Processing request of type CallToolRequest
nexhelm-klavis-msteams-mcp        | 2026-01-13 22:46:00,641 - httpx - INFO - HTTP Request: GET https://graph.microsoft.com/v1.0//me/joinedTeams "HTTP/1.1 200 OK"
nexhelm-klavis-msteams-mcp        | 2026-01-13 22:46:00,644 - mcp.server.streamable_http - INFO - Terminating session: None
nexhelm-fastapi                   | 2026-01-13 22:46:00 - app.services.langchain_agent.db_operations - INFO - Recorded tool call: Msteams List Joined Teams (msteams_list_joined_teams) for execution 3392cd67-7bac-4066-9aa7-1a341063c1be
nexhelm-fastapi                   | 2026-01-13 22:46:00 - app.services.langchain_agent.agent_executor - INFO - type=<StreamEventType.TOOL_END: 'tool_end'> data={'tool_name': 'msteams_list_joined_teams', 'output': {'tool_call_id': 'toolu_0182b5kpyckVY24NPuNVsWKn', 'content': '{...}'}, 'thinking_message': 'Analyzing results...'} timestamp=datetime.datetime(2026, 1, 13, 22, 46, 0, 728346, tzinfo=datetime.timezone.utc)

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests pass locally with my changes

zihaolin96 and others added 30 commits October 24, 2025 11:18
…is (Klavis-AI#634)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Aditya Arolkar <aditya.arolkar@berkeley.edu>
zihaolin96 and others added 29 commits January 6, 2026 21:36
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: github-actions <github-actions@github.com>
…/mcp_servers/fetch_url (Klavis-AI#905)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…/examples/mastra-klavis (Klavis-AI#904)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…/examples/langchain-klavis/typescript (Klavis-AI#903)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…/mcp_servers/local/kubernetes (Klavis-AI#901)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…mcp_servers/local/WooCommerce (Klavis-AI#898)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
Signed-off-by: Nolan McCafferty <njmccafferty@gmail.com>
…-tools (Klavis-AI#923)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…lavis-AI#927)

Signed-off-by: Nolan McCafferty <njmccafferty@gmail.com>
…vers/local/filesystem (Klavis-AI#810)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…s-AI#850)

Co-authored-by: triepod-ai <noreply@github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.