Skip to main content
Glama

List available OpenAI models

openai_list_models
Read-onlyIdempotent

List model IDs your OpenAI API key can access, with optional substring filter, pagination, and defaults. Use it to find the right model before calls or debug 'model not found' errors.

Instructions

List the model IDs the configured API key has access to, optionally filtered by substring.

Call this before guessing a model ID — OpenAI adds, renames and retires models regularly, and access differs per project. The response also reports the model IDs this server uses by default for each capability.

Args:

  • filter (string): case-insensitive substring match on the model ID, e.g. "embedding"

  • limit (number): 1-200 (default 50)

  • offset (number): pagination offset (default 0)

  • response_format ('markdown'|'json'): default 'markdown'

Returns (JSON format): { "total": number, // number of models matching the filter "count": number, // models in this response "offset": number, // current pagination offset "models": [ { "id": string, "owned_by": string, "created_at": string } // created_at is ISO 8601 UTC ], "has_more": boolean, "next_offset": number, // present only when has_more is true "defaults": { "text": string, "image": string, "embedding": string, "transcription": string, "speech": string, "moderation": string } }

Examples:

  • Use when: "Which embedding models can I use?" -> filter="embedding"

  • Use when: a generation failed with "model not found" -> call without filter and inspect the list

  • Don't use when: you only need the server's configured defaults for a single call — those are applied automatically

Error Handling:

  • "Error: Authentication failed" means OPENAI_API_KEY is invalid

  • An empty list with a filter set means no model ID contains that substring

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of models to return
filterNoCase-insensitive substring the model ID must contain, e.g. "embedding" or "image"
offsetNoNumber of matching models to skip, for pagination
response_formatNoOutput format: 'markdown' or 'json'markdown

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
countYes
totalYes
modelsYes
offsetYes
defaultsYes
has_moreYes
next_offsetNo

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv1.0.0

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the readOnlyHint/idempotentHint annotations, the description discloses that access differs per project, that the response includes the server's default model IDs per capability, and it explains how to interpret two error scenarios ('Authentication failed' and empty filtered results). This adds meaningful behavioral context.

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?

The description is well structured into purpose, arguments, return shape, examples, and error handling. It is detailed but every section serves a purpose and the most important usage guidance appears first.

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?

With an output schema present and four parameters fully documented in the schema, the description adds everything an agent still needs: when to call it, concrete example queries, pagination semantics, and error interpretation. Nothing critical 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 the schema already fully documents all four parameters. The description restates the same parameter semantics and adds only a small filter example ('embedding'), which is useful but not a substantial addition beyond the 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?

The description opens with a specific verb and resource: 'List the model IDs the configured API key has access to, optionally filtered by substring.' This clearly separates it from the sibling generation tools and names the exact purpose.

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?

It explicitly says 'Call this before guessing a model ID' and gives concrete 'Use when' and 'Don't use when' examples, including the actual failure case 'model not found'. It also tells the agent not to use it when only server defaults are needed, since those are applied automatically.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/piorkowskim79/openai-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server