Implement Code
implement_codeConvert a specification into implementation code for functions, classes, modules, or API endpoints. Provide context and constraints to align with existing code.
Instructions
Generate implementation code from a specification.
Use this tool when you need the local model to write a function, class, module, API endpoint, CRUD logic, glue code, or any other implementation artefact. Provide as much context and constraints as possible for the best results.
IMPORTANT: Always review the returned code before accepting it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context | No | Existing code, imports, type definitions, or file contents that the implementation must integrate with. Provide as much relevant context as possible for higher quality output. | |
| language | Yes | Programming language (e.g. 'python', 'typescript', 'rust'). | |
| max_tokens | No | Max tokens to generate. Defaults to server config. | |
| constraints | No | Coding conventions, performance requirements, library restrictions, edge cases to handle, or any other rules the implementation must follow. | |
| temperature | No | Sampling temperature override (0.0–1.0). Lower = more deterministic. | |
| task_description | Yes | Precise specification of what to implement. Include function signatures, expected behavior, input/output types, and edge cases. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | The generated artefact (code, tests, documentation). None on failure. | |
| error | No | Human-readable error message. None on success. | |
| success | Yes | Whether the generation completed successfully. | |
| metadata | No | Auxiliary data: token usage, elapsed time, quality warnings, etc. |