Skip to main content
Glama

lmstudio_optimize_settings

Finds model load settings that fit your hardware by testing context length, GPU offload, and KV-cache precision against LM Studio's memory estimator, then optionally loads the chosen configuration.

Instructions

Find the best load settings for a model on this hardware, using LM Studio's own memory estimator (no guessing). Searches context length, GPU offload and KV-cache precision so the model fits VRAM/RAM with headroom. Goals: balanced (32k context, full GPU if possible), max_context (largest context that fits), max_speed (everything on GPU, 8k context), max_quality (unquantized KV cache). Set apply=true to load it.

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

Input Schema

NameRequiredDescriptionDefault
goalNoDefault balanced.
applyNoLoad the model with the chosen settings (default false = just recommend).
modelYesModel key (partial names work if unique).
identifierNo
min_contextNoNever pick less than this (default 4096).
single_userNoSet max_parallel_predictions=1 so one conversation gets the full context and speed (default true).
ttl_secondsNo
replace_loadedNoWhen applying, first unload instances of this same model (default true).
target_contextNoDesired context; overrides the goal's default.
ram_headroom_pctNoRAM to keep free (default 20).
vram_headroom_pctNoVRAM to keep free for the OS/other apps (default 10).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.7/5.0
Behavior3/5

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

Annotations only declare openWorldHint=false and destructiveHint=false; the description adds real behavioral context by disclosing that apply=true performs the load and that replace_loaded defaults to unloading existing instances of the same model, which an agent should know before mutating state. It does not state how long a search takes, whether failures leave the previously loaded model untouched, or what the recommendation contains.

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

Conciseness4/5

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

Front-loaded with the verb and mechanism, then goals, then the apply instruction — each sentence carries distinct information with no filler. The goal clause is dense but earns its length by defining four enum values that would otherwise be opaque.

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

Completeness3/5

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

For an 11-parameter tool with no output schema, the definition covers the decision inputs well but never says what a recommendation looks like (which fields come back, how the chosen settings are reported), leaving the agent to infer the return shape. It is also silent on the interaction between min_context, target_context, and the goal's default when they conflict.

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

Parameters4/5

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

Schema coverage is already 82%, so the baseline is 3, and the description adds meaning beyond it by spelling out what each goal concretely targets (32k context with full GPU, largest fitting context, all-on-GPU at 8k, unquantized KV cache) rather than just listing enum values. It also summarizes the apply=true semantics, though it leaves identifier, ttl_seconds, and the headroom knobs to the schema.

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

Purpose4/5

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

Names a specific verb and resource ('Find the best load settings for a model on this hardware') and pins the mechanism ('LM Studio's own memory estimator, no guessing'), which separates it from a plain load call. It doesn't explicitly name which sibling to use instead when settings are already known, so differentiation is implied rather than stated.

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?

Gives clear decision context by enumerating the four goals and what each optimizes for, plus the apply=true condition that turns a recommendation into an actual load. What's missing is explicit routing guidance for the adjacent cases (e.g., 'if you already know the settings, use lmstudio_load_model') and any note on when optimization is unnecessary.

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