Skip to main content
Glama

list_ai_provider_models

Lists model IDs available from an OpenAI-compatible provider using a stored secret reference, so you can choose a model for routing without exposing the API key.

Instructions

List the model ids an OpenAI-compatible provider offers (submitter or admin).

    The daemon calls ``GET {base_url}/models`` with the referenced shared
    key, so you can pick a model for ``set_ai_route`` while the key stays on
    the machine. Returns ``{base_url_host, models}`` (sorted ids only).
    Read-only despite the POST underneath (no idempotency key).
    Refusals: 422 ``ai_gateway.base_url_invalid`` / ``ai_gateway.secret_ref_invalid``,
    503 ``secret_missing``, 502 ``ai_gateway.provider_unreachable`` /
    ``ai_gateway.provider_error`` (the HTTP status, never the provider's text).
    

Input Schema

NameRequiredDescriptionDefault
base_urlYesOpenAI-compatible base URL, usually ending in ``/v1``; https to a public host, or http to loopback or the models bridge.
api_key_refYesA ``${secrets.shared.KEY}`` reference to the provider key, set beforehand with ``set_secret`` on scope ``shared``. Never the key itself.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: it discloses the upstream call (GET {base_url}/models using the referenced shared key), that the key never leaves the machine, the return shape {base_url_host, models}, that it is read-only despite an underlying POST, and the exact refusal codes (422/503/502) without leaking provider text.

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?

Purpose is front-loaded in the first line, followed by mechanism, return shape, safety note, and error codes in a tight order. Dense but every chunk carries information; the error-code block is the only part that could be trimmed.

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?

No output schema exists, and the description supplies the exact return shape and field semantics, plus the failure modes an agent must handle. Nothing material needed 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.

Parameters3/5

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

Schema description coverage is 100%, so both base_url and api_key_ref are already documented as an /v1 URL and a ${secrets.shared.KEY} reference. The description reinforces the secret-stays-local guarantee but adds little syntax or format detail beyond the schema, matching the baseline 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource with scope: 'List the model ids an OpenAI-compatible provider offers (submitter or admin).' That is clearly distinct from the local-model sibling list_models, and it names the downstream consumer (set_ai_route), though it never explicitly contrasts itself with list_models.

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?

Provides clear usage context — call it to pick a model id before configuring set_ai_route — plus the caller role requirement (submitter or admin). It stops short of naming an explicit alternative or when-not condition.

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