Skip to main content
Glama

ollama_generate

Read-only

Generate single-turn text completions from Ollama models for code, summarization, translation, and other one-shot tasks without conversation history.

Instructions

Generate a single-turn text completion from an Ollama model without conversation history. Use this tool for one-shot tasks: code generation, text transformation, summarization, translation, or any prompt that does not require prior context. Do not use this for multi-turn conversations where message history matters; use ollama_chat instead. Prerequisites: The 'model' must already be installed. Call ollama_list_models to verify; use ollama_pull_model to download if missing. Behavior: Read-only, not idempotent — each call produces a different generation even with identical inputs. No authentication required. No rate limits. Network-dependent; response time varies with model size and prompt length. Safe to retry on timeout. On model-not-found error, returns an error object without throwing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYesExact Ollama model identifier. Must match a 'name' from ollama_list_models (e.g., 'llama3.1:8b', 'codellama:13b'). If unsure, call ollama_list_models first.
promptYesThe input text prompt to generate a completion from. Can be any length — the model's context window is the only limit.
systemNoSystem prompt to set model behavior, persona, or output format constraints for this generation.
max_tokensNoMaximum tokens to generate. Maps to Ollama 'num_predict'. Use -1 for unlimited (model stops at its natural end token).
temperatureNoSampling temperature. 0.0 = deterministic, 2.0 = maximum randomness. Default is model-dependent. Use low values for factual/code tasks.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNoError message if the request failed. Only present on failure.
modelYesThe model that generated the response.
responseNoThe generated text completion.
eval_countNoNumber of tokens generated.
total_durationNoTotal time in nanoseconds including load and inference.
Behavior5/5

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

Description states read-only, not idempotent (each call produces different output), no authentication, no rate limits, network-dependent, safe to retry on timeout, and error handling. This adds significant context beyond annotations (readOnlyHint: true, etc.) and does not contradict them.

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?

Description is a single paragraph but well-structured: starts with purpose, then use cases, prerequisites, behavioral details. Every sentence adds unique value. Slightly longer than minimal but no redundancy, and front-loaded.

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 tool's complexity (5 params), presence of output schema, and sibling tools, the description covers purpose, usage guidelines, prerequisites, behavior, and error handling. With output schema existing, it doesn't need to explain return values. Complete for selecting and invoking.

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 description coverage is 100%, but the description adds valuable context: suggests calling ollama_list_models for model parameter, explains prompt length is context-window limited, maps max_tokens to Ollama 'num_predict', and gives usage tips for temperature. Goes beyond schema but is not essential since schema already covers basics.

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?

Clearly states 'Generate a single-turn text completion from an Ollama model without conversation history.' Uses specific verb and resource, lists use cases (code generation, etc.), and explicitly distinguishes from sibling ollama_chat (multi-turn).

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

Usage Guidelines5/5

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

Explicitly tells when to use (one-shot tasks) and when not to (multi-turn conversations), directing to ollama_chat. Also provides prerequisites: model must be installed, with instructions to verify via ollama_list_models and pull via ollama_pull_model.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/VrtxOmega/Ollama-Omega'

If you have feedback or need assistance with the MCP directory API, please join our Discord server