Skip to main content
Glama

code_executor

Solve computational tasks by iteratively writing and executing Python code in a stateful sandbox, producing numeric, data, or analysis answers.

Instructions

Solve a task by letting Grok run Python in a stateful sandbox.

The agent iteratively writes and executes Python (with common scientific
libraries) to arrive at a numeric, data, or analysis answer.

Args:
    prompt: Task or question requiring computation.
    model: Grok model driving the agent (default `grok-4.3`).
    max_turns: Cap the number of reasoning/execution turns.

Returns:
    Markdown with the final answer followed by each code execution block's stdout.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYes
modelNogrok-4.3
max_turnsNo
Behavior3/5

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

With no annotations, the description carries full burden. It discloses statefulness, iterative execution, and a max_turns cap, but does not mention security restrictions, state persistence between calls, or error handling behavior. It provides moderate transparency.

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

Conciseness4/5

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

The description is well-structured with a summary, process explanation, and clear Args/Returns sections. It front-loads the purpose. While slightly verbose, it is efficiently organized.

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?

The description explains the return format (Markdown with answer and stdout) and the iterative process, but it does not address error cases, output truncation, or state behavior across invocations. It is adequate for a straightforward tool but leaves some gaps.

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 description coverage is 0%, but the description explains each parameter in detail: prompt as 'Task or question requiring computation', model with default value, and max_turns capping turns. This adds significant meaning beyond the schema's type-only definitions.

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 'Solve a task by letting Grok run Python in a stateful sandbox.' It identifies the verb 'solve' (via code execution) and the resource 'Python sandbox', distinguishing it from sibling tools like chat or web_search.

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 usage through the mechanism (iterative coding for computational tasks), but it does not explicitly state when to use this tool over alternatives or provide when-not guidance. The context 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.

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/merterbak/Grok-MCP'

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