Skip to content

Commit b5c238f

Browse files
committed
Update tools
1 parent 85fe3a9 commit b5c238f

File tree

2 files changed

+35
-28
lines changed

2 files changed

+35
-28
lines changed

docs/specification/server/resources.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,17 @@ Resource templates allow servers to expose parameterized resources using [URI te
173173
}
174174
```
175175

176+
### List Changed Notification
177+
178+
When the list of available resources changes, servers that declared the `listChanged` capability **SHOULD** send a notification:
179+
180+
```json
181+
{
182+
"jsonrpc": "2.0",
183+
"method": "notifications/resources/list_changed"
184+
}
185+
```
186+
176187
### Subscriptions
177188

178189
The protocol supports optional subscriptions to resource changes. Clients can subscribe to specific resources and receive notifications when they change:

docs/specification/server/tools.md

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,26 @@ weight: 40
88
**Protocol Revision**: {{< param protocolRevision >}}
99
{{< /callout >}}
1010

11-
The Model Context Protocol (MCP) allows servers to expose tools that can be invoked by language models through clients. Tools enable models to perform actions or retrieve information beyond their training data, such as querying databases, calling external APIs, or executing commands. Each tool is uniquely identified by a name and includes metadata describing its capabilities and requirements.
11+
The Model Context Protocol (MCP) allows servers to expose tools that can be invoked by language models. Tools enable models to interact with external systems, such as querying databases, calling APIs, or performing computations. Each tool is uniquely identified by a name and includes metadata describing its schema.
1212

1313
## User Interaction Model
1414

15-
Tools in MCP are commonly surfaced through AI assistant or chatbot interfaces, where the language model can discover and invoke tools based on the conversation context. A recommended pattern is displaying available tools in the chat interface with visual indicators when they are invoked, along with confirmation prompts for sensitive operations.
15+
Tools in MCP are designed to be **model-controlled**, meaning that the language model can discover and invoke tools automatically based on its contextual understanding and the user's prompts.
1616

17-
However, implementations are free to expose tools through any interface pattern that suits their needs - the protocol itself does not mandate any specific user interaction model.
17+
However, implementations are free to expose tools through any interface pattern that suits their needs&mdash;the protocol itself does not mandate any specific user interaction model.
1818

19-
## Capabilities
20-
21-
Servers that support tools MUST include a `tools` capability in their `ServerCapabilities` during initialization. The basic tools capability can be specified with an empty object:
19+
{{< callout type="warning" >}}
20+
For trust & safety and security, there **SHOULD** always be a human in the loop with the ability to deny tool invocations.
21+
22+
Applications **SHOULD**:
23+
* Provide UI that makes clear which tools are being exposed to the AI model
24+
* Insert clear visual indicators when tools are invoked
25+
* Present confirmation prompts to the user for operations, to ensure a human is in the loop
26+
{{< /callout >}}
2227

23-
```json
24-
{
25-
"capabilities": {
26-
"tools": {}
27-
}
28-
}
29-
```
28+
## Capabilities
3029

31-
For servers that support notifications about tool list changes, the optional `listChanged` property should be set to true:
30+
Servers that support tools **MUST** declare the `tools` capability:
3231

3332
```json
3433
{
@@ -40,13 +39,13 @@ For servers that support notifications about tool list changes, the optional `li
4039
}
4140
```
4241

43-
The `listChanged` property indicates that the server supports notifications about changes to the tool list. When omitted or set to false, clients should not expect to receive tool list change notifications.
42+
`listChanged` indicates whether the server will emit notifications when the list of available tools changes.
4443

4544
## Protocol Messages
4645

4746
### Listing Tools
4847

49-
To discover available tools, clients send a `tools/list` request. This operation supports pagination through the standard cursor mechanism.
48+
To discover available tools, clients send a `tools/list` request. This operation supports [pagination]({{< ref "/specification/server/utilities/pagination" >}}).
5049

5150
**Request:**
5251
```json
@@ -123,7 +122,7 @@ To invoke a tool, clients send a `tools/call` request:
123122

124123
### List Changed Notification
125124

126-
When tools change, servers that support `listChanged` MAY send a notification:
125+
When the list of available tools changes, servers that declared the `listChanged` capability **SHOULD** send a notification:
127126

128127
```json
129128
{
@@ -190,6 +189,9 @@ Tool results can contain multiple content items of different types:
190189
```
191190

192191
#### Embedded Resources
192+
193+
[Resources]({{< ref "/specification/server/resources" >}}) **MAY** be embedded, to provide additional context or data, behind a URI that can be subscribed to or fetched again by the client later:
194+
193195
```json
194196
{
195197
"type": "resource",
@@ -205,12 +207,12 @@ Tool results can contain multiple content items of different types:
205207

206208
Tools use two error reporting mechanisms:
207209

208-
1. Protocol Errors: Standard JSON-RPC errors for issues like:
210+
1. **Protocol Errors**: Standard JSON-RPC errors for issues like:
209211
- Unknown tools
210212
- Invalid arguments
211213
- Server errors
212214

213-
2. Tool Execution Errors: Reported in successful responses with `isError: true`:
215+
2. **Tool Execution Errors**: Reported in tool results with `isError: true`:
214216
- API failures
215217
- Invalid input data
216218
- Business logic errors
@@ -244,21 +246,15 @@ Example tool execution error:
244246

245247
## Security Considerations
246248

247-
1. Servers MUST:
249+
1. Servers **MUST**:
248250
- Validate all tool inputs
249251
- Implement proper access controls
250252
- Rate limit tool invocations
251253
- Sanitize tool outputs
252254

253-
2. Clients SHOULD:
255+
2. Clients **SHOULD**:
254256
- Prompt for user confirmation on sensitive operations
257+
- Show tool inputs to the user before calling the server, to avoid malicious or accidental data exfiltration
255258
- Validate tool results before passing to LLM
256259
- Implement timeouts for tool calls
257260
- Log tool usage for audit purposes
258-
259-
## See Also
260-
261-
{{< cards >}}
262-
{{< card link="/server/utilities/pagination" title="Pagination" icon="document-duplicate" >}}
263-
{{< card link="/server/utilities/progress" title="Progress Tracking" icon="arrow-circle-right" >}}
264-
{{< /cards >}}

0 commit comments

Comments
 (0)