Skip to main content
Glama

Generate problem

generate_problem

Persist an agent-authored LeetCode-style DSA problem with structured fields (title, difficulty, prompt, examples, optional steps, reference approach) and return its unique id for later practice.

Instructions

Store an agent-authored, LeetCode-style DSA problem and return its id/slug. YOU (the agent) write the creative, immersive content; this tool persists it with structure so it can be practiced in a session. For multi-step problems, provide steps. Provide a referenceApproach (hidden from the solver) to ground hints and judging.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stepsNoOnly for multi-step problems
themeNo
titleYes
promptYesImmersive problem statement (markdown)
topicsYese.g. arrays, dp, graphs
examplesYes
difficultyYes
constraintsNo
starterCodeNoKeyed by language, e.g. { "typescript": "function ..." }
referenceApproachNoHidden from solver; grounds hints/reveals/judging
Behavior3/5

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

With no annotations provided, the description carries the burden. It mentions the tool returns an id/slug, and that 'referenceApproach' is hidden from the solver. However, it doesn't disclose potential side effects like overwriting existing problems or require permissions. It adds some value but lacks full transparency for a write operation.

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 two sentences with zero waste. It front-loads the purpose and return, then provides critical guidance. Every sentence earns its place.

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?

Given the tool's complexity (10 parameters, nested objects, no output schema), the description covers the essential purpose, usage guidance, and key optional features. It lacks explicit mention of return value structure, which would be helpful but not critical. Overall complete enough for an agent to understand when and how to use it.

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 50%, so baseline is 3. The description adds meaning for 'steps' and 'referenceApproach' but doesn't elaborate on other parameters like 'title', 'difficulty', or 'examples'. The schema already covers some, but the description could provide more context for required parameters.

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?

The description clearly states the verb 'Store' and the resource 'agent-authored, LeetCode-style DSA problem', and specifies the return value 'id/slug'. It distinguishes from sibling tools like 'explain_concept' and 'submit_solution' by focusing on problem creation.

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 description explicitly tells when to provide 'steps' (for multi-step problems) and to always provide 'referenceApproach'. It implicitly guides usage by stating the tool persists content for practice sessions. While it doesn't explicitly say when not to use it, the context makes it clear it's for creation, not solving.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/abp2204/learn-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server