Skip to main content
Glama
hyzhak
by hyzhak

list

Discover and access all available AI models locally using this tool, enabling efficient management and interaction within the Ollama MCP Server framework.

Instructions

List all models in Ollama

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function for the 'list' tool: calls ollama.list(), returns JSON-formatted result or error.
    async () => { try { const result = await ollama.list(); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error: ${formatError(error)}` }], isError: true }; } }
  • Input schema and metadata for the 'list' tool (empty input schema).
    { title: "List models", description: "List all models in Ollama", inputSchema: {}, },
  • src/index.ts:29-44 (registration)
    Full registration of the 'list' tool using server.registerTool.
    server.registerTool( "list", { title: "List models", description: "List all models in Ollama", inputSchema: {}, }, async () => { try { const result = await ollama.list(); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error: ${formatError(error)}` }], isError: true }; } } );
  • Helper function formatError used in the 'list' tool handler for error messages.
    // Helper for error formatting const formatError = (error: unknown): string => error instanceof Error ? error.message : String(error);

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

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