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
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Model alias; agent-default means the host's own model. | agent-default |
| prompt | Yes | The raw prompt text to complete. No chat formatting applied. | |
| persona | No | Optional 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_tokens | No | Maximum tokens to generate. | |
| temperature | No | Sampling temperature, if the host honors it. | |
| previous_response_id | No | Optional 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
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |