list_episodes_tool
List all available podcast transcript episodes indexed from Dropbox, providing a complete overview to select specific episodes for search or review.
Instructions
List all available podcast transcript episodes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- The MCP tool handler for 'list_episodes_tool'. Decorated with @mcp.tool(), it retrieves all episodes from the database by calling list_episodes(conn), gets the last sync time via get_last_sync(conn), and returns a formatted string listing all episode names with a header showing count and sync status.
@mcp.tool() def list_episodes_tool() -> str: """List all available podcast transcript episodes.""" conn = _get_conn() episodes = list_episodes(conn) last_sync = get_last_sync(conn) header = f"{len(episodes)} episodes indexed (last synced: {last_sync or 'never'})\n\n" return header + "\n".join(e["name"] for e in episodes) - src/dropbox_transcripts_mcp/server.py:60-61 (registration)The tool is registered with FastMCP via the @mcp.tool() decorator on line 60, which makes it available as an MCP tool named 'list_episodes_tool'.
@mcp.tool() def list_episodes_tool() -> str: - The list_episodes function queries the database for all episodes (name and synced_at), ordered by name, and returns them as a list of dicts. This is the data retrieval helper used by list_episodes_tool.
def list_episodes(conn: sqlite3.Connection) -> list[dict]: rows = conn.execute("SELECT name, synced_at FROM episodes ORDER BY name").fetchall() return [dict(r) for r in rows] - The get_last_sync function retrieves the last sync timestamp from the sync_state table, used by list_episodes_tool to display when episodes were last synced.
def get_last_sync(conn: sqlite3.Connection) -> str | None: row = conn.execute("SELECT value FROM sync_state WHERE key = 'last_sync'").fetchone() return row["value"] if row else None - The tool has no input parameters (empty signature) and returns a plain string. The docstring serves as the description for the MCP tool.
def list_episodes_tool() -> str: