Python Code Validator
Server Details
Validates, repairs and sandbox-runs AI-generated Python: lint, types, security, exact fixes.
- Status
- Healthy
- Last Tested
- Transport
- Streamable HTTP
- URL
- Repository
- jkanselaar/python-code-validator
- GitHub Stars
- 0
- Server Listing
- Python Code Validator
Glama MCP Gateway
Connect through Glama MCP Gateway for full control over tool access and complete visibility into every call.
Full call logging
Every tool call is logged with complete inputs and outputs, so you can debug issues and audit what your agents are doing.
Tool access control
Enable or disable individual tools per connector, so you decide what your agents can and cannot do.
Managed credentials
Glama handles OAuth flows, token storage, and automatic rotation, so credentials never expire on your clients.
Usage analytics
See which tools your agents call, how often, and when, so you can understand usage patterns and catch anomalies.
Tool Definition Quality
Average 4.9/5 across 3 of 3 tools scored.
Each tool has a distinct purpose: validate_python checks without running, repair_python fixes without running, and execute_python runs the code. The descriptions explicitly compare alternatives, eliminating any ambiguity.
All tool names follow the consistent verb_python pattern: execute_python, repair_python, validate_python. This is a clear and predictable naming convention.
With only 3 tools, the set is well-scoped and each tool earns its place, covering the core operations of validation, repair, and execution without unnecessary bloat.
The tool set covers the full lifecycle for Python code validation: diagnosis (validate), correction (repair), and runtime verification (execute). No obvious gaps exist for the server's stated purpose.
Available Tools
3 toolsexecute_pythonExecute PythonAIdempotentInspect
Everything repair does, and then RUNS the code in a throwaway container — no network, read-only filesystem, killed at options.timeout_s — reporting exit code, stdout and stderr. This is a side effect: do not submit code you do not want executed. Use it only when you need proof that the code runs, or that it prints the right thing. Alternatives: validate_python for the diagnosis and repair_python for the fix, neither of which runs anything. Auth: a key is required. This call needs a paid key and answers HTTP 402 without one. Credits are bought without an account, 10 per call: GET /v1/pricing says where to send the xDAI. Arguments: code: the whole file, 1..200000 bytes of UTF-8 measured after encoding (empty is refused with 400, larger with 413); a fragment is fine, but line and column numbers in the answer count from 1 in what you sent. language: must be 'python'; anything else is 400, and the field may be omitted. options.max_iterations (1..10, default 3) caps the fix/verify rounds: raise it for a file with several independent faults, leave it for a snippet. options.optimize (default false) additionally folds constants and drops dead code, and is only worth setting when you asked for a rewrite anyway. options.transpile_to (e.g. 'javascript') returns a translation of the repaired source in transpiled, not of what you sent. fixed_code is null when nothing could be proven safe to change, so treat null as 'no fix', not as an error. options.timeout_s (seconds, default 5) is the wall clock for the run; the schema allows up to 60 but this deployment caps it at 30 and refuses a larger value with 400. options.expected_output compares stdout byte for byte and adds an 'expected-output' diagnostic (valid=false) when it differs, which is how you ask for 'it did the right thing' rather than 'it ran'. The program that runs is the repaired one, so read fixed_code before you trust runtime.stdout, and it runs exactly once however many rounds the repair took. Returns valid, score 0..1, diagnostics (rule, message, line, column), security findings, fixes, fixed_code and runtime; see outputSchema. The code and its verdict are retained to improve the service.
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The source to check, as a whole file where possible: diagnostics carry the line and column of the text you send, and a fragment hides the imports and definitions the type check needs. A deployment may accept fewer bytes than the 200000 here. | |
| options | No | Tuning knobs. Most of them only take effect in the mode that does the corresponding work; see each field. | |
| language | No | The language of the code. A service that does not handle it refuses the request rather than guessing; the enum is shared across services, so it lists more than any one of them accepts. | python |
Output Schema
| Name | Required | Description |
|---|---|---|
| meta | Yes | |
| fixes | No | |
| score | Yes | |
| valid | Yes | |
| runtime | No | |
| security | No | |
| fixed_code | No | |
| transpiled | No | |
| diagnostics | No |
Tool Definition Quality
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Despite annotations (readOnlyHint=false, destructiveHint=false, idempotentHint=true), the description adds substantial behavioral context: sandbox details (no network, read-only filesystem, killed at timeout), side-effect warning ('do not submit code you do not want executed'), auth/payment requirements, timeout cap mismatch with schema, and the fact that the repaired code is what runs exactly once. No contradiction with annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is long but densely informative and front-loaded with the core purpose. Every sentence provides actionable detail (auth, argument semantics, return shape). It is somewhat verbose for a three-parameter tool, but the complexity of execution behavior justifies the length; minor redundancy with schema descriptions prevents a 5.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (execution, repair, options, outputs, auth, edge cases) and the presence of an output schema, the description covers all necessary aspects: side effects, parameter nuances, return values, and failure modes. It leaves no significant gaps for an agent to safely invoke the tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, but the description adds critical meaning beyond schema: code byte measurement and error codes (400/413), language restriction to 'python' only, max_iterations guidance for multi-fault files, optimize's limited value, transpile_to operating on repaired source, timeout deployment cap (30s vs schema 60), and expected_output's byte-for-byte comparison semantics.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states the tool runs code in a throwaway container, reporting exit code, stdout, and stderr, and clearly distinguishes it from siblings: 'Everything repair does, and then RUNS the code...'. It explicitly names validate_python and repair_python as alternatives that do not run anything.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides explicit when-to-use guidance: 'Use it only when you need proof that the code runs, or that it prints the right thing.' It also gives clear alternatives and exclusions: 'Alternatives: validate_python for the diagnosis and repair_python for the fix, neither of which runs anything.'
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
repair_pythonRepair PythonARead-onlyIdempotentInspect
Everything validation does, plus deterministic fixes: the corrected source comes back in fixed_code, and the original is kept whenever the fix cannot be proven safe. The code is still never run. Use it when validation failed and you want the fix rather than the diagnosis. Alternatives: validate_python when the diagnosis is enough; execute_python when the fix has to be proven to run. Auth: a key is required. This call needs a paid key and answers HTTP 402 without one. Credits are bought without an account, 3 per call: GET /v1/pricing says where to send the xDAI. Arguments: code: the whole file, 1..200000 bytes of UTF-8 measured after encoding (empty is refused with 400, larger with 413); a fragment is fine, but line and column numbers in the answer count from 1 in what you sent. language: must be 'python'; anything else is 400, and the field may be omitted. options.max_iterations (1..10, default 3) caps the fix/verify rounds: raise it for a file with several independent faults, leave it for a snippet. options.optimize (default false) additionally folds constants and drops dead code, and is only worth setting when you asked for a rewrite anyway. options.transpile_to (e.g. 'javascript') returns a translation of the repaired source in transpiled, not of what you sent. fixed_code is null when nothing could be proven safe to change, so treat null as 'no fix', not as an error. options.timeout_s and options.expected_output do nothing here: nothing is run, so there is no clock and no stdout. Returns valid, score 0..1, diagnostics (rule, message, line, column), security findings, fixes, fixed_code and runtime; see outputSchema. The code and its verdict are retained to improve the service.
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The source to check, as a whole file where possible: diagnostics carry the line and column of the text you send, and a fragment hides the imports and definitions the type check needs. A deployment may accept fewer bytes than the 200000 here. | |
| options | No | Tuning knobs. Most of them only take effect in the mode that does the corresponding work; see each field. | |
| language | No | The language of the code. A service that does not handle it refuses the request rather than guessing; the enum is shared across services, so it lists more than any one of them accepts. | python |
Output Schema
| Name | Required | Description |
|---|---|---|
| meta | Yes | |
| fixes | No | |
| score | Yes | |
| valid | Yes | |
| runtime | No | |
| security | No | |
| fixed_code | No | |
| transpiled | No | |
| diagnostics | No |
Tool Definition Quality
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Beyond annotations (readOnlyHint, destructiveHint, idempotentHint), the description discloses critical behavioral facts: 'The code is still never run', 'fixed_code is null when nothing could be proven safe to change', required auth with HTTP 402 without a key, and data retention. No contradictions with annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is long but efficiently structured: purpose, usage, auth, arguments, semantics, and returns. Every sentence adds information; there is no filler. It is front-loaded with the core purpose and maintains a logical flow.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description is complete for selection and invocation: it covers auth, when to use vs. alternatives, parameter semantics and edge cases, null behavior, and key return fields (fixed_code, diagnostics, etc.). With an output schema present, it omits low-level return details but lists the important fields. No significant gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Although schema coverage is 100%, the description adds valuable context: byte limits and encoding for code, 'must be python' for language, guidance on raising max_iterations, when optimize is worthwhile, and explicit note that timeout_s and expected_output are ignored. This goes well beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a clear and specific statement: 'Everything validation does, plus deterministic fixes...' and explains that the corrected source is returned in fixed_code. It contrasts with sibling tools by naming validate_python and execute_python, making the tool's unique purpose unmistakable.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicit guidance is given: 'Use it when validation failed and you want the fix rather than the diagnosis.' It also names alternatives and when to prefer them: 'validate_python when the diagnosis is enough; execute_python when the fix has to be proven to run.'
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
validate_pythonValidate PythonARead-onlyIdempotentInspect
Check Python source without running it: parse, lint (ruff), type-check (mypy), AST security policy, credential scan. Safe on code you do not trust. Use it on every Python file you generated or edited, before writing it to disk. Alternatives: repair_python to get the corrected source instead of the diagnosis; execute_python to prove the code runs. Auth: a key is required. A free key covers this call, 100 per day, then HTTP 429; get one with POST /v1/keys. Credits are bought without an account, 1 per call: GET /v1/pricing says where to send the xDAI. Arguments: code: the whole file, 1..200000 bytes of UTF-8 measured after encoding (empty is refused with 400, larger with 413); a fragment is fine, but line and column numbers in the answer count from 1 in what you sent. language: must be 'python'; anything else is 400, and the field may be omitted. Of options only transpile_to (e.g. 'javascript', which returns a translated copy in transpiled) acts here; timeout_s, max_iterations, optimize and expected_output need a pass that rewrites or runs the code, so send code alone. Ignored options are not refused, so a call that sets them looks like it worked; and code that does not parse is answered rather than refused: valid=false with the syntax error located, which is the point. Returns valid, score 0..1, diagnostics (rule, message, line, column), security findings, fixes, fixed_code and runtime; see outputSchema. The code and its verdict are retained to improve the service.
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The source to check, as a whole file where possible: diagnostics carry the line and column of the text you send, and a fragment hides the imports and definitions the type check needs. A deployment may accept fewer bytes than the 200000 here. | |
| options | No | Tuning knobs. Most of them only take effect in the mode that does the corresponding work; see each field. | |
| language | No | The language of the code. A service that does not handle it refuses the request rather than guessing; the enum is shared across services, so it lists more than any one of them accepts. | python |
Output Schema
| Name | Required | Description |
|---|---|---|
| meta | Yes | |
| fixes | No | |
| score | Yes | |
| valid | Yes | |
| runtime | No | |
| security | No | |
| fixed_code | No | |
| transpiled | No | |
| diagnostics | No |
Tool Definition Quality
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and destructiveHint=false, but the description adds substantial context: 'Safe on code you do not trust', auth/rate-limit behavior (key required, 100/day, HTTP 429, pricing endpoint), and retention ('The code and its verdict are retained to improve the service'). It also discloses that ignored options are not refused and that invalid code is answered rather than refused.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is front-loaded with a clear summary and organized into concise sections (overview, auth, arguments, returns). It is longer than the average tool description, but almost every sentence contributes operational detail; a few pricing/auth mechanics could be trimmed, yet they are actionable for an agent, so this remains appropriately sized.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers all essential context: purpose, safety, usage timing, authentication, rate limits, parameter constraints, error handling, sibling distinctions, and a return-field summary with a pointer to the output schema. Nothing needed for correct selection and invocation is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Even with 100% schema coverage, the description enriches each parameter: for 'code' it specifies byte limits after UTF-8 encoding, exact error codes (400 empty/413 larger), and line/column numbering; for 'language' it states only 'python' works and the field may be omitted. It also clarifies which options have no effect, adding meaning that the schema alone does not convey.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with 'Check Python source without running it: parse, lint (ruff), type-check (mypy), AST security policy, credential scan' — a specific verb and resource with a clear scope. It also names sibling tools as alternatives ('repair_python to get the corrected source instead of the diagnosis; execute_python to prove the code runs'), so there is no ambiguity about what this tool uniquely does.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives an explicit 'when to use' directive: 'Use it on every Python file you generated or edited, before writing it to disk.' It also explains when not to use it (for corrected source or runtime proof) and which options are relevant ('Only transpile_to ... acts here; ... timeout_s, max_iterations, optimize and expected_output need a pass that rewrites or runs the code').
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Claim this connector by publishing a /.well-known/glama.json file on your server's domain with the following structure:
{
"$schema": "https://glama.ai/mcp/schemas/connector.json",
"maintainers": [{ "email": "your-email@example.com" }]
}The email address must match the email associated with your Glama account. Once published, Glama will automatically detect and verify the file within a few minutes.
Control your server's listing on Glama, including description and metadata
Access analytics and receive server usage reports
Get monitoring and health status updates for your server
Feature your server to boost visibility and reach more users
For users:
Full audit trail – every tool call is logged with inputs and outputs for compliance and debugging
Granular tool control – enable or disable individual tools per connector to limit what your AI agents can do
Centralized credential management – store and rotate API keys and OAuth tokens in one place
Change alerts – get notified when a connector changes its schema, adds or removes tools, or updates tool definitions, so nothing breaks silently
For server owners:
Proven adoption – public usage metrics on your listing show real-world traction and build trust with prospective users
Tool-level analytics – see which tools are being used most, helping you prioritize development and documentation
Direct user feedback – users can report issues and suggest improvements through the listing, giving you a channel you would not have otherwise
The connector status is unhealthy when Glama is unable to successfully connect to the server. This can happen for several reasons:
The server is experiencing an outage
The URL of the server is wrong
Credentials required to access the server are missing or invalid
If you are the owner of this MCP connector and would like to make modifications to the listing, including providing test credentials for accessing the server, please contact support@glama.ai.
Discussions
No comments yet. Be the first to start the discussion!
Related MCP Servers
- Flicense-qualityCmaintenanceProvides a secure, containerized Python sandbox for executing LLM-generated code with multi-layer isolation, along with JSON/CSV validation and workspace state snapshots.
- Alicense-qualityDmaintenanceValidates AI-generated code against actual codebases to catch hallucinations, dead code, and API mismatches before runtime.171MIT
- Alicense-qualityCmaintenanceEnables LLMs to execute Python code securely in a sandboxed environment. Supports configurable restrictions like no network access and returns results including files.MIT
- Flicense-qualityCmaintenanceMCP-based code evaluation harness — sandboxed execution + LLM quality scoring.
Your Connectors
Sign in to create a connector for this server.