Skip to main content
Glama

list_models

Retrieve a comprehensive list of all downloaded Ollama models available on the MCP Ollama Server for easy access and management.

Instructions

List all downloaded Ollama models

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Implementation of the 'list_models' tool handler. Decorated with @mcp.tool() which registers it. Uses ollama.list() to fetch models and formats their names, sizes, and modification times.
    @mcp.tool() async def list_models() -> str: """List all downloaded Ollama models""" try: models = ollama.list() if not models.get('models'): return "No models found" formatted_models = [] for model in models['models']: formatted_models.append( f"Name: {model.get('model', 'Unknown')}\n" f"Size: {model.get('size', 'Unknown')}\n" f"Modified: {model.get('modified_at', 'Unknown')}\n" "---" ) return "\n".join(formatted_models) except Exception as e: return f"Error listing models: {str(e)}"

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/emgeee/mcp-ollama'

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