Skip to main content
Glama
jkanselaar

Python Code Validator

python_code_validator

Validates Python code with syntax, lint, security, and credential checks, then returns a verdict score and optional deterministic repair.

Instructions

Validate Python: syntax and lint diagnostics, a security policy over the AST, a credential scan and deterministic repair. Returns a verdict with a score.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesThe Python source to validate.
modeNostatic analyses only; repair also returns fixed code; execute runs it in a sandbox. repair and execute need a paid key.static
filenameNoName to report diagnostics against.
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full responsibility for behavioral disclosure. It mentions 'deterministic repair' and a 'verdict with score', but it omits critical behavioral traits: the existence of an execute mode that runs code in a sandbox, the requirement of a paid key for repair/execute, and the potential side effects of those modes. The description is too high-level to prepare the agent for side effects or prerequisites.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, well-structured sentence that front-loads the core purpose ('Validate Python') and then lists distinct capabilities. It is concise, with no filler or redundancy, making it easy to scan.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with multiple modes including sandboxed execution and paid-key requirements, the description is incomplete. It does not mention the mode parameter, the sandbox, the key requirement, or how a 'verdict with score' is structured. Without an output schema, the description should provide more context, but it gives only a high-level overview.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%: all three parameters (code, mode, filename) have descriptions, so the baseline is 3. The description does add high-level context (e.g., 'security policy over AST' infers the mode's purpose) but does not add details beyond the schema. It neither enriches nor conflicts with parameter meanings.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Validate Python') and lists concrete capabilities: syntax and lint diagnostics, security policy over AST, credential scan, and deterministic repair. It also states the output ('verdict with a score'). This is much more specific than a tautological description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the tool is for validating Python code, but it does not provide explicit guidance on when to use it versus alternatives (though no siblings exist) or when not to use it. It also fails to mention the mode-dependent key requirements and sandbox execution, which are crucial usage constraints; these are only found in the schema.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jkanselaar/python-code-validator'

If you have feedback or need assistance with the MCP directory API, please join our Discord server