Skip to main content
Glama

get_approach

Analyzes a LeetCode problem statement to recommend a DSA approach, pattern name, and time/space complexity, helping you choose the right strategy.

Instructions

Takes a LeetCode problem statement and returns the recommended DSA approach, pattern name, and time/space complexity.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "problem": "<problem>"
    },
    "name": "get_approach"
  }
}

Input Schema

NameRequiredDescriptionDefault
problemYesThe full LeetCode problem statement

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It does disclose the shape of the result (approach, pattern, complexity), which is useful behavioral context and implies a read-only advisory operation. It says nothing about determinism, caching, source of the recommendation, or handling of ambiguous problem statements.

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

Conciseness4/5

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

One sentence with the verb front-loaded and no filler. It packs input and all three outputs economically. It could be marginally clearer if the output list were separated from the input clause rather than being a long run-on.

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?

For a single-parameter tool with no output schema, the description should clarify return structure and format, which it only gestures at by naming three fields. It is also silent on the overlap with get_complexity and get_hint, leaving the agent to guess routing among siblings. Adequate at minimum viability but with real gaps.

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% and the single parameter 'problem' is documented as 'The full LeetCode problem statement'. The description restates that same concept without adding constraints such as length limits, expected formatting, or title-only input. Baseline 3 is appropriate when the schema already does the work.

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?

Specific verb-resource pair: takes a LeetCode problem statement and returns a recommended DSA approach, pattern name, and time/space complexity. The three return fields make the purpose concrete. However, it never distinguishes itself from the sibling get_complexity, which plainly overlaps on the complexity output, so an agent cannot fully tell them apart from the text alone.

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?

Usage is only implied: the input description ('full LeetCode problem statement') signals the situation in which the tool applies. There is no explicit when-to-use versus when-to-use-a-sibling guidance and no exclusions, such as directing complexity-only questions to get_complexity or hints to get_hint.

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