Skip to main content
Glama
Local AI MCP

Local AI MCP

Official
by TMHSDigital

Ensure model is ready

ensure_model
Idempotent

Prepares a local AI model by pulling if needed, checking VRAM fit, evicting models when required, loading it, and verifying readiness; use dryRun to preview the plan.

Instructions

Make a model ready in one call: optionally pull it, check it fits current free VRAM, unload other models if needed (evict: 'lru' or 'all'), load it, and verify. Use dryRun:true to get the plan without changing anything.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "model": "<model>"
    },
    "name": "ensure_model"
  }
}

Input Schema

NameRequiredDescriptionDefault
evictNoUnload other models to make room: none (default), lru (least recently used first), all
modelYesModel id/name
dryRunNoReturn the plan only (default false)
providerNoProvider instance name. Omit to let the server choose (local providers only, unless LOCAL_AI_ALLOW_HOSTED_FALLBACK is set).
allowPullNoDownload the model if it is not installed (default false)
keepAliveNoKeep-alive for the loaded model, e.g. '30m'
kvCacheTypeNoKV cache precision used for the fit estimate (default f16)
contextLengthNoContext window to fit and load with (default 4096)

Output Schema

NameRequiredDescriptionDefault
fitNo
planYes
modelYes
readyYes
providerYes
verifiedNofalse when the runtime could not be asked whether the model is loaded after loading it

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.6.1
    • addedOutput schema / properties / verified
      Added value: +{
      +  "description": "false when the runtime could not be asked whether the model is loaded after loading it",
      +  "type": "boolean"
      +}
  2. Addedv0.5.0

TDQS

A4/5.0
Behavior4/5

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

Annotations declare a non-read-only but non-destructive, idempotent, open-world operation; the description adds the material detail that it may download a model, may unload OTHER loaded models (evict 'lru' or 'all'), and verifies afterward. That side effect on shared state is exactly the kind of context annotations alone would hide, especially given destructiveHint=false. It stops short of saying what happens on fit failure or whether evictions are restored.

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

Conciseness5/5

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

One dense sentence front-loads the outcome and the pipeline in execution order, followed by a single sentence covering the safe-preview mode. There is no filler, and the ordering mirrors how the operation actually proceeds.

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

Completeness4/5

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

With an output schema, full schema coverage, and rich annotations, the description only needs to convey the composite behavior and side effects, which it does. Minor gaps remain around failure modes (what if the model cannot fit even after eviction) and what the verify step returns, but nothing blocking 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% and every parameter, including the evict enum and dryRun, is already documented in the schema. The description restates pull, evict values, and dryRun without adding semantics such as how kvCacheType or contextLength affect the fit estimate. Baseline 3 applies when the schema carries the load.

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 description names a concrete outcome ('make a model ready') and enumerates the exact pipeline it composes: pull, VRAM fit check, evict, load, verify. Because those steps correspond directly to siblings like pull_model, fit_check, load_model, and unload_model, an agent can immediately tell this is the one-call orchestrator rather than any single-step tool.

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

Usage Guidelines3/5

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

The only explicit usage guidance is 'Use dryRun:true to get the plan without changing anything,' which covers the planning case well. There is no statement of when to prefer this over the granular siblings (e.g. when you already know the model is pulled, or when you want to inspect before committing), so the agent must infer the orchestration-vs-single-step tradeoff.

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