Skip to main content
Glama
Local AI MCP

Local AI MCP

Official
by TMHSDigital

Fit check

fit_check
Read-onlyIdempotent

Check whether a model fits on this machine and where it will run by estimating weights and KV cache against free VRAM and RAM, returning GPU, partial GPU+CPU, CPU, or none.

Instructions

Will a model run on this machine, and where? Uses the installed model's size and exact layer architecture when the runtime exposes it (else parameter-count or catalog estimates) to size weights + KV cache for a context length, then compares with free VRAM summed across GPUs and available RAM. Returns target gpu / partial (GPU+CPU split) / cpu / none, with the numbers and how the KV estimate was made. Credits back memory the model already uses if it is loaded.

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": "fit_check"
  }
}

Input Schema

NameRequiredDescriptionDefault
modelYesModel id/name to check
providerNoProvider instance name. Omit to let the server choose (local providers only, unless LOCAL_AI_ALLOW_HOSTED_FALLBACK is set).
sizeBytesNoExplicit weight size in bytes (overrides lookup)
kvCacheTypeNoKV cache precision: f16 (default), q8_0, q4_0
contextLengthNoContext length for the KV-cache estimate (default 4096)
parameterSizeNoParameter size like "7B" (overrides lookup)

Output Schema

NameRequiredDescriptionDefault
fitsYes
noteYes
modelYes
loadedYes
targetYes
sizeSourceYes
requiredBytesYes
availableBytesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed12 schema fields changedv0.5.0
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedInput schema / properties / contextLength / description
      Previous value: -"Context length for KV-cache estimate (default 4096)"New value: +"Context length for the KV-cache estimate (default 4096)"
    • addedInput schema / properties / contextLength / exclusiveMinimum
      Added value: +0
    • addedInput schema / properties / contextLength / maximum
      Added value: +9007199254740991
    • changedInput schema / properties / contextLength / type
      Previous value: -"number"New value: +"integer"
    • addedInput schema / properties / kvCacheType
      Added value: +{
      +  "description": "KV cache precision: f16 (default), q8_0, q4_0",
      +  "enum": [
      +    "f16",
      +    "q8_0",
      +    "q4_0"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / parameterSize / description
      Previous value: -"Optional parameter size like \"7B\" or \"3.8B\" for KV estimate (overrides lookup)"New value: +"Parameter size like \"7B\" (overrides lookup)"
    • changedInput schema / properties / provider / description
      Previous value: -"Optional provider id"New value: +"Provider instance name. Omit to let the server choose (local providers only, unless LOCAL_AI_ALLOW_HOSTED_FALLBACK is set)."
    • changedInput schema / properties / provider / enum
      Previous value: -[
      -  "ollama",
      -  "lmstudio",
      -  "moonshot",
      -  "openaicompat",
      -  "llamacpp"
      -]New value: +[
      +  "ollama",
      +  "lmstudio",
      +  "llamacpp",
      +  "dockermodelrunner"
      +]
    • changedInput schema / properties / sizeBytes / description
      Previous value: -"Optional explicit model weight size in bytes (overrides lookup)"New value: +"Explicit weight size in bytes (overrides lookup)"
    • addedInput schema / properties / sizeBytes / exclusiveMinimum
      Added value: +0
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "availableBytes": {
      +      "type": "number"
      +    },
      +    "fits": {
      +      "type": "boolean"
      +    },
      +    "loaded": {
      +      "type": "boolean"
      +    },
      +    "model": {
      +      "type": "string"
      +    },
      +    "note": {
      +      "type": "string"
      +    },
      +    "requiredBytes": {
      +      "type": "number"
      +    },
      +    "sizeSource": {
      +      "type": "string"
      +    },
      +    "target": {
      +      "enum": [
      +        "gpu",
      +        "partial",
      +        "cpu",
      +        "none"
      +      ],
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "model",
      +    "fits",
      +    "target",
      +    "sizeSource",
      +    "loaded",
      +    "requiredBytes",
      +    "availableBytes",
      +    "note"
      +  ],
      +  "type": "object"
      +}
  2. First observedv0.4.0

TDQS

A4.8/5.0
Behavior5/5

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

The description reveals complex internal behavior beyond annotations, detailing how it uses model architecture, estimates memory for weights and KV cache, and crucially, how it credits back memory for already loaded models.

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?

Despite being a long paragraph, the description is highly efficient. It flows logically from the question (will it run?) to the mechanism (calculation) to the output (target resource), with no redundant phrasing.

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?

Given the technical complexity involving VRAM, KV cache, and resource allocation strategies, the description is complete. It details all necessary components of the check, including fallback mechanisms and memory accounting.

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

Parameters5/5

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

The description is highly semantic, explaining exactly which parameters drive the resource calculation—for instance, referencing 'layer architecture' and 'KV cache for a context length.' This adds significant value over the 100% schema coverage.

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 clearly states the tool's purpose: to determine if a model will run on the machine and precisely where (GPU/CPU/Partial). It distinguishes itself by focusing on resource compatibility rather than merely listing models.

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

Usage Guidelines4/5

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

While it does not explicitly name sibling tools it replaces, its function is clearly defined as a resource pre-check prerequisite, which provides sufficient operational context for its use case.

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