list_teams
Retrieve paginated lists of teams with organizational structure from Fathom meeting data. Use this tool to access team information efficiently with cursor-based pagination.
Instructions
Retrieve paginated list of teams with organizational structure.
Examples: list_teams_tool() # Get first page of teams list_teams_tool(cursor="abc123") # Get next page using cursor
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cursor | No | Pagination cursor | |
| per_page | No | Number of results per page (default: 50) |
Implementation Reference
- tools/teams.py:6-51 (handler)Core implementation of the list_teams tool handler that fetches paginated teams from the Fathom API.async def list_teams( ctx: Context, cursor: Optional[str] = None, per_page: Optional[int] = None ) -> dict: """Retrieve paginated list of teams in the organization. Returns team records that can be used for filtering meetings and team members. Team names from this endpoint can be used as values for the 'teams' parameter in list_meetings and 'team' parameter in list_team_members. Args: ctx: MCP context for logging cursor: Pagination cursor from previous response for next page per_page: Number of results per page (default: 50, configurable via DEFAULT_PER_PAGE env var) Returns: dict: { "items": [Team objects with name and metadata], "limit": int (default 20), "cursor": str (for pagination, null if no more results) } """ try: await ctx.info("Fetching teams from Fathom API") # Use config default if per_page not provided effective_per_page = per_page if per_page is not None else config.default_per_page # Build parameters params = {} if cursor: params["cursor"] = cursor params["limit"] = effective_per_page result = await client.get_teams(params=params if params else None) await ctx.info("Successfully retrieved teams") return result except FathomAPIError as e: await ctx.error(f"Fathom API error: {e.message}") raise e except Exception as e: await ctx.error(f"Unexpected error fetching teams: {str(e)}") raise e
- server.py:180-192 (registration)Registers the 'list_teams' tool with the MCP server, defines input schema using Pydantic Field annotations, and delegates execution to the core handler in tools/teams.py.@mcp.tool async def list_teams( ctx: Context, cursor: str = Field(default=None, description="Pagination cursor"), per_page: int = Field(default=None, description=f"Number of results per page (default: {config.default_per_page})") ) -> Dict[str, Any]: """Retrieve paginated list of teams with organizational structure. Examples: list_teams_tool() # Get first page of teams list_teams_tool(cursor="abc123") # Get next page using cursor """ return await tools.teams.list_teams(ctx, cursor, per_page)