Skip to main content
Glama

ollama_generate

Read-only

Generate text completions for one-shot tasks like code generation, summarization, translation, or text transformation using Ollama models 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.
temperatureNoSampling temperature. 0.0 = deterministic, 2.0 = maximum randomness. Default is model-dependent. Use low values for factual/code tasks.
max_tokensNoMaximum tokens to generate. Maps to Ollama 'num_predict'. Use -1 for unlimited (model stops at its natural end token).
systemNoSystem prompt to set model behavior, persona, or output format constraints for this generation.

Output Schema

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

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

The description adds valuable behavioral context beyond what annotations provide: it explains that each call produces different generations even with identical inputs (reinforcing idempotentHint: false), mentions network dependency and variable response time, specifies safety for retry on timeout, and details error behavior for model-not-found cases. While annotations cover read-only, non-destructive, and open-world aspects, the description enriches understanding of operational characteristics.

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?

The description is efficiently structured and front-loaded with the core purpose, followed by usage guidelines, prerequisites, and behavioral details. Every sentence serves a clear purpose without redundancy, making it easy to parse while remaining comprehensive.

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 (generative AI operation), rich annotations, complete schema coverage, and presence of an output schema, the description provides excellent contextual completeness. It covers purpose, usage boundaries, prerequisites, behavioral traits, and error handling, leaving no significant gaps for agent understanding.

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?

With 100% schema description coverage, the input schema already documents all parameters thoroughly. The description doesn't add significant parameter-specific information beyond what's in the schema, though it implies the 'model' parameter's importance through prerequisite mentions. This meets the baseline expectation when schema coverage is complete.

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 with specific verb ('Generate a single-turn text completion') and resource ('from an Ollama model'), distinguishing it from sibling tools by explicitly contrasting with ollama_chat for multi-turn conversations. It provides concrete examples of use cases (code generation, text transformation, summarization, translation).

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?

The description provides explicit guidance on when to use this tool ('one-shot tasks without conversation history') and when not to use it ('multi-turn conversations where message history matters'), naming the alternative tool (ollama_chat). It also includes prerequisites (model must be installed) and references to verification/download tools (ollama_list_models, 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