Skip to main content
Glama
CLO Atelier

CLO Atelier

by benproj

Run Python in CLO

clo_execute_python

Run Python code on CLO 3D’s main thread to handle tasks beyond built-in tools, using CLO APIs, persistent variables, and JSON or OS utilities.

Instructions

Run Python inside CLO on its main thread, for anything the other tools do not cover. In scope: utility_api, pattern_api, fabric_api, import_api, export_api, rest_api, ApiTypes (option structs such as ApiTypes.ImportExportOption()), json and os. Variables persist between calls. Returns the value of the last expression, or of a variable named result, plus anything printed. Look functions up with clo_search_api first.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "code": "<code>"
    },
    "name": "clo_execute_python"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesPython source to execute.
timeout_sNoSeconds to wait for CLO before giving up.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.1

TDQS

A4.7/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does most of it: it discloses main-thread execution, the exact module/API surface in scope, and the critical stateful trait that "Variables persist between calls." It also specifies return semantics (last expression, or a variable named `result`, plus stdout) and the timeout behavior via the parameter. Remaining gaps are error/failure reporting and whether persistence survives across sessions.

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?

Front-loads the core purpose and the fallback scope in the first clause, then packs scope, persistence, and return semantics into compact sentences with no filler. The API-surface list is dense but each item delimits what is legal to call, so it earns its space.

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?

For a two-parameter escape-hatch tool with no output schema, the description supplies exactly what an agent needs: legal API surface, state model, return-value contract, and the prerequisite lookup tool. Nothing required to invoke it correctly is left unspecified.

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 the baseline is 3, but the description adds real meaning about what the `code` parameter should produce — the `result` variable convention and the returned-last-expression rule — which the schema's "Python source to execute" does not convey. It says nothing extra about `timeout_s` beyond the schema's own bounds and description.

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 ("Run Python inside CLO on its main thread") and immediately scopes it as the fallback: "for anything the other tools do not cover." That framing lets an agent place it relative to the enumerated clo_* siblings 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 selection rule (use only where the other tools do not cover the task) and a mandatory prerequisite step: "Look functions up with clo_search_api first." The when-to-use, the alternative, and the ordering between tools are all stated rather than inferred.

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