ollama_status
Check if the Ollama server is reachable and retrieve its version. Use this health check as a precondition before other tools.
Instructions
Health check: whether the Ollama server is reachable and its version. Use this as a precondition before other tools if you're unsure whether Ollama is running.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- server.js:117-127 (handler)The `ollamaStatus` function is the handler for the ollama_status tool. It performs a health check by hitting GET / and GET /api/version on the Ollama server, returning reachability, root message, and version info.
async function ollamaStatus() { const root = await httpRequest('GET', '/'); if (root.error) return errorResult(root.error); const ver = await httpRequest('GET', '/api/version'); return textResult({ url: OLLAMA_URL, reachable: true, root_message: root.text || (root.data ? JSON.stringify(root.data) : ''), version: ver.data?.version || null, }); } - server.js:116-127 (handler)The complete handler function for ollama_status with its comment header.
// ─── Tool: ollama_status ────────────────────────────────────────────────── async function ollamaStatus() { const root = await httpRequest('GET', '/'); if (root.error) return errorResult(root.error); const ver = await httpRequest('GET', '/api/version'); return textResult({ url: OLLAMA_URL, reachable: true, root_message: root.text || (root.data ? JSON.stringify(root.data) : ''), version: ver.data?.version || null, }); } - server.js:275-281 (registration)Tool registration entry for 'ollama_status' in the TOOLS array, including name, description, annotations, and inputSchema (empty object since it takes no arguments).
const TOOLS = [ { name: 'ollama_status', description: 'Health check: whether the Ollama server is reachable and its version. Use this as a precondition before other tools if you\'re unsure whether Ollama is running.', annotations: { title: 'Ollama server status', readOnlyHint: true, destructiveHint: false, openWorldHint: false }, inputSchema: { type: 'object', properties: {}, additionalProperties: false }, }, - server.js:385-386 (registration)Registration of the ollamaStatus handler function in the HANDLERS map, mapping the name 'ollama_status' to the function.
const HANDLERS = { ollama_status: ollamaStatus, - server.js:277-281 (schema)Input schema for ollama_status: an empty 'type: object' with no properties and additionalProperties: false, since the tool takes no arguments.
name: 'ollama_status', description: 'Health check: whether the Ollama server is reachable and its version. Use this as a precondition before other tools if you\'re unsure whether Ollama is running.', annotations: { title: 'Ollama server status', readOnlyHint: true, destructiveHint: false, openWorldHint: false }, inputSchema: { type: 'object', properties: {}, additionalProperties: false }, },