Skip to main content
Glama

api_execute

Destructive

Execute Ruby in a sandboxed VM against the Crevio REST API. Use api_search first to find the endpoint and its body fields, then call it here. Chain calls, transform results, return the final expression.

Available in your code

get(path, params = {})    # paths auto-prefixed with /v1, routed in-process
post(path, **body)        # body as keyword args or a hash — both work
patch(path, **body)
delete(path)
find_endpoints(query)     # -> ["METHOD /path — summary", ...]
iso8601(offset_seconds = 0)  # mruby Time has no strftime/iso8601

Returns the last expression; puts is side-channel only. Every run answers {result:, calls:, output:}calls audits each REST call (method, path, status, plus error_code/param on failure). When result has unexpected nils, read calls for a non-2xx. Never project only success fields ({id: r["id"]}) — that hides the error from result.

Rules that the schema does not tell you

  • Params are unwrapped, Stripe-style: fields at the TOP level. {product: {...}} is silently dropped by most endpoints.

  • Associations take the bare resource name and a prefix_id string — product: "prod_x", never product_id:. Some required ones never appear in a schema's properties.

  • Courses and content live under /experiences, NOT /products.

  • Lists answer {object: "list", data: [...], has_more}; single resources answer the object directly.

  • Connected integrations go through the same REST surface: post("/connections/<id>/execute", tool: "<tool>", arguments: {...}), with ids from get("/connections", search: "<service>").

  • Sandboxed mruby: no File, ENV, Net::HTTP, Process. 10s, 10 MB.

Example — publishing a product (the ordering trap)

A product cannot be created active: it needs a price variant first, or the call 422s.

product = post("/products", name: "...")
post("/price_variants", product: product["id"], name: "Standard",
     amount_type: "fixed", amount: 4900, currency: "usd", billing_type: "one_time")
patch("/products/#{product["id"]}", status: "active")

API groups: Access, Account, Ads, Analytics, ApiKeys, Approvals, Audio, BlogCategories, BlogPosts, Bookings, Bots, Broadcasts, Calls, Chapters, CheckoutConfiguration, CheckoutLinks, Checkouts, Connections, Customers, Deployments, Discounts, Domains, Email, EventSessions, EventSources, EventTypes, Events, Experiences, Files, FormSubmissions, FormationDocuments, Formations, Forms, ForumPosts, Images, Invoices, Jobs, Leads, LegalPages, Lessons, LinkItems, Logs, Me, OrderItems, Orders, Phone Consents, Phone Numbers, Phone Suppressions, PriceVariants, Products, Refunds, Reviews, Schedules, Secrets, Sites, Skills, Socials, Status, Subscriptions, Tags, TaskRuns, Tasks, Topics, Usage, Users, Video, Web, WebhookEndpoints, WebhookEvents.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesRuby code to execute. Use get/post/patch/delete for REST access or find_endpoints to discover endpoints.

TDQS

A5/5.0
Behavior5/5

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

Annotations already mark destructiveHint=true and readOnlyHint=false, but the description adds significant behavior beyond that: every run returns {result:, calls:, output:}, calls audits each REST call, puts is a side-channel, sandbox has no File/ENV/Net::HTTP, and there are 10s/10MB limits. It also warns about silent param dropping, unwrapped params, and the need to inspect calls for non-2xx errors. No contradiction with annotations.

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?

The description is long but appropriately structured and front-loaded: purpose and workflow first, then API surface, return contract, hidden rules, example, and API groups. For a code-execution tool with this many constraints and gotchas, the length is justified and each section earns its place.

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?

Covers invocation workflow, return envelope, failure diagnosis, sandbox limitations, endpoint naming quirks, and a worked example for a non-obvious ordering dependency. Even with no output schema, the description tells the caller exactly what to expect. An agent has everything needed to invoke the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but the schema only says 'Ruby code to execute.' The description adds the real programming model: available get/post/patch/delete/find_endpoints/iso8601 helpers, last-expression return semantics, Stripe-style unwrapped params, and the price-variant ordering pattern. This goes far beyond what the input schema communicates.

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 concrete action: 'Execute Ruby in a sandboxed VM against the Crevio REST API.' It lists the exact helper functions available and clearly differentiates the tool from api_search, which discovers endpoints rather than executing calls. An agent can tell exactly what this tool does and does not do.

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?

Explicitly instructs the agent to use api_search first to find endpoints and body fields, then call this tool. It also provides when-to-use context through endpoint rules, an ordering example, and a clear workflow for designing code. This is unusually strong guidance for selecting and using the tool.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A4/5.0
Disambiguation4/5

The direct API tools (api_search/api_execute) are clearly distinct from the agent workflow tools. The main ambiguity is between ask_crevio and start_chat, since both initiate agent runs, though one waits and the other does not.

Naming Consistency4/5

Most tools follow a clear verb_noun pattern (list_runs, get_run, send_message, cancel_run). The api_ prefix on api_execute/api_search and the lowercase whoami are minor deviations from an otherwise consistent convention.

Tool Count5/5

14 tools is well-sized for a server that combines direct REST API access with an agent run/chat lifecycle. Each tool has a distinct role and none feel redundant or unnecessary.

Completeness5/5

The REST surface is fully covered through api_search and api_execute, and the agent lifecycle is complete: start, continue, ask, wait, list, approve, cancel, and inspect runs/chats/messages. No critical operation appears to be missing.

Resources