Skip to main content
Glama
LeetCode MCP Server

LeetCode MCP Server

search_problems

Browse and discover LeetCode problems by category, tags, difficulty, or keywords, with pagination via limit and offset. Returns matching problems as JSON for selection or exploration.

Instructions

Searches LeetCode problems by category, tags, difficulty, and keywords (read-only, no auth). Supports pagination via limit/offset. Returns matching problem list as JSON. Use get_problem when you already know the titleSlug; use this to browse or discover problems.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "search_problems"
  }
}

Input Schema

NameRequiredDescriptionDefault
tagsNoTopic tags to filter by, e.g. ['array', 'dynamic-programming']. Omit for no tag filter.
limitNoMax results per page (default: 10)
offsetNoResults to skip for pagination (default: 0)
categoryNoProblem set category (e.g., 'algorithms', 'database'). Default: 'all-code-essentials'.all-code-essentials
difficultyNoDifficulty filter. Omit for all levels.
searchKeywordsNoKeyword search in problem titles and descriptions

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.5.0
  2. Removedv1.4.0
  3. First observed

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations supplied, the description carries the burden and does it reasonably well: read-only, no auth, paginated via limit/offset, JSON output. It stops short of rate limits, maximum returned count, or empty-result behavior, so it is strong but not exhaustive for an unannotated tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three short sentences, front-loaded with the capability, then pagination, then the sibling routing rule. No filler and no repetition of schema-level detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

All parameters are optional and fully documented, and the description notes a JSON problem list is returned, which substitutes for the absent output schema. A minor gap remains on ordering of results and page-size ceilings, but nothing an agent needs to call it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with detailed enum values and per-parameter descriptions, so the schema already documents all six parameters; the description only restates the filter names and pagination mechanism. Baseline 3 applies since little meaning is added beyond structured fields.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (searches) and resource (LeetCode problems) plus the filter dimensions, and explicitly contrasts itself with get_problem, which is the only sibling an agent could confuse it with. An agent can select between the two without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit routing rule: use get_problem when the titleSlug is known, use this tool to browse or discover. It also names the filter axes that qualify as browsing, leaving no ambiguity about the alternative.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.