Skip to main content
Glama

generate

Generate a raw text completion from a plain prompt string. The prompt is sent as a single user sampling message with no system prompt and no chat formatting: raw prompt in, completion text out, produced by the host agent's own model.

Instructions

Generate a raw text completion from a plain prompt string. The prompt is sent as a single user sampling message with no system prompt and no chat formatting: raw prompt in, completion text out, produced by the host agent's own model. Same model hint and parameters as the other completion tools, minus any chat or tool features: no tools, no output_schema, no tool_choice. It does accept the optional persona contract ({name, input_schema, output_schema}): request/response validation only, never a sampling feature, so the thin path stays zero overhead. Session cursors: the server keeps no session state. previous_response_id '' mints a cursor over the current prompt and completion, returned as JSON '{"completion": "", "response_id": "cur_<...>"}' instead of plain text; when omitted the tool returns plain text exactly as before. generate has no structured history channel (the prompt is the only input), so a 'cur_' cursor can never be verified here: passing one fails loud instead of silently skipping the check. The cursor is 'cur_' + sha256 over canonical JSON '{"model","tool","transcript"}' (sorted keys, compact separators) with the transcript [{"role": "user", "content": }, {"role": "assistant", "content": }], so the caller can recompute it. No API key is used or needed: the connected agent is the model.

Input Schema

NameRequiredDescriptionDefault
modelNoModel alias; agent-default means the host's own model.agent-default
promptYesThe raw prompt text to complete. No chat formatting applied.
personaNoOptional persona contract for this call: {name, input_schema, output_schema}. name is required and non-empty; the server is stateless and keeps no persona registry. When input_schema is given, the request arguments (prompt, model, temperature, max_tokens, previous_response_id) are validated against it before anything is sent. When output_schema is given, the host's completion text must parse as JSON validating against it.
max_tokensNoMaximum tokens to generate.
temperatureNoSampling temperature, if the host honors it.
previous_response_idNoOptional session cursor for host-owned continuations. '' mints a cursor over the current prompt and completion, returned as JSON '{"completion": "<text>", "response_id": "cur_<...>"}' instead of plain text; when omitted the tool returns plain text exactly as before. generate has no structured history channel, so a 'cur_' cursor can never be verified here and fails loud rather than silently skipping the check.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.2

TDQS

A4.1/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: it discloses statelessness ('the server keeps no session state'), the exact return shape when previous_response_id is '' versus omitted, that persona validation is request/response validation 'never a sampling feature', that 'cur_' cursors cannot be verified here and 'fail loud', and that no API key is used. That is a rich, non-obvious behavioral profile including error semantics and auth.

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?

Purpose and the raw-vs-chat distinction are front-loaded, then the cursor contract, and every block is bounded. There is noticeable duplication: the previous_response_id paragraph repeats almost verbatim the schema's own parameter description, and the sha256 canonical-JSON recipe is heavier than selection or invocation needs.

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?

For a stateless completion tool with 6 params, an output schema and no annotations, the description supplies the missing pieces an agent would otherwise have to guess: no state is kept, how the cursor variant changes the return type, that unverifiable cursors error rather than silently pass, and that no credentials are needed. Nothing needed to call this correctly is absent.

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 100%, so baseline is 3, and the description genuinely adds beyond it: persona is framed as validation-only and zero-overhead on the thin path, and previous_response_id is explained in terms of what the '' value mints, the resulting JSON shape, and the fail-loud limitation specific to this tool. The model parameter's 'agent-default' meaning is reinforced. It does not add new guidance for temperature or max_tokens beyond 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?

Opens with a specific verb+resource ('Generate a raw text completion from a plain prompt string') and defines the mechanism precisely: single user message, no system prompt, no chat formatting. It distinguishes itself from the other completion tools by feature subtraction ('no tools, no output_schema, no tool_choice'), though it never names the siblings it contrasts with, so the differentiation is real but indirect.

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?

The description makes clear the context where this tool applies (raw prompt in, completion out, no chat formatting), which implicitly routes chat/tool use elsewhere. However, it never explicitly names chat_complete, messages_create, or responses_create as the alternatives or states the condition that selects them. 'Same model hint and parameters as the other completion tools, minus...' gestures at siblings without giving the agent a decision rule.

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