Skip to content

Commit 37faf4e

Browse files
YunKuiLucliffhalldsp-ant
authored
Update the concepts docs with the changes from PR modelcontextprotocol#663 (modelcontextprotocol#869)
Signed-off-by: luyunkui <[email protected]> Co-authored-by: Cliff Hall <[email protected]> Co-authored-by: David Soria Parra <[email protected]>
1 parent 3837479 commit 37faf4e

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

docs/legacy/concepts/prompts.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ Each prompt is defined with:
2828
```typescript
2929
{
3030
name: string; // Unique identifier for the prompt
31-
description?: string; // Human-readable description
31+
title?: string; // Optional human-readable name of the prompt for display purposes
32+
description?: string; // Optional human-readable description
3233
arguments?: [ // Optional list of arguments
3334
{
3435
name: string; // Argument identifier
@@ -54,6 +55,7 @@ Clients can discover available prompts by sending a `prompts/list` request:
5455
prompts: [
5556
{
5657
name: "analyze-code",
58+
title: "Request Analyze Code",
5759
description: "Analyze code for potential improvements",
5860
arguments: [
5961
{

docs/legacy/concepts/resources.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ Servers expose a list of resources via the `resources/list` request. Each resour
8383
```typescript
8484
{
8585
uri: string; // Unique identifier for the resource
86-
name: string; // Human-readable name
86+
name: string; // The name of the resource
87+
title?: string; // Optional human-readable name of the resource for display purposes
8788
description?: string; // Optional description
8889
mimeType?: string; // Optional MIME type
8990
size?: number; // Optional size in bytes
@@ -97,7 +98,8 @@ For dynamic resources, servers can expose [URI templates](https://datatracker.ie
9798
```typescript
9899
{
99100
uriTemplate: string; // URI template following RFC 6570
100-
name: string; // Human-readable name for this type
101+
name: string; // The name of the type
102+
title?: string; // Optional Human-readable name of the type for display purposes
101103
description?: string; // Optional description
102104
mimeType?: string; // Optional MIME type for all matching resources
103105
}
@@ -114,6 +116,8 @@ The server responds with a list of resource contents:
114116
contents: [
115117
{
116118
uri: string; // The URI of the resource
119+
name?: string; // The name of the resource
120+
title?: string; // Optional human-readable name of the resource for display purposes
117121
mimeType?: string; // Optional MIME type
118122

119123
// One of:

docs/legacy/concepts/tools.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Each tool is defined with the following structure:
2828
```typescript
2929
{
3030
name: string; // Unique identifier for the tool
31+
title?: string; // Optional human-readable name of the tool for display purposes
3132
description?: string; // Human-readable description
3233
inputSchema: { // JSON Schema for the tool's parameters
3334
type: "object",
@@ -68,6 +69,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
6869
tools: [
6970
{
7071
name: "calculate_sum",
72+
title: "Calculate Sum",
7173
description: "Add two numbers together",
7274
inputSchema: {
7375
type: "object",
@@ -107,6 +109,7 @@ async def list_tools() -> list[types.Tool]:
107109
return [
108110
types.Tool(
109111
name="calculate_sum",
112+
title="Calculate Sum",
110113
description="Add two numbers together",
111114
inputSchema={
112115
"type": "object",
@@ -145,6 +148,7 @@ Tools that interact with the local system:
145148
```typescript
146149
{
147150
name: "execute_command",
151+
title: "Execute Command",
148152
description: "Run a shell command",
149153
inputSchema: {
150154
type: "object",
@@ -163,6 +167,7 @@ Tools that wrap external APIs:
163167
```typescript
164168
{
165169
name: "github_create_issue",
170+
title: "Create GitHub Issue",
166171
description: "Create a GitHub issue",
167172
inputSchema: {
168173
type: "object",
@@ -182,6 +187,7 @@ Tools that transform or analyze data:
182187
```typescript
183188
{
184189
name: "analyze_csv",
190+
title: "Analyze CSV",
185191
description: "Analyze a CSV file",
186192
inputSchema: {
187193
type: "object",
@@ -359,6 +365,7 @@ Here's how to define tools with annotations for different scenarios:
359365
// A read-only search tool
360366
{
361367
name: "web_search",
368+
title: "Web Search",
362369
description: "Search the web for information",
363370
inputSchema: {
364371
type: "object",
@@ -377,6 +384,7 @@ Here's how to define tools with annotations for different scenarios:
377384
// A destructive file deletion tool
378385
{
379386
name: "delete_file",
387+
title: "Delete File",
380388
description: "Delete a file from the filesystem",
381389
inputSchema: {
382390
type: "object",
@@ -397,6 +405,7 @@ Here's how to define tools with annotations for different scenarios:
397405
// A non-destructive database record creation tool
398406
{
399407
name: "create_record",
408+
title: "Create Database Record",
400409
description: "Create a new record in the database",
401410
inputSchema: {
402411
type: "object",
@@ -426,6 +435,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
426435
tools: [
427436
{
428437
name: "calculate_sum",
438+
title: "Calculate Sum",
429439
description: "Add two numbers together",
430440
inputSchema: {
431441
type: "object",

0 commit comments

Comments
 (0)