Skip to main content
Glama

get_recent_ac_submissions

Retrieve a user's recently accepted LeetCode submissions to track solved problems and monitor coding progress.

Instructions

Retrieves a user's recent accepted (AC) submissions on LeetCode Global, focusing only on successfully completed problems

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameYesLeetCode username to retrieve recent accepted submissions for
limitNoMaximum number of accepted submissions to return (optional, defaults to server-defined limit)

Implementation Reference

  • Handler implementation for fetching recent accepted submissions on LeetCode Global using a GraphQL query to 'recentAcSubmissionList'.
    async fetchUserRecentACSubmissions( username: string, limit?: number ): Promise<any> { return await this.leetCodeApi.graphql({ query: ` query ($username: String!, $limit: Int) { recentAcSubmissionList(username: $username, limit: $limit) { id title titleSlug time timestamp statusDisplay lang } } `, variables: { username, limit } }); }
  • Handler implementation for fetching recent accepted submissions on LeetCode CN using the leetCodeApi.recent_submissions method (ignores limit).
    async fetchUserRecentACSubmissions( username: string, limit?: number ): Promise<any> { return await this.leetCodeApi.recent_submissions(username); }
  • Registration of 'get_recent_ac_submissions' tool for Global LeetCode, with input schema (username, optional limit) and handler that delegates to leetcodeService and returns JSON response.
    this.server.tool( "get_recent_ac_submissions", "Retrieves a user's recent accepted (AC) submissions on LeetCode Global, focusing only on successfully completed problems", { username: z .string() .describe( "LeetCode username to retrieve recent accepted submissions for" ), limit: z .number() .optional() .default(10) .describe( "Maximum number of accepted submissions to return (optional, defaults to server-defined limit)" ) }, async ({ username, limit }) => { try { const data = await this.leetcodeService.fetchUserRecentACSubmissions( username, limit ); return { content: [ { type: "text", text: JSON.stringify({ username, submissions: data }) } ] }; } catch (error: any) { return { content: [ { type: "text", text: JSON.stringify({ error: "Failed to fetch recent submissions", message: error.message }) } ] }; } } ); }
  • Registration of 'get_recent_ac_submissions' tool for LeetCode China, with input schema (username, optional limit) and handler that delegates to leetcodeService and returns JSON response.
    this.server.tool( "get_recent_ac_submissions", "Retrieves a user's recent accepted (AC) submissions on LeetCode China, with details about each successfully solved problem", { username: z .string() .describe( "LeetCode China username to retrieve recent accepted submissions for" ), limit: z .number() .optional() .default(10) .describe( "Maximum number of accepted submissions to return (optional, defaults to server-defined limit)" ) }, async ({ username, limit }) => { try { const data = await this.leetcodeService.fetchUserRecentACSubmissions( username, limit ); return { content: [ { type: "text", text: JSON.stringify({ username, acSubmissions: data }) } ] }; } catch (error: any) { return { content: [ { type: "text", text: JSON.stringify({ error: "Failed to fetch recent AC submissions", message: error.message }) } ] }; } } );

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/jinzcdev/leetcode-mcp-server'

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