Skip to main content
Glama

Run a custom model

run_custom_model

Run a user-supplied prompt against a developer-provided OpenAI-compatible or custom REST HTTPS model endpoint. Use validate_custom_model to test URL and adapter settings before sending. Returns model-generated text, model name, optional usage, and account state. Requires active trial or Pro and transmits prompt content to the selected provider. Credentials are transient, not persisted; localhost/private networks are not supported.

Input Schema

NameRequiredDescriptionDefault
modelNoModel identifier at the custom provider, when needed.
apiKeyNoTransient authentication key sent to the chosen provider; never log or embed in prompts.
promptYesRequired nonempty prompt to send externally, maximum 30,000 characters.
systemNoOptional system instructions supported by the endpoint.
baseUrlNoRequired public HTTPS base URL for openai-compatible mode.
authModeNoCustom REST authentication mode, default bearer.bearer
endpointNoRequired public HTTPS inference URL for custom-rest mode.
maxTokensNoOptional maximum output token count, subject to model limits.
uiLanguageNoInterface language name or code, e.g. EN; independent of source and response languages.EN
adapterModeYesAdapter for the target endpoint: openai-compatible or custom-rest.
promptFieldNoCustom REST request JSON key for prompt content.prompt
systemFieldNoCustom REST request JSON key for system instructions.system
temperatureNoOptional response sampling randomness between 0 and 2.
apiKeyHeaderNoCustom REST API-key authentication header name.x-api-key
extraHeadersNoExtra HTTP headers required by the provider, if any.
inputLanguageNoLanguage name or code of input text, e.g. es; defaults to EN.EN
outputLanguageNoRequested output language name or code, e.g. fr; defaults to EN.EN
responseTextPathNoOptional JSON response field/path containing generated text.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed18 schema fields changed
    • addedInput schema / properties / adapterMode / description
      Added value: +"Adapter for the target endpoint: openai-compatible or custom-rest."
    • addedInput schema / properties / apiKey / description
      Added value: +"Transient authentication key sent to the chosen provider; never log or embed in prompts."
    • addedInput schema / properties / apiKeyHeader / description
      Added value: +"Custom REST API-key authentication header name."
    • addedInput schema / properties / authMode / description
      Added value: +"Custom REST authentication mode, default bearer."
    • addedInput schema / properties / baseUrl / description
      Added value: +"Required public HTTPS base URL for openai-compatible mode."
    • addedInput schema / properties / endpoint / description
      Added value: +"Required public HTTPS inference URL for custom-rest mode."
    • addedInput schema / properties / extraHeaders / description
      Added value: +"Extra HTTP headers required by the provider, if any."
    • addedInput schema / properties / inputLanguage / description
      Added value: +"Language name or code of input text, e.g. es; defaults to EN."
    • addedInput schema / properties / maxTokens / description
      Added value: +"Optional maximum output token count, subject to model limits."
    • addedInput schema / properties / model / description
      Added value: +"Model identifier at the custom provider, when needed."
    • addedInput schema / properties / outputLanguage / description
      Added value: +"Requested output language name or code, e.g. fr; defaults to EN."
    • addedInput schema / properties / prompt / description
      Added value: +"Required nonempty prompt to send externally, maximum 30,000 characters."
    • addedInput schema / properties / promptField / description
      Added value: +"Custom REST request JSON key for prompt content."
    • addedInput schema / properties / responseTextPath / description
      Added value: +"Optional JSON response field/path containing generated text."
    • addedInput schema / properties / system / description
      Added value: +"Optional system instructions supported by the endpoint."
    • addedInput schema / properties / systemField / description
      Added value: +"Custom REST request JSON key for system instructions."
    • addedInput schema / properties / temperature / description
      Added value: +"Optional response sampling randomness between 0 and 2."
    • addedInput schema / properties / uiLanguage / description
      Added value: +"Interface language name or code, e.g. EN; independent of source and response languages."
  2. First observed

TDQS

A4.4/5.0
Behavior4/5

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

With annotations present, adds strong context: transmits prompt content externally, credentials transient/not persisted, no localhost/private networks, returns model text/name/usage/account state. Missing detail on failure modes or timeout behavior, but rich beyond annotations.

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 first, then validate sibling, then returns, then constraints. Every sentence earns its place though it is somewhat packed.

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 18-param outbound-call tool with no output schema, the description covers what it returns, the account gate, data transmission, credential handling, and network restrictions. Complete enough for correct invocation.

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 coverage is 100%, so the schema already documents all 18 params thoroughly. The description adds the localhost/private-network constraint and auth-mode context but no additional per-parameter meaning beyond schema.

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 (run a prompt against a model endpoint) and resource (OpenAI-compatible or custom REST endpoint). Clearly distinguishes from validate_custom_model (testing) and prepare_custom_compare.

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 names validate_custom_model as the prerequisite test step and states the account requirement (active trial or Pro). Tells the agent when to use this versus its validation 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.

Resources