Skip to main content
Glama

Run utility

run_utility
Read-onlyIdempotent

Run a single string utility on an input to transform, encode, decode, hash, or convert data, returning the output with optional encoding details.

Instructions

Run a single utility on input and return {output, outputEncoding?}. For two or more transformations in a row, make one run_pipeline call instead of chaining run_utility calls; if you do not know the id yet, find it with list_utilities. Plain text output is returned as-is; a JSON-producing utility returns pretty-printed JSON text; a byte-producing utility (e.g. gzip_compress, get_bytes) returns base64 with outputEncoding: "base64". inputEncoding controls how input itself is decoded first: "text" (default) uses it as-is, "base64" or "hex" decode it to raw bytes, "json" parses it. Params are validated against describe_utility's spec; invalid ones are rejected. Input is capped at 1,000,000 bytes, output text past 1,000,000 characters is cut off (flagged truncated, with fullLength), and the call is stopped after 20s. A failing utility returns isError with the error message. Utilities that run arbitrary user JavaScript (e.g. "custom_js") are refused, and the few that need a browser DOM parser (e.g. "xml_to_json", "html_table_to_csv") fail here.

Input Schema

NameRequiredDescriptionDefault
idYesUtility id (see list_utilities / describe_utility).
inputYesThe value to run the utility on.
paramsNoUtility parameters (see describe_utility for names/kinds); params left out use their declared default.
inputEncodingNoHow to decode `input` before passing it to the utility. Default "text".

Output Schema

NameRequiredDescriptionDefault
outputYesThe result: text as-is, JSON pretty-printed, bytes as base64.
truncatedNoTrue when `output` was cut off at the output limit.
fullLengthNoLength `output` would have had untruncated, when `truncated`.
outputEncodingNoPresent when `output` is base64-encoded bytes.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.8.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare this a safe, idempotent read, so the description's job is to add operational context — and it does: base64 output encoding for byte-producing utilities, pretty-printed JSON for JSON utilities, the 1,000,000-byte input cap, 1,000,000-character output truncation with `truncated`/`fullLength` flags, a 20s timeout, and isError on failure. These are real behavioral traits an agent cannot infer from the 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?

Front-loaded with the core action and the primary alternative before any detail, then layers output encoding, decoding semantics, limits, and error behavior in a logical order. Every sentence carries distinct information — no restatement of the name or the annotations.

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 dynamic-dispatch tool with nested free-form `params` and an output schema, the description covers everything an agent needs: how to discover ids, how input and output encodings work, validation behavior, size/time limits, truncation signalling, error signalling, and known unsupported utility classes. Nothing material is left to inference.

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 100%, so the baseline is 3; the description earns a step up by explaining what each `inputEncoding` value actually does to the bytes ('text' as-is, 'base64'/'hex' decode to raw bytes, 'json' parses) and by noting that omitted `params` fall back to declared defaults and are validated against describe_utility's spec. It stops short of describing individual utility param kinds, which is reasonable given they are dynamic.

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?

Opens with a specific verb+resource ('Run a single utility on `input`') and states the return shape, immediately distinguishing it from the batch sibling by saying 'For two or more transformations in a row, make one run_pipeline call instead of chaining run_utility calls.' An agent can pick this tool over run_pipeline or list_utilities without opening a 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 routing rules: chain two or more steps through run_pipeline, resolve an unknown id via list_utilities, and check params via describe_utility. It also names when-not conditions (arbitrary-JS utilities are refused, DOM-parser utilities fail here), which is exactly the exclusion guidance most definitions omit.

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