list_threads
List threads in a Microsoft Teams channel with pagination to navigate through multiple pages of results.
Instructions
List threads in channel with pagination
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of items to retrieve or page size | |
| cursor | No | Pagination cursor for the next page of results |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cursor | Yes | Cursor to retrieve the next page of messages. | |
| limit | Yes | Page limit, maximum number of items to retrieve | |
| total | Yes | Total items available for retrieval | |
| items | Yes | List of channel messages or threads |
Implementation Reference
- src/mcp_teams_server/__init__.py:153-165 (handler)MCP tool handler for 'list_threads' - receives limit and cursor parameters, delegates to TeamsClient.read_threads()
@mcp.tool(name="list_threads", description="List threads in channel with pagination") async def list_threads( ctx: Context, limit: int = Field( description="Maximum number of items to retrieve or page size", default=50 ), cursor: str | None = Field( description="Pagination cursor for the next page of results", default=None ), ) -> PagedTeamsMessages: await ctx.debug(f"list_threads with cursor={cursor} and limit={limit}") client = _get_teams_client(ctx) return await client.read_threads(limit, cursor)