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?

Beyond the annotations (destructiveHint=true, readOnly=false), the description richly discloses behavioral traits: the sandbox limitations, the last-expression return rule, the {result, calls, output} response shape, the audit trail in calls, silent param dropping, association conventions, content path quirks, list response shapes, and the ordering trap for publishing products. This substantially exceeds what annotations alone convey.

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 well-organized with clear headers, code blocks, rules, examples, and a compact API group list. Every major section earns its place given the tool's complexity, and the most important usage guidance is front-loaded in the first sentence.

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?

With no output schema, the description carries the burden of explaining return values, error visibility, resource shapes, and environmental limits—and it does so thoroughly. The tool has one free-form code parameter, and the description provides enough context for an agent to call it correctly, including what can go wrong and how to diagnose it.

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?

Although the schema covers 100% of the single parameter, the description adds immense value by documenting the available Ruby helpers, their signatures, how arguments map to REST calls, common pitfalls, and a full worked example. This goes far beyond the schema's minimal 'Ruby code to execute' 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?

The description clearly states the tool's function: execute Ruby in a sandboxed VM against the Crevio REST API. It distinguishes itself from api_search by explicitly positioning this tool as the execution step after discovery, and it lists the available helper methods.

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?

It gives explicit usage guidance: use api_search first to find the endpoint and body fields, then call api_execute. The description also provides sequencing, examples, and warnings about API-specific behaviors, making it clear when and how to use this tool versus the discovery sibling.

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
Disambiguation5/5

Each tool maps to a distinct resource-action pair: REST execution, endpoint discovery, chat/run lifecycle, approvals, and identity. Even similar tools like get_run and wait_for_run are clearly separated by blocking vs. non-blocking behavior.

Naming Consistency4/5

Most tools follow a clear snake_case verb_noun pattern (get_run, list_chats, send_message, cancel_run). Minor deviations like api_execute, api_search, ask_crevio, and whoami keep the set readable but prevent a perfect consistency score.

Tool Count5/5

Fourteen tools is within the well-scoped range and each tool has a meaningful role across API access, run management, chat interaction, approvals, and account identity. No obvious bloat or redundant duplicates.

Completeness4/5

The generic api_execute tool provides broad REST API coverage, and run/chat lifecycle tools are nearly complete. The ask_crevio description references a start_task tool that does not exist, though start_chat offers a workaround for launching runs without waiting.

Resources