get_episode_tool
Retrieve the full transcript of a podcast episode by providing a guest name. Supports partial name matches, e.g., 'Fishman' returns 'Adam Fishman'.
Instructions
Get the full transcript for an episode by guest name. Supports partial matches: 'Fishman' will find 'Adam Fishman'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- The MCP tool handler for get_episode_tool. Queries the database for an episode by name (with partial match fallback) and returns the full transcript.
@mcp.tool() def get_episode_tool(name: str) -> str: """ Get the full transcript for an episode by guest name. Supports partial matches: 'Fishman' will find 'Adam Fishman'. """ conn = _get_conn() episode = get_episode(conn, name) if not episode: return f"No episode found for '{name}'. Use list_episodes to see all available names." return f"# {episode['name']}\n\n{episode['content']}" - src/dropbox_transcripts_mcp/server.py:70-70 (registration)The @mcp.tool() decorator registers get_episode_tool as an MCP tool on the FastMCP instance.
@mcp.tool() - The database helper that get_episode_tool delegates to. First tries exact (case-insensitive) match, then falls back to partial LIKE match.
def get_episode(conn: sqlite3.Connection, name: str) -> dict | None: # Exact match first row = conn.execute( "SELECT name, content, synced_at FROM episodes WHERE name = ? COLLATE NOCASE", (name,), ).fetchone() if row: return dict(row) # Partial match fallback row = conn.execute( "SELECT name, content, synced_at FROM episodes WHERE name LIKE ? COLLATE NOCASE ORDER BY name LIMIT 1", (f"%{name}%",), ).fetchone() return dict(row) if row else None