Skip to main content
Glama

Run Python Code

run_python_code

Execute Python code and return its output or error message for debugging and validation.

Instructions

Run the given Python code and return the output or error message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
inputsNo
check_typesNo
script_nameNomain.py
type_definitionsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.0.1

TDQS

C2.8/5.0
Behavior2/5

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

With no annotations, the description must fully disclose behavioral traits. It only mentions running code and returning output/error, omitting critical details like sandboxing, network access, side effects, timeouts, or security implications. For a code execution tool, this is a major gap.

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

Conciseness3/5

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

The description is concise (one sentence) and front-loaded with the primary action, but it does not add meaningful structure or detail. It is efficient but lacks substance beyond the basic statement, so it does not fully earn its place.

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

Completeness1/5

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

The tool has 5 parameters, no annotations, and no output schema. The description is far too minimal to enable correct invocation: it omits parameter semantics, return behavior, potential side effects, and any constraints. This is inadequate for a tool of this complexity.

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

Parameters1/5

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

Schema description coverage is 0%, and the description only implicitly references the 'code' parameter. It does not explain the purpose or usage of 'inputs', 'check_types', 'script_name', or 'type_definitions', leaving the agent without any guidance on how to use these parameters correctly.

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 runs Python code and returns output or error. This is a specific verb+resource that distinguishes it from the sibling tools (greet, generate_password, text_web_search, permutations) which are obviously unrelated in function.

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 does not explicitly state when to use this tool versus alternatives, but the sibling tools are for distinct tasks, so usage is implied. No explicit exclusions or conditions are provided, but the context makes the choice fairly obvious.

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