Skip to main content
Glama

list_models

Retrieve all available models for a specified LLM provider (e.g., OpenAI, Anthropic, Google Gemini) through the Just Prompt MCP server, enabling efficient model selection.

Instructions

List all available models for a specific LLM provider

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
providerYesProvider to list models for (e.g., 'openai' or 'o')

Implementation Reference

  • Handler logic in the call_tool function that invokes list_models_func with the provider argument and formats the list of models as TextContent for the MCP response.
    elif name == JustPromptTools.LIST_MODELS:
        models = list_models_func(arguments["provider"])
        return [TextContent(
            type="text",
            text=f"Models for provider '{arguments['provider']}':\n" + 
                 "\n".join([f"- {model}" for model in models])
        )]
  • Pydantic schema defining the input for the list_models tool, requiring a 'provider' string field.
    class ListModelsSchema(BaseModel):
        provider: str = Field(..., description="Provider to list models for (e.g., 'openai' or 'o')")
  • Registration of the 'list_models' tool in the server's list_tools() method, including name, description, and input schema.
    Tool(
        name=JustPromptTools.LIST_MODELS,
        description="List all available models for a specific LLM provider",
        inputSchema=ListModelsSchema.schema(),
    ),
  • Core list_models function imported and used by the handler; validates the provider and routes to ModelRouter for model listing.
    def list_models(provider: str) -> List[str]:
        """
        List available models for a provider.
        
        Args:
            provider: Provider name (full or short)
            
        Returns:
            List of model names
        """
        # Validate provider
        validate_provider(provider)
        
        # Get models from provider
        return ModelRouter.route_list_models(provider)
  • ModelRouter.route_list_models dynamically imports the provider-specific module and calls its list_models() method to retrieve available models.
    def route_list_models(provider_name: str) -> List[str]:
        """
        Route a list_models request to the appropriate provider.
    
        Args:
            provider_name: Provider name (full or short)
    
        Returns:
            List of model names
        """
        provider = ModelProviders.from_name(provider_name)
    
        if not provider:
            raise ValueError(f"Unknown provider: {provider_name}")
    
        # Import the appropriate provider module
        try:
            module_name = f"just_prompt.atoms.llm_providers.{provider.full_name}"
            provider_module = importlib.import_module(module_name)
    
            # Call the list_models function
            return provider_module.list_models()
        except ImportError as e:
            logger.error(f"Failed to import provider module: {e}")
            raise ValueError(f"Provider not available: {provider.full_name}")
        except Exception as e:
            logger.error(f"Error listing models for {provider.full_name}: {e}")
            raise
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states it's a list operation (implied read-only) but doesn't disclose important behavioral traits like whether it requires authentication, rate limits, pagination behavior, error handling, or what format the returned models list will have. The description is minimal and lacks operational context.

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?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. However, it could be more front-loaded with critical information about behavioral aspects given the lack of annotations.

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

Completeness2/5

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

For a tool with no annotations, no output schema, and minimal description, the contextual information is insufficient. The description doesn't explain what 'available models' means (e.g., supported models, all models including deprecated ones), doesn't describe the return format, and provides no error handling or authentication context.

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?

The schema description coverage is 100%, so the input schema already fully documents the single 'provider' parameter with examples. The description adds no additional parameter semantics beyond what's in the schema, maintaining the baseline score of 3 for adequate coverage when schema does the heavy lifting.

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?

The description clearly states the action ('List all available models') and the target resource ('for a specific LLM provider'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'list_providers' which might be conceptually related but serves a different function.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives, prerequisites, or contextual constraints. It mentions 'specific LLM provider' but doesn't explain how to determine which provider to use or what happens if an invalid provider is specified.

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

Install Server

Other Tools

Related Tools

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/disler/just-prompt'

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