A tool is an action the model calls, while a resource is read-only data the host reads and puts into context.
| Tools | Resources | |
|---|---|---|
| Who invokes it | the model | the host or user |
| Purpose | perform work | supply context |
| Addressed by | name plus arguments | a URI |
| Side effects | allowed | none expected |
| Method | tools/call |
resources/read |
Roughly, resources are GET and tools are POST.
{
"uri": "file:///project/schema.sql",
"name": "Database schema",
"mimeType": "text/plain"
}
Expose data as a resource when it is stable, addressable content a user may want to attach: a file, a schema, a log. Host support varies, though, and some clients ignore resources. If the model itself must fetch the data, also ship a tool.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
The diagram below the answer is the concept . Jump to it ↓