Skip to main content
Glama

get_random_problem

Selects a random LeetCode problem by difficulty, category, or topic tags and returns its details as JSON for mock interviews and algorithmic practice.

Instructions

Picks a random LeetCode problem optionally filtered by difficulty, category, and topic tags (read-only, no auth). Returns randomly selected problem details as JSON. Useful for mock interview preparation or algorithmic practice.

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": "get_random_problem"
  }
}

Input Schema

NameRequiredDescriptionDefault
tagsNoOptional topic tags, e.g. ['array', 'dynamic-programming']
categoryNoCategory filter (default: 'all-code-essentials')all-code-essentials
difficultyNoOptional difficulty filter: 'EASY', 'MEDIUM', or 'HARD'

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.5.1

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations provided, the description carries the full behavioral burden. It usefully discloses 'read-only, no auth' and that the result is JSON, but it does not describe behavior when filters yield no match, whether randomness is reproducible, or what details are returned.

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?

The description is three sentences and front-loads the core action, filters, and read-only/no-auth constraint. The return format and usage context follow efficiently, with no wasted wording.

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

Completeness3/5

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

The tool is low-complexity and all parameters are optional, but there is no output schema and no annotations. The description says JSON problem details are returned but does not specify the shape or contents, leaving an agent with only a partial picture of the response.

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 description coverage is 100%, so the enum values and parameter meanings are already fully documented in the input schema. The description restates that difficulty, category, and tags are optional filters but adds no syntax, defaults, or combination semantics beyond the schema.

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

Purpose4/5

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

The description states a specific verb and resource: 'Picks a random LeetCode problem' with optional filters. The word 'random' distinguishes it from deterministic siblings such as get_problem, but it does not explicitly name or compare against those alternatives.

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

Usage Guidelines3/5

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

It gives a usage context ('mock interview preparation or algorithmic practice') but does not say when to use this instead of get_problem, search_problems, or other sibling tools. There are no explicit exclusions or decision rules.

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