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
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | json |
Implementation Reference
- src/tools/ps.ts:10-17 (handler)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); }
- src/schemas.ts:193-198 (schema)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); }, };