Execute Python, JavaScript, or SQL in a sandbox. Get stdout, execution time, errors. 10s timeout.
Single tool 'code_execute_sandbox' has a well-structured input schema with proper types (code: string, language: enum, timeout: number) and clear descriptions. The tool description is comprehensive (280+ chars) and explains WHAT it does, WHEN to use it, and what NOT to use it for, excellent pattern adherence. However, the output schema is documented only in prose within the description, not as a formal JSON Schema structure. The tool lacks explicit error handling guidance (e.g., 'If timeout occurs, reduce code complexity or increase timeout up to 10000ms'). Risk classification (IRREVERSIBLE) is present but not reflected in the description itself. Parameter descriptions are good but could be more prescriptive about constraints (e.g., 'timeout must be 1-10000ms, default 5000').
Use this when you need to execute Python, JavaScript, or SQL code in a sandboxed environment and get the output. Supports Python (subprocess), JavaScript (eval), and SQL (in-memory SQLite). 1. output: stdout captured from code execution (max 10KB) 2. language: the language that was executed 3. executionTimeMs: execution duration in milliseconds 4. exitCode: process exit code (0 = success) 5. error: error message if execution failed (null on success) Example output: {"output":"Hello World\n42\n","language":"python","executionTimeMs":234,"exitCode":0,"error":null} Use this FOR running calculations, data transformations, validating code snippets, or querying in-memory databases. Essential when you need computed results rather than static data. Do NOT use for persistent file storage -- sandbox is ephemeral. Do NOT use for generating hashes -- use crypto_generate_hash. Do NOT use for PDF generation -- use document_generate_pdf. Do NOT use for web scraping -- use web_scrape_to_markdown.
Output schema not formally documented in JSON Schema format. Prose description lists fields (output, language, executionTimeMs, exitCode, error) but no structured schema definition visible in code.
Error handling lacks recovery guidance. No description of what to do if timeout occurs, if code syntax is invalid, or if sandbox crashes. LLM has no actionable next step on failure.
Timeout parameter description does not state the constraint clearly. Should explicitly say 'must be 1-10000ms, default 5000' rather than relying on LLM to parse the range from prose.
Risk classification (IRREVERSIBLE) is metadata but not reflected in the tool description itself. Description should explicitly warn 'This tool executes code, ensure it is safe before running. Code execution is irreversible.'
Inferred effective spec: 2025-06-18+.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | C | 67 | 2025-06-18+ | v2 |
No confirmation or dry-run pattern for irreversible operations. Agents cannot preview code execution results before committing. Consider adding a 'dry_run' boolean parameter or a separate 'validate_code' tool.