get_code_snippet
Retrieves starter boilerplate code for a LeetCode problem in a specified language, returning the snippet, language, and method signatures as JSON for coding without the full problem description.
Instructions
Retrieves starter boilerplate code for a problem in a specified programming language (read-only, no auth). Returns snippet, language, and method signatures as JSON. Use this when writing a solution and needing the exact starter template without fetching the full problem description.
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": {
"titleSlug": "<titleSlug>",
"lang": "<lang>"
},
"name": "get_code_snippet"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lang | Yes | Language slug or name (e.g., 'python3', 'javascript', 'cpp', 'java', 'typescript', 'rust', 'golang') | |
| titleSlug | Yes | Problem URL slug (e.g., 'two-sum') |