ollama_list
View installed Ollama models with details like names, sizes, and modification dates in JSON or Markdown format.
Instructions
List all available Ollama models installed locally. Returns model names, sizes, and modification dates.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Output format (default: json) | json |
Implementation Reference
- src/tools/list.ts:9-16 (handler)Core handler function that calls ollama.list() to retrieve available models and formats the JSON response.export async function listModels( ollama: Ollama, format: ResponseFormat ): Promise<string> { const response = await ollama.list(); return formatResponse(JSON.stringify(response), format); }
- src/tools/list.ts:21-39 (registration)Exports the toolDefinition object with name 'ollama_list', description, input schema, and handler reference. This is discovered and registered by the autoloader from src/autoloader.ts.export const toolDefinition: ToolDefinition = { name: 'ollama_list', description: 'List all available Ollama models installed locally. Returns model names, sizes, and modification dates.', inputSchema: { type: 'object', properties: { format: { type: 'string', enum: ['json', 'markdown'], description: 'Output format (default: json)', default: 'json', }, }, }, handler: async (ollama: Ollama, args: Record<string, unknown>, format: ResponseFormat) => { return listModels(ollama, format); }, };
- src/schemas.ts:57-59 (schema)Zod schema specifically for validating inputs to the ollama_list tool.export const ListModelsInputSchema = z.object({ format: ResponseFormatSchema.default('json'), });