Skip to main content
Glama

check_ollama

Verify the LLM backend is running and the configured embedding or chat model is installed before semantic search, smart search, or symbol explanation, avoiding failed LLM-dependent tool calls.

Instructions

Check whether the LLM backend is running and the configured embedding/chat model is installed.

Read-only: yes. No side effects. Call before smart_search, semantic_search, or explain_symbol (when on-demand fallback is expected — pre-computed analysis returns instantly without the LLM backend).

Args: project_root: Project root. Auto-detected if omitted. Used to locate the project's LLM configuration. project: Project name or project_id — call list_projects to get them. Use it to ask about a project that is not the project of the current directory. It is an alternative to project_root, which takes a root path. Give one of the two, not both.

Returns: dict: {ollama_enabled (bool), status (str — "ok"|"disabled"| "not_configured"|"model_missing"|"embedding_unavailable"|"error"), ollama_running (bool), ollama_url (str), configured_model (str), num_ctx (int), installed_models (list[str]), chat_api (dict — {configured (bool), model (str)}: whether an external chat API replaces Ollama, and the model it names; a configured one adds endpoint, format, and compliance_warning for an external host), configured_embed_model (str), embedding_installed (bool), embedding_backend (str — "ollama", "local" for a sentence-transformers or ft:// model, which needs no Ollama: it counts as installed, and with chat on an external API a stopped Ollama still gives "ok"; or the provider of an API profile of the embeddings, "openrouter" or "openai_compatible"), embedding_compliance_warning (str, when the embeddings go to an external API: the code and each search query leave the machine), version_problem (str, when the Ollama server of ollama_url is older than the oldest version of one of its uses: 0.40.15 for the embeddings, 0.30.1 for the chat), message (str, when status is not "ok"), model_details (list[dict]), suggest_cloud (bool), vec_available (bool), vec_error (str, optional), debug_log (str, optional — only when debug logging is enabled)}

The tool looks for the chat model on the Ollama server of the chat
profile (the ``url`` of an Ollama profile).  A profile of another
provider (an API or the ChatGPT plan) runs the model itself, and
the tool asks no Ollama server for it.  ``"model_missing"``:
``message`` names a command for each missing model, which sets
``OLLAMA_HOST`` to the server that must hold the model.
``"error"`` also means that the Ollama server of the chat profile
gives no model list.  When the Ollama server of the embeddings
(``ollama_url``) does not answer, the tool does not look for the
chat model.

ollama_url, num_ctx, installed_models, model_details,
configured_embed_model, and embedding_installed are present only
when Ollama runs; configured_model also needs chat on Ollama.
``"disabled"`` gives only status, ollama_enabled,
ollama_running, configured_model, num_ctx, and message;
embedding_backend is present on every other status.

What to do for each status:

  • "ok", "disabled": continue. "disabled" means that no tool calls the LLM.

  • "not_configured": when message says that the url of the Ollama profile names a server that is not Ollama, the operator corrects that profile. Else ask the operator: a local Ollama or a cloud service? For a local Ollama, the operator installs it from https://ollama.com (without internet: the installer from a different computer). Do not install Ollama yourself. For a cloud service, the operator runs fw-context llm setup in a terminal, then you call configure_llm(profile=<name>).

  • "model_missing": give the size of each model as your estimate, and say that it can be wrong. Ask: pull the model, or use a cloud service? Run a command of message only after the approval. In a different shell, set OLLAMA_HOST as the command does: without it, the model can go to a different server. When the pull fails on the network, the operator can pull the model on a computer with internet and copy ~/.ollama/models/. With suggest_cloud: true, no installed model is large enough for code: recommend a cloud service.

  • "embedding_unavailable": tell the operator that semantic_search does not work, and give the cause from message.

  • "error": give message to the operator.

  • version_problem, with each status: give it to the operator. An index run does not do the use that it names (no embeddings, or no LLM analysis) until the operator updates Ollama.

WHY these rules are here and not only in the server instructions: an LLM client can cut the instructions of a server (Claude Code keeps approximately 2500 characters), and it always sends the description of a tool.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "check_ollama"
  }
}

Input Schema

NameRequiredDescriptionDefault
projectNoProject name or project_id — call list_projects to get them. Use it to ask about a project that is not the project of the current directory. It is an alternative to project_root, which takes a root path. Give one of the two, not both.
project_rootNoProject root. Auto-detected if omitted. Used to locate LLM config. Falls back to auto-detection when omitted. This field also accepts a project name or a project_id, but project is the clear field for those.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.30.0
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / project
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Project name or project_id — call list_projects to get them. Use it to ask about a project that is not the project of the current directory. It is an alternative to project_root, which takes a root path. Give one of the two, not both.",
      +  "title": "Project"
      +}
    • changedInput schema / properties / project_root / description
      Previous value: -"Project root. Auto-detected if omitted. Used to locate LLM config. Falls back to auto-detection when omitted."New value: +"Project root. Auto-detected if omitted. Used to locate LLM config. Falls back to auto-detection when omitted. This field also accepts a project name or a project_id, but project is the clear field for those."
  2. Changed1 schema field changedv0.25.3
    • changedInput schema / properties / project_root / description
      Previous value: -"Project root. Auto-detected if omitted. Ignored by this tool."New value: +"Project root. Auto-detected if omitted. Used to locate LLM config. Falls back to auto-detection when omitted."
  3. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden and does so: it declares read-only/no side effects, lists the complete return dictionary with per-status field availability rules (e.g. ollama_url and installed_models only when Ollama runs; 'disabled' returns a reduced set), and warns about OLLAMA_HOST misrouting and network-pull fallbacks.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose, read-only status, and Args are front-loaded correctly, but the description runs many hundreds of words with heavily nested parentheticals in the Returns block, and the closing 'WHY these rules are here...' paragraph is meta-commentary about server instructions rather than information the agent needs to invoke the tool. Much of it earns its place given no output schema, but the density is well past minimal.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, and the description fully documents the return structure, conditional field presence, status vocabulary, and remediation steps. For a diagnostic tool with two optional parameters, nothing an agent needs in order to call or interpret it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The Args section largely restates the schema text for project and project_root, adding the useful but duplicated framing that they are mutually exclusive alternatives — it does not add meaning beyond what the schema already documents.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence names a specific verb and resource: 'Check whether the LLM backend is running and the configured embedding/chat model is installed.' It further distinguishes itself by naming the siblings that depend on it (smart_search, semantic_search, explain_symbol) and the exception for pre-computed analysis.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly says when to call it (before LLM-dependent searches) and gives a per-status playbook covering ok/disabled/not_configured/model_missing/embedding_unavailable/error, including escalation to configure_llm(profile=<name>) for the cloud path and an explicit prohibition ('Do not install Ollama yourself'). Alternatives and exclusions are both present.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.