You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+71Lines changed: 71 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,7 @@ For the full MCP specification, see [modelcontextprotocol.io](https://modelconte
22
22
## Table of Contents
23
23
24
24
-[Usage](#usage)
25
+
-[Tools](#tools)
25
26
-[Resources](#resources)
26
27
-[Prompts](#prompts)
27
28
-[Sampling](#sampling)
@@ -129,6 +130,76 @@ let quit_reason = server.cancel().await?;
129
130
130
131
---
131
132
133
+
## Tools
134
+
135
+
Tools let servers expose callable functions to clients. Each tool has a name, description, and a JSON Schema for its parameters. Clients discover tools via `list_tools` and invoke them via `call_tool`.
The `#[tool]`, `#[tool_router]`, and `#[tool_handler]` macros handle all the wiring. For a tools-only server you can use `#[tool_router(server_handler)]` to skip the separate `ServerHandler` impl:
142
+
143
+
```rust,ignore
144
+
use rmcp::{tool, tool_router, ServiceExt, transport::stdio};
Resources let servers expose data (files, database records, API responses) that clients can read. Each resource is identified by a URI and returns content as text or binary (base64-encoded) data. Resource templates allow servers to declare URI patterns with dynamic parameters.
0 commit comments