Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7dd479f

Browse files
committed
refactor: standardize terminology from "solution articles" to "solutions"
- remove the "leetcode-" prefix
1 parent 7af01bd commit 7dd479f

14 files changed

+108
-101
lines changed

‎src/leetcode/graphql/cn/solution-article-detail.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* GraphQL query for fetching a solution article's detail on LeetCode CN
2+
* GraphQL query for fetching a solution's detail on LeetCode CN
33
*/
44
export const SOLUTION_ARTICLE_DETAIL_QUERY = `
55
query discussTopic($slug: String) {

‎src/leetcode/graphql/cn/solution-articles.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* GraphQL query for fetching solution articles for a problem on LeetCode CN
2+
* GraphQL query for fetching solutions for a problem on LeetCode CN
33
* `orderBy` can be one of [DEFAULT, MOST_UPVOTE, HOT, NEWEST_TO_OLDEST, OLDEST_TO_NEWEST]
44
*/
55
export const SOLUTION_ARTICLES_QUERY = `

‎src/leetcode/graphql/global/solution-article-detail.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* GraphQL query for fetching a solution article's detail on LeetCode Global
2+
* GraphQL query for fetching a solution's detail on LeetCode Global
33
*/
44
export const SOLUTION_ARTICLE_DETAIL_QUERY = `
55
query ugcArticleSolutionArticle($articleId: ID, $topicId: ID) {

‎src/leetcode/graphql/global/solution-articles.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* GraphQL query for fetching solution articles for a problem on LeetCode Global
2+
* GraphQL query for fetching solutions for a problem on LeetCode Global
33
* `orderBy` can be one of [HOT, MOST_RECENT, MOST_VOTES]
44
*/
55
export const SOLUTION_ARTICLES_QUERY = `

‎src/leetcode/leetcode-base-service.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,22 +152,22 @@ export interface LeetCodeBaseService {
152152
isCN(): boolean;
153153

154154
/**
155-
* Retrieves a list of solution articles for a specific problem.
155+
* Retrieves a list of solutions for a specific problem.
156156
*
157157
* @param questionSlug - The URL slug/identifier of the problem
158-
* @param options - Optional parameters for filtering and sorting the solution articles
159-
* @returns Promise resolving to the solution articles list data
158+
* @param options - Optional parameters for filtering and sorting the solutions
159+
* @returns Promise resolving to the solutions list data
160160
*/
161161
fetchQuestionSolutionArticles(
162162
questionSlug: string,
163163
options?: any
164164
): Promise<any>;
165165

166166
/**
167-
* Retrieves detailed information about a specific solution article.
167+
* Retrieves detailed information about a specific solution.
168168
*
169-
* @param identifier - The identifier of the solution article (topicId for Global, slug for CN)
170-
* @returns Promise resolving to the solution article detail data
169+
* @param identifier - The identifier of the solution (topicId for Global, slug for CN)
170+
* @returns Promise resolving to the solution detail data
171171
*/
172172
fetchSolutionArticleDetail(identifier: string): Promise<any>;
173173

‎src/leetcode/leetcode-cn-service.ts‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -268,11 +268,11 @@ export class LeetCodeCNService implements LeetCodeBaseService {
268268
}
269269

270270
/**
271-
* Retrieves a list of solution articles for a specific problem on LeetCode CN.
271+
* Retrieves a list of solutions for a specific problem on LeetCode CN.
272272
*
273273
* @param questionSlug - The URL slug/identifier of the problem
274-
* @param options - Optional parameters for filtering and sorting the solution articles
275-
* @returns Promise resolving to the solution articles list data
274+
* @param options - Optional parameters for filtering and sorting the solutions
275+
* @returns Promise resolving to the solutions list data
276276
*/
277277
async fetchQuestionSolutionArticles(
278278
questionSlug: string,
@@ -328,18 +328,18 @@ export class LeetCodeCNService implements LeetCodeBaseService {
328328
});
329329
} catch (error) {
330330
console.error(
331-
`Error fetching solution articles for ${questionSlug}:`,
331+
`Error fetching solutions for ${questionSlug}:`,
332332
error
333333
);
334334
throw error;
335335
}
336336
}
337337

338338
/**
339-
* Retrieves detailed information about a specific solution article on LeetCode CN.
339+
* Retrieves detailed information about a specific solution on LeetCode CN.
340340
*
341-
* @param slug - The slug of the solution article
342-
* @returns Promise resolving to the solution article detail data
341+
* @param slug - The slug of the solution
342+
* @returns Promise resolving to the solution detail data
343343
*/
344344
async fetchSolutionArticleDetail(slug: string): Promise<any> {
345345
try {
@@ -355,7 +355,7 @@ export class LeetCodeCNService implements LeetCodeBaseService {
355355
});
356356
} catch (error) {
357357
console.error(
358-
`Error fetching solution article detail for slug ${slug}:`,
358+
`Error fetching solution detail for slug ${slug}:`,
359359
error
360360
);
361361
throw error;

‎src/leetcode/leetcode-global-service.ts‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,11 @@ export class LeetCodeGlobalService implements LeetCodeBaseService {
256256
}
257257

258258
/**
259-
* Retrieves a list of solution articles for a specific problem.
259+
* Retrieves a list of solutions for a specific problem.
260260
*
261261
* @param questionSlug - The URL slug/identifier of the problem
262-
* @param options - Optional parameters for filtering and sorting the solution articles
263-
* @returns Promise resolving to the solution articles list data
262+
* @param options - Optional parameters for filtering and sorting the solutions
263+
* @returns Promise resolving to the solutions list data
264264
*/
265265
async fetchQuestionSolutionArticles(
266266
questionSlug: string,
@@ -316,18 +316,18 @@ export class LeetCodeGlobalService implements LeetCodeBaseService {
316316
});
317317
} catch (error) {
318318
console.error(
319-
`Error fetching solution articles for ${questionSlug}:`,
319+
`Error fetching solutions for ${questionSlug}:`,
320320
error
321321
);
322322
throw error;
323323
}
324324
}
325325

326326
/**
327-
* Retrieves detailed information about a specific solution article on LeetCode Global.
327+
* Retrieves detailed information about a specific solution on LeetCode Global.
328328
*
329-
* @param topicId - The topic ID of the solution article
330-
* @returns Promise resolving to the solution article detail data
329+
* @param topicId - The topic ID of the solution
330+
* @returns Promise resolving to the solution detail data
331331
*/
332332
async fetchSolutionArticleDetail(topicId: string): Promise<any> {
333333
try {
@@ -343,7 +343,7 @@ export class LeetCodeGlobalService implements LeetCodeBaseService {
343343
});
344344
} catch (error) {
345345
console.error(
346-
`Error fetching solution article detail for topic ${topicId}:`,
346+
`Error fetching solution detail for topic ${topicId}:`,
347347
error
348348
);
349349
throw error;

‎src/mcp/resources/problem-resources.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ export class ProblemResourceRegistry extends ResourceRegistry {
1919
// Problem Categories resource
2020
this.server.resource(
2121
"problem-categories",
22-
"leetcode://problems/categories/all",
22+
"categories://problems/all",
2323
{
2424
description:
25-
"A comprehensive list of all problem classification categories in LeetCode platform, including difficulty levels (Easy, Medium, Hard) and algorithmic domains. These categories help organize and filter coding problems for users based on their complexity and topic area. Returns an array of all available problem categories.",
25+
"A list of all problem classification categories in LeetCode platform, including difficulty levels (Easy, Medium, Hard) and algorithmic domains. These categories help organize and filter coding problems for users based on their complexity and topic area. Returns an array of all available problem categories.",
2626
mimeType: "application/json"
2727
},
2828
async (uri, extra) => {
@@ -41,7 +41,7 @@ export class ProblemResourceRegistry extends ResourceRegistry {
4141
// Problem Tags resource
4242
this.server.resource(
4343
"problem-tags",
44-
"leetcode://problems/tags/all",
44+
"tags://problems/all",
4545
{
4646
description:
4747
"A detailed collection of algorithmic and data structure tags used by LeetCode to categorize problems. These tags represent specific algorithms (like 'dynamic-programming', 'binary-search') or data structures (such as 'array', 'queue', 'tree') that are relevant to solving each problem. Returns an array of all available problem tags for filtering and searching problems.",
@@ -63,7 +63,7 @@ export class ProblemResourceRegistry extends ResourceRegistry {
6363
// Problem Languages resource
6464
this.server.resource(
6565
"problem-langs",
66-
"leetcode://problems/langs/all",
66+
"langs://problems/all",
6767
{
6868
description:
6969
"A complete list of all programming languages officially supported by LeetCode for code submission and problem solving. Returns an array of all available programming languages on the platform.",
@@ -85,12 +85,12 @@ export class ProblemResourceRegistry extends ResourceRegistry {
8585
// Problem Detail resource
8686
this.server.resource(
8787
"problem-detail",
88-
new ResourceTemplate("leetcode://problems/{titleSlug}", {
88+
new ResourceTemplate("problem://{titleSlug}", {
8989
list: undefined
9090
}),
9191
{
9292
description:
93-
"Provides comprehensive details about a specific LeetCode problem, including its description, examples, constraints, and metadata. The titleSlug parameter in the URI identifies the specific problem.",
93+
"Provides details about a specific LeetCode problem, including its description, examples, constraints, and metadata. The titleSlug parameter in the URI identifies the specific problem.",
9494
mimeType: "application/json"
9595
},
9696
async (uri, variables, extra) => {

‎src/mcp/resources/solution-resources.ts‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ import { ResourceRegistry } from "./resource-registry.js";
77

88
/**
99
* Solution resource registry class that handles registration of LeetCode solution-related resources.
10-
* This class manages resources for accessing solution articles and solution details.
10+
* This class manages resources for accessing solutions and solution details.
1111
*/
1212
export class SolutionResourceRegistry extends ResourceRegistry {
1313
protected registerGlobal(): void {
14-
// Global solution article resource
14+
// Global solution resource
1515
this.server.resource(
16-
"solution-article",
17-
new ResourceTemplate("leetcode://solutions/{topicId}", {
16+
"problem-solution",
17+
new ResourceTemplate("solution://{topicId}", {
1818
list: undefined
1919
}),
2020
{
2121
description:
22-
"Provides the complete content and metadata of a specific solution article on LeetCode Global, including the full article text, author information, and related navigation links. The topicId parameter in the URI identifies the specific solution article. This ID can be obtained from the 'topicId' field in the response of the 'leetcode_solution_article_list' tool.",
22+
"Provides the complete content and metadata of a specific problem solution, including the full article text, author information, and related navigation links. The topicId parameter in the URI identifies the specific solution. This ID can be obtained from the 'topicId' field in the response of the 'list_problem_solutions' tool.",
2323
mimeType: "application/json"
2424
},
2525
async (uri, variables, extra) => {
@@ -47,7 +47,7 @@ export class SolutionResourceRegistry extends ResourceRegistry {
4747
{
4848
uri: uri.toString(),
4949
text: JSON.stringify({
50-
error: "Failed to fetch solution article",
50+
error: "Failed to fetch solution",
5151
message: error.message
5252
}),
5353
mimeType: "application/json"
@@ -60,15 +60,15 @@ export class SolutionResourceRegistry extends ResourceRegistry {
6060
}
6161

6262
protected registerChina(): void {
63-
// China solution article resource
63+
// China solution resource
6464
this.server.resource(
65-
"solution-article",
66-
new ResourceTemplate("leetcode://solutions/{slug}", {
65+
"problem-solution",
66+
new ResourceTemplate("solution://{slug}", {
6767
list: undefined
6868
}),
6969
{
7070
description:
71-
"Provides the complete content and metadata of a specific solution article, including the full article text, author information, and related navigation links. This slug can be obtained from the 'node.slug' field in the response of the 'leetcode_solution_article_list' tool.",
71+
"Provides the complete content and metadata of a specific solution, including the full article text, author information, and related navigation links. This slug can be obtained from the 'node.slug' field in the response of the 'list_problem_solutions' tool.",
7272
mimeType: "application/json"
7373
},
7474
async (uri, variables, extra) => {
@@ -96,7 +96,7 @@ export class SolutionResourceRegistry extends ResourceRegistry {
9696
{
9797
uri: uri.toString(),
9898
text: JSON.stringify({
99-
error: "Failed to fetch solution article",
99+
error: "Failed to fetch solution",
100100
message: error.message
101101
}),
102102
mimeType: "application/json"

‎src/mcp/tools/contest-tools.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ export class ContestToolRegistry extends ToolRegistry {
1111
protected registerCommon(): void {
1212
// User contest ranking tool
1313
this.server.tool(
14-
"leetcode_user_contest_ranking",
15-
"Retrieves a user's comprehensive contest ranking information on LeetCode, including overall ranking, participation history, and performance metrics across contests",
14+
"get_user_contest_ranking",
15+
"Retrieves a user's contest ranking information on LeetCode, including overall ranking, participation history, and performance metrics across contests",
1616
{
1717
username: z
1818
.string()

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /