Skip to main content
Glama

executeTool

Runs Python-like Starlark code in a sandbox to call allowed MCP tools and return a result, enabling safe multi-step tool orchestration.

Instructions

Executes Python-like (Starlark) code in a sandboxed interpreter with MCP tool access as Server.tool_name(param=value) (e.g., result = Filesystem.read_file(path=".")). Final step of listToolFiles -> readToolFile -> (optional) getToolDocs -> executeTool; read the stub first and use the exact callable name shown. Security: L1 code validation (no imports/classes/file-IO/network primitives), L2 sandboxed runtime (no external modules, no filesystem/network/process access except via MCP tools, memory isolation), L3 bounded execution timeout, L4 Tool ACL (only tools_to_execute-allowed CodeMode servers/tools are visible). STARLARK RULES: no try/except/raise, no classes, no imports, no f-strings (use % formatting), no is (use ==), synchronous calls only, dict access via result["key"], assign output to result. Each call runs in a FRESH ISOLATED SCOPE (no state persists); print() output is captured to logs. Returns {"result": ..., "logs": [...]}.

Input Schema

NameRequiredDescriptionDefault
codeYesStarlark code calling tools as result = Server.tool_name(param="value") — assign `result` to your final answer

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv6.1.1

TDQS

A4.8/5.0
Behavior5/5

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

No annotations are provided, so the description carries the full burden and does so: it discloses the four security layers (validation, sandbox, timeout, Tool ACL), states that each call runs in a fresh isolated scope with no persistence, that print() is captured to logs, and that it returns {result, logs}. That is exactly the mutation/execution-risk context an agent needs.

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?

Front-loaded with what the tool does, then workflow, then security, then syntax rules – a logical order with no filler sentences. It is dense and long for a one-param tool, but each block (workflow, ACL, Starlark rules) maps to a distinct failure mode an agent would otherwise hit.

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

Completeness5/5

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

Despite having no output schema and no annotations, the description specifies the return shape ({result, logs}), the isolation model, the timeout bound, and the ACL gate. Nothing material is missing for an agent to call this correctly.

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% and the single param's description already says to assign `result`, so the baseline would be 3. The description adds real value by constraining the code syntax (no imports/classes/try-except, % formatting, == not `is`, dict access via result["key"]), which genuinely shapes what goes into `code`.

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 and resource ('Executes Python-like (Starlark) code in a sandboxed interpreter') plus the distinctive capability of calling MCP tools as Server.tool_name(param=value). Named siblings (listToolFiles, readToolFile, getToolDocs) are positioned in the workflow, so an agent can tell this apart from the discovery tools without opening any schema.

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

Usage Guidelines5/5

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

Gives an explicit ordered workflow: listToolFiles -> readToolFile -> (optional) getToolDocs -> executeTool, plus the operational instruction to read the stub first and use the exact callable name shown. It effectively names the alternatives and the precondition that selects this one over them.

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