Skip to main content
Glama

Execute Code

execute_code
Destructive

Run code snippets in Python, Node.js, or Bash to compute, transform data, or test logic. Returns exit code and captured output.

Instructions

Run a snippet of code and return its output. Use this to compute, transform data, or test logic instead of doing it in your head.

Args:

  • language ('python'|'node'|'bash'): Interpreter to use.

  • code (string): The source code. Print results to stdout.

  • stdin (string): Optional text piped to the program's stdin.

Returns exit code plus captured stdout/stderr. Killed after the configured timeout.

Example: { "language": "python", "code": "print(sum(range(100)))" }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
languageYesInterpreter
codeYesSource code to run
stdinNoOptional stdin input
Behavior4/5

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

The description discloses the tool's destructive nature (via annotations) and adds specifics about return format (exit code, stdout/stderr) and timeout behavior. This goes beyond annotations, though it could mention sandboxing or limitations.

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 concise, well-structured with a clear opening, bullet-pointed args, return info, and an example. Every sentence serves a purpose.

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

Completeness4/5

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

Given the presence of annotations and full schema, the description covers usage, output, and provides an example. It is sufficiently complete for an agent to invoke correctly, though it could add more safety context.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3. The description adds value by explaining the purpose of each parameter, providing an example, and clarifying that stdin is optional and code output goes to stdout. This justifies a 4.

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

Purpose4/5

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

The description clearly states the tool runs code and returns output, with specific use cases. However, it does not explicitly differentiate from sibling computational tools like calculator or json_query, so it's not a perfect 5.

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 provides a general guideline ('use this to compute, transform data, or test logic instead of doing it in your head') but lacks when-not-to-use or comparisons to siblings. Given the presence of many computational siblings, more explicit guidance would be helpful.

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/highercomve/mcptools'

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