Skip to main content
Glama

upsolve

Guides users from a working but suboptimal LeetCode solution toward a better optimization approach without revealing it, focusing on performance rather than correctness.

Instructions

Given a working but suboptimal solution, nudges the user toward a better approach without revealing it. Focuses on optimization, not correctness.

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>",
      "solution_code": "<solution_code>"
    },
    "name": "upsolve"
  }
}

Input Schema

NameRequiredDescriptionDefault
problemYesThe full LeetCode problem statement
solution_codeYesThe user's current working solution

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.7/5.0
Behavior3/5

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

No annotations are supplied, so the description must carry behavioral disclosure. It usefully states that the tool nudges 'without revealing' the better approach and focuses on optimization, but it omits output format (e.g., hint, question, or list), how many hints, and whether it is read-only.

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?

Two sentences, tightly scoped, with no redundant wording. The action is front-loaded and the scope clarification follows efficiently.

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 tool with no output schema and no annotations, the description should explain what the nudge looks like. It conveys the core behavior but leaves the return shape and interaction pattern unspecified, so an agent cannot fully predict the result.

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?

The schema fully documents both parameters (100% coverage), so the baseline is 3. The description adds little beyond implying that solution_code must be working and suboptimal, which is a useful constraint but does not add syntax or format details.

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 action: nudging a user toward a better approach for a working but suboptimal solution. It distinguishes from correctness-oriented tools by specifying 'Focuses on optimization, not correctness,' though it does not explicitly name a sibling alternative.

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

Usage Guidelines4/5

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

The condition 'Given a working but suboptimal solution' provides clear when-to-use context, and 'not correctness' implies a boundary. However, it does not name alternatives like get_hint or get_approach, so the agent must infer the routing from context.

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