Skip to main content
Glama

ollama_ps

List currently running Ollama models loaded in memory to monitor active instances and manage system resources.

Instructions

List running models. Shows which models are currently loaded in memory.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatNojson

Implementation Reference

  • Core handler function that calls ollama.ps() to list currently running models and formats the response.
    export async function listRunningModels( ollama: Ollama, format: ResponseFormat ): Promise<string> { const response = await ollama.ps(); return formatResponse(JSON.stringify(response), format); }
  • Zod schema used for input validation in the ollama_ps tool handler.
    /** * Schema for ollama_ps tool (list running models) */ export const PsInputSchema = z.object({ format: ResponseFormatSchema.default('json'), });
  • src/tools/ps.ts:19-37 (registration)
    Tool definition registration exporting the 'ollama_ps' tool with name, description, JSON input schema, and handler function.
    export const toolDefinition: ToolDefinition = { name: 'ollama_ps', description: 'List running models. Shows which models are currently loaded in memory.', inputSchema: { type: 'object', properties: { format: { type: 'string', enum: ['json', 'markdown'], default: 'json', }, }, }, handler: async (ollama: Ollama, args: Record<string, unknown>, format: ResponseFormat) => { PsInputSchema.parse(args); return listRunningModels(ollama, format); }, };

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

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