Skip to main content
Glama

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
NameRequiredDescriptionDefault
problem_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • 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}"
  • 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()

Tool Definition Quality

Score is being calculated. Check back soon.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/wangicheng/oj-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server