Skip to main content
Glama

Run utility

run_utility
Read-only

Execute a single string utility on input and return its output. Use run_pipeline for chaining multiple transformations.

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

TableJSON 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

TableJSON 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.8/5.0
Behavior5/5

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

Far exceeds the annotations (readOnlyHint/openWorldHint): it discloses output encoding rules (plain text as-is, pretty-printed JSON, base64 bytes with `outputEncoding`), hard limits (1,000,000-byte input cap, output truncated past 1,000,000 characters with `truncated`/`fullLength` flags), a 20s timeout, error behavior (isError with message), and outright refusals (custom_js) and documented failures (xml_to_json, html_table_to_csv). This is exactly the behavioral context annotations cannot carry.

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?

Front-loaded with the core action and the pipeline alternative, and nearly every sentence carries distinct operational information (encoding, limits, errors, refusals). It is dense and longer than typical, but not padded; the only mild cost is that limits/errors/refusals are packed into one long trailing 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?

For a 4-param tool with an output schema and only two booleans of annotation coverage, the description fills every remaining gap: encoding of both input and output, validation source, caps, timeout, truncation signaling, and known unsupported utilities. Nothing an agent needs to call it correctly is 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?

Schema coverage is 100%, so the baseline is 3, but the description adds real semantics beyond the schema: it explains what each `inputEncoding` value actually does ('base64'/'hex' decode to raw bytes, 'json' parses it) and that `params` are validated against describe_utility's spec with invalid ones rejected. The schema's own enum descriptions are thinner than this.

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+resource ('Run a single utility on `input`') plus the return shape, and explicitly distinguishes itself from the sibling run_pipeline ('make one run_pipeline call instead of chaining run_utility calls'). An agent can route between the two without opening either 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 when-not guidance ('For two or more transformations in a row, make one run_pipeline call instead') and a fallback path when the required `id` is unknown ('find it with list_utilities'). Alternatives and their selecting conditions are both named.

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