Skip to main content
Glama

get_daily_challenge

Retrieve today’s LeetCode Daily Challenge problem directly with complete details, including problem description, constraints, and examples for efficient coding practice.

Instructions

Retrieves today's LeetCode Daily Challenge problem with complete details, including problem description, constraints, and examples

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The inline async handler function for the 'get_daily_challenge' MCP tool. It fetches today's LeetCode Daily Challenge using the injected leetcodeService and returns formatted JSON content including date and problem details.
    const data = await this.leetcodeService.fetchDailyChallenge(); return { content: [ { type: "text", text: JSON.stringify({ date: new Date().toISOString().split("T")[0], problem: data }) } ] }; }
  • The server.tool() call that registers the 'get_daily_challenge' tool on the MCP server, specifying name, description, empty input schema, and the handler function.
    "get_daily_challenge", "Retrieves today's LeetCode Daily Challenge problem with complete details, including problem description, constraints, and examples", {}, async () => { const data = await this.leetcodeService.fetchDailyChallenge(); return { content: [ { type: "text", text: JSON.stringify({ date: new Date().toISOString().split("T")[0], problem: data }) } ] }; } );
  • The registerProblemTools function exported from problem-tools.ts, which instantiates ProblemToolRegistry and triggers registration of problem tools including get_daily_challenge.
    export function registerProblemTools( server: McpServer, leetcodeService: LeetCodeBaseService ): void { const registry = new ProblemToolRegistry(server, leetcodeService); registry.registerTools(); }
  • src/index.ts:93-93 (registration)
    Main entry point registration in index.ts calling registerProblemTools with the MCP server and LeetCode service instance.
    registerProblemTools(server, leetcodeService);
  • Example helper implementation of fetchDailyChallenge() in LeetCodeGlobalService (similar in CN service), wrapping the underlying API call.
    async fetchDailyChallenge(): Promise<any> { const dailyChallenge = await this.leetCodeApi.daily(); return dailyChallenge; }

Other Tools

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

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