get_candidates
Retrieve registered candidate words for crossword clues using the clue ID to access previously stored word options for puzzle solving.
Instructions
登録済みの候補語リストを取得する。
Args:
clue_id (str): 取得対象のカギ ID。事前に register_candidates で候補を登録して
いる必要がある。
Returns: list[str]: 登録済み候補語のリスト。登録時に渡した文字列を順序どおりに返す。
Raises:
ValueError: clue_id が空の場合。
KeyError: 指定した clue_id の候補が未登録の場合。
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clue_id | Yes |
Implementation Reference
- src/server.py:265-289 (handler)The handler function for the 'get_candidates' MCP tool. It validates the clue_id and returns the list of registered candidate words from the shared PuzzleState.candidates dictionary. The @mcp.tool() decorator registers it as an MCP tool.@mcp.tool() async def get_candidates(clue_id: str) -> list[str]: """登録済みの候補語リストを取得する。 Args: clue_id (str): 取得対象のカギ ID。事前に `register_candidates` で候補を登録して いる必要がある。 Returns: list[str]: 登録済み候補語のリスト。登録時に渡した文字列を順序どおりに返す。 Raises: ValueError: `clue_id` が空の場合。 KeyError: 指定した `clue_id` の候補が未登録の場合。 """ if not clue_id: raise ValueError("clue_id は必須です。") clue_id = clue_id.strip() if clue_id not in state.candidates: raise KeyError("指定された clue_id の候補が登録されていません。") return state.candidates[clue_id]