Skip to main content
Glama

run_prompt_completion

Execute a prompt against the configured model to return a completion. Validate templates and billing metadata first, since this makes a billable model call.

Instructions

Execute a prompt against the configured model and return the completion. This makes a billable model call, so use render_prompt first when you want to check the template and validate_completion_metadata when billing fields are uncertain.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
metadataYesBilling metadata - client_id, app, env are REQUIRED for cost attribution
prompt_idYesPrompt ID or slug to execute
variablesYesVariable values to substitute into the template
hyperparametersNoOverride default hyperparameters

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYesWhether the tool call succeeded and returned structured data
dataNoStructured success payload when ok is true
errorNoStructured error payload when ok is false

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.12.2
    • removedInput schema / properties / variables / additionalProperties / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "boolean"
      -  }
      -]
    • addedInput schema / properties / variables / additionalProperties / type
      Added value: +[
      +  "string",
      +  "number",
      +  "boolean"
      +]
  2. Addedv1.0.1
  3. Removed
  4. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already disclose readOnlyHint=false, idempotentHint=false, and openWorldHint=true, so the write/non-idempotent/non-safe-to-retry profile is structurally covered. The description adds a genuinely valuable trait the annotations cannot convey: this triggers a billable model call, which is decision-relevant before invoking. It stops short of stating cost magnitude, rate limits, or failure/retry behavior.

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?

Two sentences, zero filler. The core action and its cost implication come first, and the alternative-tool routing is packed into a single efficient clause. Every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present, the return value need not be explained, and the description correctly focuses on routing and cost. Billable nature and alternative tools are covered, though it could optionally note side effects like analytics/logging that a non-read-only, open-world call may produce.

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

Parameters3/5

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

Schema description coverage is 100%, with all four top-level parameters and the nested metadata fields documented in the schema itself. The description adds no additional parameter meaning (no variable substitution rules, no hyperparameter guidance), so the baseline 3 applies.

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 ('Execute a prompt against the configured model and return the completion'), which unambiguously distinguishes it from siblings like render_prompt and validate_completion_metadata. An agent can identify this as the tool that actually produces model output without opening any 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?

Explicitly routes to alternatives with conditions: use render_prompt first to check the template, and validate_completion_metadata when billing fields are uncertain. This is textbook when-to-use guidance tied to concrete preconditions rather than vague hints.

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

Deploy Server

Other Tools