get_problem_details
Fetch detailed information about a specific problem from the Orange Juice Online Judge using its problem ID to access descriptions, constraints, and requirements.
Instructions
Fetch the detailed information of a specific problem.
problem_id: The external ID/display ID of the problem (e.g., "PR-114-1-31").Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| problem_id | Yes |
Output Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/oj_mcp_server/server.py:56-67 (handler)Main handler function registered as MCP tool that fetches problem details. Takes problem_id string parameter, authenticates client, calls OJClient.get_problem() and returns the result as a string.
@mcp.tool() def get_problem_details(problem_id: str) -> str: """ Fetch the detailed information of a specific problem. problem_id: The external ID/display ID of the problem (e.g., "PR-114-1-31"). """ c = get_authenticated_client() try: data = c.get_problem(problem_id) return str(data) except Exception as e: return f"Error: {e}" - src/oj_mcp_server/oj_client.py:54-58 (helper)Helper method in OJClient that makes the actual HTTP GET request to the Online Judge API to fetch problem details by problem_id.
def get_problem(self, problem_id): params = {"problem_id": problem_id} resp = self.session.get(self._get_url("/api/problem"), params=params, timeout=15) resp.raise_for_status() return resp.json()