Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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 }) } ] }; } );
  • 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; }

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