get_daily_challenge
Retrieve today's LeetCode Daily Challenge problem with complete details including description, constraints, and examples for coding practice.
Instructions
Retrieves today's LeetCode Daily Challenge problem with complete details, including problem description, constraints, and examples
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp/tools/problem-tools.ts:19-32 (handler)MCP tool handler for 'get_daily_challenge'. Fetches the daily challenge problem using the LeetCode service and returns formatted JSON content with 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 }) } ] }; } );
- src/mcp/tools/problem-tools.ts:15-33 (registration)Registration of the 'get_daily_challenge' MCP tool within ProblemToolRegistry's registerCommon method. Includes tool name, description, empty input schema, and inline handler."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 }) } ] }; } );
- src/index.ts:93-93 (registration)Top-level invocation of problem tools registration in the main server setup, which includes the get_daily_challenge tool.registerProblemTools(server, leetcodeService);
- Implementation of fetchDailyChallenge in LeetCodeGlobalService, which calls the underlying leetcode-query API's daily() method. Used by the tool handler when global site is selected.async fetchDailyChallenge(): Promise<any> { const dailyChallenge = await this.leetCodeApi.daily(); return dailyChallenge; }