Skip to content
Merged
15 changes: 12 additions & 3 deletions docs/legacy/concepts/elicitation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ Elicitation supports these primitive types:
"title": "Project Name",
"description": "Name for your new project",
"minLength": 3,
"maxLength": 50
"maxLength": 50,
"default": "my-project"
}
```

Expand All @@ -85,7 +86,8 @@ Elicitation supports these primitive types:
"title": "Port Number",
"description": "Port to run the server on",
"minimum": 1024,
"maximum": 65535
"maximum": 65535,
"default": 3000
}
```

Expand All @@ -107,7 +109,8 @@ Elicitation supports these primitive types:
"type": "string",
"title": "Environment",
"enum": ["development", "staging", "production"],
"enumNames": ["Development", "Staging", "Production"]
"enumNames": ["Development", "Staging", "Production"],
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This goes counter to our other proposal for enums doesn't it?

"default": "development"
}
```

Expand Down Expand Up @@ -220,6 +223,12 @@ const response = await client.request("elicitation/create", {
title: "Use TypeScript",
default: true,
},
port: {
type: "number",
title: "Development Port",
description: "Port number for the dev server",
default: 3000,
},
},
required: ["name", "framework"],
},
Expand Down
11 changes: 8 additions & 3 deletions docs/specification/draft/client/elicitation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ The schema is restricted to these primitive types:
"minLength": 3,
"maxLength": 50,
"pattern": "^[A-Za-z]+$",
"format": "email"
"format": "email",
"default": "[email protected]"
}
```

Expand All @@ -247,7 +248,8 @@ The schema is restricted to these primitive types:
"title": "Display Name",
"description": "Description text",
"minimum": 0,
"maximum": 100
"maximum": 100,
"default": 50
}
```

Expand All @@ -269,7 +271,8 @@ The schema is restricted to these primitive types:
"title": "Display Name",
"description": "Description text",
"enum": ["option1", "option2", "option3"],
"enumNames": ["Option 1", "Option 2", "Option 3"]
"enumNames": ["Option 1", "Option 2", "Option 3"],
"default": "option1"
}
```

Expand All @@ -279,6 +282,8 @@ Clients can use this schema to:
2. Validate user input before sending
3. Provide better guidance to users

All primitive types support optional default values to provide sensible starting points. Clients that support defaults SHOULD pre-populate form fields with these values.

Note that complex nested structures, arrays of objects, and other advanced JSON Schema features are intentionally not supported to simplify client user experience.

## Response Actions
Expand Down
6 changes: 3 additions & 3 deletions docs/specification/draft/schema.mdx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions schema/draft/schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions schema/draft/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1427,6 +1427,7 @@ export interface StringSchema {
minLength?: number;
maxLength?: number;
format?: "email" | "uri" | "date" | "date-time";
default?: string;
}

export interface NumberSchema {
Expand All @@ -1435,6 +1436,7 @@ export interface NumberSchema {
description?: string;
minimum?: number;
maximum?: number;
default?: number;
}

export interface BooleanSchema {
Expand All @@ -1450,6 +1452,7 @@ export interface EnumSchema {
description?: string;
enum: string[];
enumNames?: string[]; // Display names for enum values
default?: string;
}

/**
Expand Down