Skip to content

ollama_embed

Embed texts. LOW-LEVEL primitive. Returns raw 768-dim vectors for one text or a batch. WARNING: raw vectors can overflow MCP tool-output limits on large batches — for concept search prefer ollama_embed_search (ephemeral candidates) or ollama_corpus_search (persistent corpora); both return ranked hits, not raw geometry. Use this only for building external vector indexes (sqlite-vss, pgvector) where you need the vectors themselves. Envelope emits a warnings[] entry when the serialized payload crosses ~500KB.

Parameter Type Required Default Description
input string \ string[] yes

The JSON Schema below is generated from the same zod schema the server validates against at the wire — it cannot drift from runtime behavior.

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"input": {
"anyOf": [
{
"type": "string",
"minLength": 1
},
{
"minItems": 1,
"maxItems": 256,
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
}
],
"description": "Text or batch of texts to embed."
}
},
"required": [
"input"
]
}

Every tool returns the standard envelope — tier_used, model, tokens_in/tokens_out, elapsed_ms, backend provenance, warnings. See Envelope & tiers.

Schema + handler: src/tools/embed.ts · registration: src/index.ts


Back to the Tool Reference.