| name | leetcode-problem-fetcher |
| description | Fetch and parse LeetCode problems with metadata, constraints, examples, hints, difficulty ratings, and related problems. Integrates with LeetCode API for comprehensive problem data retrieval. |
| allowed-tools | Bash, Read, Write, WebFetch, WebSearch |
| metadata | {"author":"babysitter-sdk","version":"1.0","category":"algorithms-optimization","skill-id":"SK-ALGO-001","priority":"high"} |
| graph | {"domains":["domain:computer-science"],"specializations":["specialization:algorithms-optimization"],"skillAreas":["skill-area:dynamic-programming","skill-area:graph-algorithms"],"roles":["role:backend-engineer","role:computational-scientist"]} |
leetcode-problem-fetcher
A specialized skill for fetching and parsing LeetCode problems with complete metadata, suitable for competitive programming practice, interview preparation, and algorithm learning workflows.
Purpose
Extract comprehensive problem data from LeetCode including:
- Problem statements and descriptions
- Input/output constraints and formats
- Test cases and hidden constraints
- Problem difficulty, tags, and acceptance rate
- Related problems and pattern tags
- Hints and solution approaches
Capabilities
Core Features
-
Problem Retrieval
- Fetch problems by title slug (URL-friendly name)
- Retrieve daily challenge problems
- Search problems by category, tags, difficulty, or keywords
- Access premium problem alternatives when available
-
Metadata Extraction
- Difficulty level (Easy, Medium, Hard)
- Acceptance rate and submission statistics
- Problem tags and categories
- Related problems and similar questions
- Company tags (when available)
-
Content Parsing
- Problem description in markdown format
- Input/output examples with explanations
- Constraints and edge cases
- Follow-up questions and optimizations
- Code templates for multiple languages
-
User Data Access
- User profile and statistics
- Contest ranking and history
- Submission history and solutions
- Progress tracking across problem sets
Integration Options
MCP Server (Recommended)
claude mcp add-json "leetcode" '{"type":"stdio","command":"npx","args":["-y","@jinzcdev/leetcode-mcp-server","--site","global"]}'
Available MCP Tools:
get_daily_challenge - Fetch daily LeetCode challenge
get_problem - Retrieve problem by titleSlug
search_problems - Filter by category, tags, difficulty, keywords
get_user_profile - Access user data
get_user_contest_ranking - Track contest performance
Direct API Integration
const LEETCODE_GRAPHQL = 'https://leetcode.com/graphql';
const problemQuery = `
query getProblem($titleSlug: String!) {
question(titleSlug: $titleSlug) {
questionId
title
titleSlug
content
difficulty
topicTags { name slug }
hints
sampleTestCase
codeSnippets { lang code }
stats
}
}
`;
Browser Extension
Competitive Companion - Parses problems from LeetCode and 115+ other online judges:
Usage
Fetch a Problem
leetcode get_problem --titleSlug "two-sum"
Search Problems
leetcode search_problems --difficulty MEDIUM --tags "dynamic-programming,array"
leetcode search_problems --keyword "substring"
Get Daily Challenge
leetcode get_daily_challenge
Output Schema
{
"problem": {
"id": "string",
"title": "string",
"titleSlug": "string",
"difficulty": "Easy|Medium|Hard",
"acceptanceRate": "number",
"description": "string (markdown)",
"constraints": ["string"],
"examples": [
{
"input": "string",
"output": "string",
"explanation": "string"
}
],
"hints": ["string"],
Integration with Processes
This skill enhances the following processes:
leetcode-problem-solving - Core problem-solving workflow
pattern-recognition - Identifying algorithmic patterns
faang-interview-prep - FAANG interview preparation
References
Error Handling
| Error | Cause | Resolution |
|---|
PROBLEM_NOT_FOUND | Invalid titleSlug | Verify problem URL or slug |
RATE_LIMITED | Too many requests | Implement exponential backoff |
AUTH_REQUIRED | Premium problem | Use alternative or authenticate |
NETWORK_ERROR | Connection failed | Check network, retry with backoff |
Best Practices
- Caching: Cache problem data to reduce API calls
- Rate Limiting: Respect LeetCode's rate limits (use delays between requests)
- Error Handling: Gracefully handle premium/locked problems
- Offline Mode: Store fetched problems for offline practice
- Data Freshness: Re-fetch periodically for updated statistics