MCP server that executes Python code snippets with optional pip dependencies
Single tool 'code_exec_python' has a well-structured definition with complete schema, solid description, and clear parameter documentation. The tool follows verb_noun naming convention and provides actionable output. However, there are gaps in error handling guidance, output schema documentation, and security considerations around code execution risks. The description is comprehensive (>200 chars) and parameter types are properly defined. No per-parameter descriptions visible in the schema, which costs points. Overall a B-grade tool definition with room for hardening around security and error classification.
Executes a Python code snippet with optional pip dependencies. The Python3 runtime has access to networking, the filesystem, and the standard library. A non-zero exit code is an error and should be fixed. Returns: JSON containing: - 'returncode': Exit status of the execution. - 'stdout': Captured standard output. - 'stderr': Captured standard error or install failure messages.
Missing per-parameter descriptions in schema. 'packages' parameter has a description ('Optional list of pip package names to install before execution'), but 'code' parameter description is missing from the visible schema definition, only the JSON type is declared. Parameter descriptions are critical for LLM understanding of constraints and use cases.
No documented output schema structure. The description states the tool returns 'JSON containing returncode, stdout, stderr' but provides no formal schema definition (JSON Schema) for the response object. LLMs need to know field names, types, and meanings to parse responses and plan downstream actions.
Error handling lacks recovery guidance and classification. The tool description mentions 'A non-zero exit code is an error and should be fixed' but does not specify which errors are retryable (e.g., temporary package install failures) vs user-fixable (e.g., syntax errors in code) vs fatal (e.g., security policy violations). No guidance on how agents should respond to different error scenarios.
Inferred effective spec: 2026-07-28+.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | C | 68 | 2026-07-28+ | v2 |
| 2026-03-09 | D | 50 | - | v1 |
No security guidance for code execution. The tool description mentions 'has access to networking, the filesystem, and the standard library' but does not warn about the inherent risks or document constraints (e.g., no internet access, sandboxing limits, execution timeouts, prohibited modules). A tool marked as WRITE risk needs clear security boundaries and audit expectations.
Missing idempotency statement. Code execution is inherently stateful and non-idempotent (running 'import random; print(random.random())' twice produces different output). The description should explicitly state this so agents understand retries will produce new results, not replay old ones.
Packages parameter lacks constraints. 'packages' is declared as a nullable array but has no documented limits on array size, package name format validation, or guidance on when packages should be used vs pre-installed. LLMs may pass arbitrary pip package lists without understanding constraints.