api_check_code
Statically check Python or TypeScript code against installed library versions to catch hallucinated APIs, wrong arguments, or deprecated calls before running it.
Instructions
Check code for hallucinated or misused APIs of installed versions (check code, comprobar código, validar)
Statically checks a snippet against the libraries installed in the environment: unknown modules/attributes (hallucinated or removed APIs), unexpected keyword arguments, too many positional arguments, missing required arguments, deprecated calls. Never runs the code. Run it on code you wrote before showing it; fix errors, re-check.
Args: code: the source (a whole file or a snippet; imports must be included). env: environment id, project folder path, or omitted for the default environment. language: "python" (full checks) or "typescript" (v1: named imports only).
Returns: {ok, findings: [{line, col, severity, code, symbol, message, suggestion}], checked, unchecked, libraries}. ok is false only for errors. severity "warning" = not a declared member but the class/module creates names dynamically, or deprecated. Babel stays silent on anything it cannot prove (dynamic code, unknown types, try/except ImportError, hasattr guards); those count in 'unchecked'. Keywords: check code, validate code, hallucinated api, does this exist, wrong arguments, verify snippet, comprobar codigo, revisar codigo, validar, existe, alucinacion
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| env | No | ||
| code | Yes | ||
| language | No | python |