Skip to main content
Glama

check_python_syntax

Check Python code syntax with AST parsing to catch errors before execution. Provide code or script path for immediate validation.

Instructions

Check Python code syntax without executing. Uses Python's ast.parse.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNoPython code to check (mutually exclusive with script_path)
script_pathNoPath to Python script to check (mutually exclusive with code)

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv1.0.0

TDQS

A3.9/5.0
Behavior3/5

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

No annotations are present, so the description carries the full burden of behavioral disclosure. It does disclose the most important trait—no execution—but says nothing about what happens for invalid syntax (return value, error format, exit status) or whether script_path is read safely. This leaves a meaningful transparency gap.

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?

Two sentences with no filler; the core constraint is front-loaded and the implementation detail is one short clause. Every word earns its place.

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

Completeness3/5

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

For a two-parameter tool with full schema coverage this is close to adequate, but with no output schema or annotations, the agent is left guessing at the tool's response shape and error reporting. A brief note on what the tool returns would complete the picture.

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%, with both 'code' and 'script_path' already described, including their mutual exclusivity. The description adds no parameter-level detail, so the baseline 3 applies.

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?

States a specific verb ('Check'), a specific resource ('Python code syntax'), and the key constraint 'without executing.' It also names the implementation ('ast.parse'), which makes the tool's scope unambiguous and distinguishes it from siblings that run Python code.

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

Usage Guidelines4/5

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

The phrase 'without executing' conveys the tool's niche: syntax validation only. However, it never explicitly names run_python_code/run_python_script as alternatives or states a when-not condition, so routing is implied rather than explicit.

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

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/For-Sunny/darkside-mcp'

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