suggest_sentence
Generates tailored practice sentences for English pronunciation drills. Choose phoneme focus and difficulty to get a sentence to read aloud.
Instructions
Suggest a practice sentence the user can read aloud.
Args: focus: Phoneme focus area. Options: "th", "f_v", "r_l", "vowels", "general". If not specified, picks randomly. difficulty: Difficulty level. Options: "beginner", "intermediate", "advanced". If not specified, picks randomly.
Returns: A practice sentence with its focus area and difficulty.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| focus | No | ||
| difficulty | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- The actual handler function for the 'suggest_sentence' MCP tool. It filters the SENTENCES pool by optional focus/difficulty, selects a random sentence, and returns it as a Markdown suggestion string.
@mcp.tool() def suggest_sentence( focus: str | None = None, difficulty: str | None = None, ) -> str: """ Suggest a practice sentence the user can read aloud. Args: focus: Phoneme focus area. Options: "th", "f_v", "r_l", "vowels", "general". If not specified, picks randomly. difficulty: Difficulty level. Options: "beginner", "intermediate", "advanced". If not specified, picks randomly. Returns: A practice sentence with its focus area and difficulty. """ pool = SENTENCES if focus: pool = [s for s in pool if s["focus"] == focus] if difficulty: pool = [s for s in pool if s["difficulty"] == difficulty] if not pool: return ( "No sentences match that filter. " "Try: focus=th/f_v/r_l/vowels/general, " "difficulty=beginner/intermediate/advanced" ) sentence = random.choice(pool) return ( f"**Practice this:**\n\n" f"> {sentence['text']}\n\n" f"**Focus:** {sentence['focus']} | **Difficulty:** {sentence['difficulty']}\n\n" f"When ready, use the `practice` tool with this sentence." ) - Input schema (docstring-based parameter definitions) for suggest_sentence: optional 'focus' (str: th/f_v/r_l/vowels/general) and optional 'difficulty' (str: beginner/intermediate/advanced). Returns a string.
""" Suggest a practice sentence the user can read aloud. Args: focus: Phoneme focus area. Options: "th", "f_v", "r_l", "vowels", "general". If not specified, picks randomly. difficulty: Difficulty level. Options: "beginner", "intermediate", "advanced". If not specified, picks randomly. Returns: A practice sentence with its focus area and difficulty. """ - src/mcp_server_pronunciation/server.py:259-260 (registration)Registration via @mcp.tool() decorator on line 259, which registers 'suggest_sentence' as an MCP tool on the FastMCP instance ('pronunciation').
@mcp.tool() def suggest_sentence( - The SENTENCES data module: a list of dicts with keys 'text', 'focus', and 'difficulty' used as the pool from which suggest_sentence picks.
"""Curated practice sentences organized by phoneme focus and difficulty.""" from __future__ import annotations SENTENCES: list[dict[str, str]] = [