Skip to main content
Glama
Gcore MCP Server
by G-Core

Execute Code

execute_code
Read-only

Run 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

NameRequiredDescriptionDefault
codeYesPython source to run.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Far beyond the readOnlyHint/openWorldHint annotations, it discloses pre-execution type-checking that aborts the script with the fix, the sandbox restrictions (no classes, `with`, files, network or env), the whitelisted imports, the asyncio.gather parallelism caveats, and the 55 s timeout. It also explains what is returned (last expression plus print output), which is essential given there is no output schema.

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?

Dense and front-loaded: the purpose and the import/call convention come first, constraints afterward. It is a single long paragraph and the sandbox/import caveats would read better as a short list, but nearly every clause carries actionable information and nothing is repeated filler.

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 tool whose complexity is entirely in the execution environment, the description covers the calling convention, in-script helpers, import whitelist, language restrictions, timeout behavior, return value shape, and the read-only boundary. Nothing an agent needs to write a first-pass working script appears to be missing.

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?

The schema fully documents the single `code` parameter but only as 'Python source to run', so the description carries the real semantic load: the import convention (`import gcore.cloud.volumes as volumes`), the await-call form, how operation names map to modules, and the helper functions call_tool/search_tools/get_tool_schema available inside the script. That is substantial meaning added beyond the schema, though a few arg-format details are delegated to get_tool_schema's 'returns'.

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 a short Python script against the Gcore API') plus the scope condition ('tasks needing several calls, loops or filtering'). It also implicitly distinguishes itself from the single-call siblings, which are named later, so an agent can identify this as the batch/orchestration path without opening the 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 explicit selection criteria ('tasks needing several calls, loops or filtering; intermediate data stays out of the conversation') and a hard exclusion: scripts can only call read operations, so changes must go through call_write_tool or call_destructive_tool. It also warns to split large sweeps because of the 55 s cutoff, which is a usage constraint an agent would otherwise trip over.

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