Example with arguments
Example with argumentsSchema
Fields
arguments
When you register a prompt with a literal arguments array, Redop infers the handler arguments shape from that definition.
{ name: "text", required: true }becomesarguments.text: string{ name: "length" }becomesarguments.length?: string- prompts without an
argumentsdefinition receiveargumentsasundefined
argumentsSchema
argumentsSchema accepts the same schema styles Redop supports for tool inputSchema.
- Standard Schema V1 libraries such as Zod, Valibot, and ArkType
- TypeBox
- plain JSON Schema
argumentsSchema is present, the prompt handler receives the parsed schema output instead of a raw Record<string, string>.
If you omit arguments, Redop derives prompt argument metadata from an object-shaped argumentsSchema when possible.
When both are defined
Defining botharguments and argumentsSchema does not throw by itself.
Redop resolves them like this:
argumentscontrols prompt metadata returned to clientsargumentsdrives the early missing-required-argument checkargumentsSchemaparses and validates the incoming argumentsargumentsSchemadetermines the handlerargumentstype
arguments, when both are present.
If the two definitions disagree, metadata and runtime validation can drift. Redop does not currently reject that mismatch automatically.
Use both fields only when you need custom metadata and schema-based parsing at the same time, and keep them aligned.
Prompt naming
Prompt names are validated when you call.prompt(name, def).
- use a stable identifier such as
code_revieworsummarise - keep names within 64 characters
- use letters, numbers,
_,-,., and/ - avoid spaces and trailing whitespace
Prompt message content
Prompt messages can contain:- text
- image data
- embedded resource payloads
Notes
- Use
afterResponsefor analytics or logging that should happen after the prompt response is already sent. - Use
afterinstead when the logic must still be able to replace the successful prompt result.