ollama_ps
View currently loaded Ollama models to monitor memory usage and manage active instances.
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:7-17 (handler)Core handler logic that invokes ollama.ps() to list running models and formats the output./** * List running models */ export async function listRunningModels( ollama: Ollama, format: ResponseFormat ): Promise<string> { const response = await ollama.ps(); return formatResponse(JSON.stringify(response), format); }
- src/tools/ps.ts:19-37 (registration)Exports the toolDefinition object registering the ollama_ps tool, including its 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); }, };
- 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'), });