Skip to main content
Glama

Run a custom function

run_function
Destructive

Enqueue a run of a sandboxed user function in the caller's workspace. Pass 'function_id' and an 'input' object (validated against the function's input_schema). Returns { run_id, status } — the run executes OFF the request path in the Deno sandbox; poll get_function_run until the status is terminal (ok/error/timeout). Fair-use limited by the plan's functions_runs_month allowance — over the limit it returns {status:'refused', ...} and enqueues nothing. Only the caller's own enabled function is runnable. CONFIRMATION: this tool is PROPOSED, never performed directly. You get status='confirmation_required' with an action_id and a plan_token, and the write happens only after confirm_action.

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": {
      "function_id": "<function_id>"
    },
    "name": "run_function"
  }
}

Input Schema

NameRequiredDescriptionDefault
inputNo
function_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations: the run executes off the request path in a Deno sandbox, the response is { run_id, status }, fair-use is bounded by functions_runs_month, and over-limit calls return status='refused' while enqueuing nothing. It also discloses the full confirmation handshake (status='confirmation_required', action_id, plan_token), which is exactly the context needed for a destructive, open-world tool.

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 but front-loaded: purpose, parameters, return+runtime model, limits, then the confirmation caveat. Nearly every sentence carries distinct information, though the confirmation paragraph and the polling clause compete for attention and could be tightened into a short procedural block.

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 an async, destructive, two-parameter tool with no output schema, the description supplies everything an agent needs: return shape, terminal statuses, the polling contract, the rate-limit refusal semantics, and the required confirmation step before any write.

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 0%, so the description carries the burden, and it does: function_id identifies the target function, and input is an object validated against that function's input_schema — a constraint the schema cannot express. It does not detail the shape of input beyond that indirection, which is acceptable since it is user-function-defined.

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 ('Enqueue a run of a sandboxed user function') plus scope ('in the caller's workspace'), which distinguishes it from create_function/update_function and makes the enqueue-vs-execute distinction explicit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear operational routing: poll get_function_run until the status is terminal, and the write only happens after confirm_action. It also states a hard precondition (only the caller's own enabled function is runnable) and the over-limit refusal path. It does not explicitly say when to prefer this over a sibling, but the polling and confirmation directives cover the main decision points.

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.

Resources