Skip to main content
Glama

LM Studio: embeddings

embed
Idempotent

Generate vector representations for texts with a local model, returning dimensions and a cosine-similarity matrix; request raw vectors only when needed.

Instructions

Embed texts with a local embedding model. Returns the dimensions and the cosine-similarity matrix between the texts; raw vectors only on request.

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>",
      "texts": "<texts>"
    },
    "name": "embed"
  }
}

Input Schema

NameRequiredDescriptionDefault
modelYesEmbedding model key (list_models with type embedding).
textsYesTexts to embed.
include_vectorsNoAlso return the raw vectors (large).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already cover safety and idempotency, so the bar is lower, and the description still adds real value by disclosing the returned artifacts (dimensions plus a pairwise cosine-similarity matrix) and that vectors are omitted unless requested. It does not discuss cost, failures, or model-loading side effects, which is the main remaining gap for a tool annotated readOnlyHint=false.

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?

Two sentences, front-loaded with the action, then the return contract — no filler. The clause about vectors is placed where it usefully qualifies the described output rather than buried.

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 no output schema, the description correctly carries the burden of explaining return values, and it does so compactly for a simple three-parameter tool. It stops short of saying what happens if the model is unavailable or not loaded, which would have made it fully self-sufficient.

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 coverage is 100%, so model, texts, and include_vectors are already documented and the baseline is 3. The phrase "raw vectors only on request" reinforces include_vectors but adds no format or sizing guidance beyond what the schema states.

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 specific verb and resource ("Embed texts") with an explicit qualifier ("local embedding model"), and immediately clarifies the return shape. It cannot be confused with chat or model-management siblings because the operation and its output are both named.

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?

Usage is implied by "Embed texts with a local embedding model" and the note that raw vectors come only on request, which hints at default vs. opt-in behavior. However, there is no explicit when-to-use/when-not guidance, no mention of whether the model must be loaded first, and no routing to siblings such as list_models or load_model.

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