Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
d5b0eab
feat: add SEP draft for full JSON Schema 2020-12 support
olaservo Jan 7, 2026
9c93b3b
fix: update author format in SEP-0000 document
olaservo Jan 7, 2026
8f0b866
fix: update sponsor name format in SEP-0000 document
olaservo Jan 7, 2026
a8ec1c1
SEP-834: Loosen schema type restrictions for full JSON Schema 2020-12…
olaservo Jan 10, 2026
d0467dd
SEP-834: Update reference implementation with weather forecast demo
olaservo Jan 17, 2026
c42cfbc
Update SEP
olaservo Jan 17, 2026
4db09cd
SEP-2106: Rename file and update header per SEP-1850
olaservo Jan 17, 2026
2355d8d
Fix prettier formatting
olaservo Jan 17, 2026
7250539
Regenerate schema.mdx for draft spec changes
olaservo Jan 17, 2026
9cfcdf9
Align SEP with John's original PR #881 intent
olaservo Jan 17, 2026
acdad08
Fix inputSchema to require type: "object" per original intent
olaservo Jan 17, 2026
84e369d
Update SDK reference to 1.25.2-sep834.4
olaservo Jan 18, 2026
8c820f2
Update server reference to 1.1.0-sep834.1
olaservo Jan 18, 2026
8d7334f
Merge branch 'main' into sep-834-json-schema-2020-12
olaservo Jan 26, 2026
c58f0ea
Merge branch 'main' into sep-834-json-schema-2020-12
olaservo Feb 16, 2026
63018d2
Fix SEP-2106 self-references, examples, and add docs page
olaservo Feb 16, 2026
0e595cf
Regenerate SEP docs via render-seps script
olaservo Feb 16, 2026
52a8149
Fix Prettier formatting in SEP-2106
olaservo Feb 16, 2026
af004c5
Merge branch 'main' into sep-834-json-schema-2020-12
olaservo Mar 9, 2026
20a7cf5
Regenerate schema.mdx from schema.ts
olaservo Mar 9, 2026
732bbd9
Merge upstream/main into sep-834-json-schema-2020-12
olaservo May 6, 2026
384764c
Address review feedback on SEP-2106
olaservo May 6, 2026
d28391f
Format docs.json to match render-seps output
olaservo May 6, 2026
9470201
Restore docs/community/seps/2243-http-standardization.mdx
olaservo May 6, 2026
9e878c0
Distinguish original author from current shepherd in SEP-2106
olaservo May 6, 2026
d6b9ce8
Merge upstream/main into sep-834-json-schema-2020-12
olaservo May 12, 2026
763ce86
Re-fix docs.json after upstream merge
olaservo May 13, 2026
d9cea28
Merge remote-tracking branch 'upstream/main' into sep-834-json-schema…
olaservo May 16, 2026
7bff200
Merge main into sep-834-json-schema-2020-12
localden May 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@
{
"group": "Draft",
"pages": [
"seps/2106-json-schema-2020-12",
"seps/2484-conformance-tests-required-for-final-seps"
]
}
Expand Down
427 changes: 427 additions & 0 deletions docs/seps/2106-json-schema-2020-12.mdx

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion docs/seps/index.mdx

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

21 changes: 13 additions & 8 deletions docs/specification/draft/schema.mdx

Large diffs are not rendered by default.

49 changes: 48 additions & 1 deletion docs/specification/draft/server/tools.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ Embedded resources support the same [Resource annotations](/specification/draft/

#### Structured Content

**Structured** content is returned as a JSON object in the `structuredContent` field of a result.
**Structured** content is returned as a JSON value in the `structuredContent` field of a result. This can be any JSON value (object, array, string, number, boolean, or null) that conforms to the tool's `outputSchema` if one is defined.

For backwards compatibility, a tool that returns structured content SHOULD also return the serialized JSON in a TextContent block.

Expand Down Expand Up @@ -545,6 +545,53 @@ Example valid response for this tool:
}
```

Example tool with array output schema:

```json
{
"name": "list_users",
"title": "User List",
"description": "Returns a list of all users",
"inputSchema": {
"type": "object",
"properties": {}
},
"outputSchema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": { "type": "string" },
"name": { "type": "string" },
"email": { "type": "string" }
},
"required": ["id", "name", "email"]
}
}
}
```

Example valid response for a tool with array output:

```json
{
"jsonrpc": "2.0",
"id": 6,
"result": {
"content": [
{
"type": "text",
"text": "Found 2 users: Alice ([email protected]) and Bob ([email protected])."
}
],
"structuredContent": [
{ "id": "1", "name": "Alice", "email": "[email protected]" },
{ "id": "2", "name": "Bob", "email": "[email protected]" }
]
}
}
```

Providing an output schema helps clients and LLMs understand and properly handle structured tool outputs by:

- Enabling strict schema validation of responses
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"resultType": "complete",
"content": [
{
"type": "text",
"text": "Found 2 users: Alice ([email protected]) and Bob ([email protected])."

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Note - example is deliberately aligned with this clarification of content vs structured content audience and format.

}
],
"structuredContent": [
{ "id": "1", "name": "Alice", "email": "[email protected]" },
{ "id": "2", "name": "Bob", "email": "[email protected]" }
]
}
30 changes: 30 additions & 0 deletions schema/draft/examples/Tool/tool-with-array-output-schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "list_users",
"title": "User List",
"description": "Returns a list of all users",
"inputSchema": {
"type": "object",
"properties": {}
},
"outputSchema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "User ID"
},
"name": {
"type": "string",
"description": "User name"
},
"email": {
"type": "string",
"description": "User email"
}
},
"required": ["id", "name", "email"]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "find_resource",
"title": "Resource Finder",
"description": "Find a resource by ID or name",
"inputSchema": {
"type": "object",
"oneOf": [
Comment thread
localden marked this conversation as resolved.
{
"properties": {
"id": {
"type": "string",
"description": "Resource ID"
}
},
"required": ["id"]
},
{
"properties": {
"name": {
"type": "string",
"description": "Resource name"
}
},
"required": ["name"]
}
]
}
}
45 changes: 6 additions & 39 deletions schema/draft/schema.json

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

37 changes: 19 additions & 18 deletions schema/draft/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1641,9 +1641,12 @@ export interface CallToolResult extends Result {
content: ContentBlock[];

/**
* An optional JSON object that represents the structured result of the tool call.
* An optional JSON value that represents the structured result of the tool call.
*
* This can be any JSON value (object, array, string, number, boolean, or null)
* that conforms to the tool's outputSchema if one is defined.
*/
structuredContent?: { [key: string]: unknown };
structuredContent?: unknown;

/**
* Whether the tool call ended in an error.
Expand Down Expand Up @@ -1805,27 +1808,24 @@ export interface Tool extends BaseMetadata, Icons {

/**
* A JSON Schema object defining the expected parameters for the tool.
*
* Tool arguments are always JSON objects, so `type: "object"` is required at the root.
* Beyond that, any JSON Schema 2020-12 keyword may appear alongside `type` — including
* composition keywords (`oneOf`, `anyOf`, `allOf`, `not`), conditional keywords
* (`if`/`then`/`else`), reference keywords (`$ref`, `$defs`, `$anchor`), and any other
* standard validation or annotation keywords.
*
* Defaults to JSON Schema 2020-12 when no explicit `$schema` is provided.
*/
inputSchema: {
$schema?: string;
type: "object";
properties?: { [key: string]: JSONValue };
required?: string[];
};
inputSchema: { $schema?: string; type: "object"; [key: string]: unknown };

/**
* An optional JSON Schema object defining the structure of the tool's output returned in
* the structuredContent field of a {@link CallToolResult}.
* the structuredContent field of a {@link CallToolResult}. This can be any valid JSON Schema 2020-12.
*
* Defaults to JSON Schema 2020-12 when no explicit `$schema` is provided.
* Currently restricted to `type: "object"` at the root level.
*/
outputSchema?: {
$schema?: string;
type: "object";
properties?: { [key: string]: JSONValue };
required?: string[];
};
outputSchema?: { $schema?: string; [key: string]: unknown };

/**
* Optional additional tool information.
Expand Down Expand Up @@ -2240,11 +2240,12 @@ export interface ToolResultContent {
content: ContentBlock[];

/**
* An optional structured result object.
* An optional structured result value.
*
* This can be any JSON value (object, array, string, number, boolean, or null).
* If the tool defined an {@link Tool.outputSchema}, this SHOULD conform to that schema.
*/
structuredContent?: { [key: string]: unknown };
structuredContent?: unknown;

/**
* Whether the tool use resulted in an error.
Expand Down
Loading
Loading