Execute Code
execute_codeRun a short Python script against the Gcore API for multi-call tasks, loops, or filtering; intermediate data stays out of the conversation.
Instructions
Run a short Python script against the Gcore API for tasks needing several calls, loops or filtering; intermediate data stays out of the conversation. Call operations as typed functions: an operation's module is its name without the method, e.g. import gcore.cloud.volumes as volumes then await volumes.list(region_id=76). Results are dicts with the fields get_tool_schema's 'returns' lists (list items under its list_key, usually 'results'). Scripts are type-checked first: a wrong operation, argument or field name stops the script before any call, with the fix. Also available (await each): call_tool(name, **kwargs) for names in variables, search_tools(query), get_tool_schema(name). Import json, re, datetime, asyncio before use (asyncio.gather runs calls in parallel; neither it nor json.dumps takes default=/return_exceptions=). No classes, with, files, network or env. Returns the last expression and print() output. A script stops after 55 s: split large sweeps (e.g. one project per script). Scripts can only call read operations; make changes with call_write_tool or call_destructive_tool.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Python source to run. |