list_my_submissions
Retrieve your submission history from Orange Juice Online Judge to track code submissions and monitor progress.
Instructions
Fetch the list of latest submissions made by the authenticated user. Returns a JSON string containing the submission histories.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| offset | No | ||
| limit | No |
Implementation Reference
- src/oj_mcp_server/server.py:43-54 (handler)The main handler function for list_my_submissions tool. Decorated with @mcp.tool(), it authenticates the client using get_authenticated_client(), then calls get_submissions with offset, limit, and myself=1 parameters to fetch the user's submissions from the Online Judge API.
@mcp.tool() def list_my_submissions(offset: int = 0, limit: int = 20) -> str: """ Fetch the list of latest submissions made by the authenticated user. Returns a JSON string containing the submission histories. """ c = get_authenticated_client() try: data = c.get_submissions(offset=offset, limit=limit, myself=1) return str(data) except Exception as e: return f"Error: {e}" - src/oj_mcp_server/server.py:43-43 (registration)The @mcp.tool() decorator registers the list_my_submissions function as an MCP tool, making it available to clients of the MCP server.
@mcp.tool() - src/oj_mcp_server/oj_client.py:48-52 (helper)The get_submissions method in OJClient that performs the actual HTTP GET request to the /api/submissions endpoint with the provided offset, limit, and myself parameters to retrieve submission data from the Online Judge.
def get_submissions(self, offset=0, limit=20, myself=1): params = {'limit': limit, 'offset': offset, 'myself': myself} resp = self.session.get(self._get_url("/api/submissions"), params=params, timeout=20) resp.raise_for_status() return resp.json()