Skip to main content

poem_mcpserver/protocol/
resources.rs

1//! Resource protocol.
2
3use serde::{Deserialize, Serialize};
4
5/// A request to list resources.
6#[derive(Debug, Deserialize, Default)]
7#[serde(rename_all = "camelCase")]
8pub struct ResourcesListRequest {
9    /// The cursor to continue listing tools.
10    pub cursor: Option<String>,
11}
12
13/// Resource information.
14#[derive(Debug, Serialize)]
15#[serde(rename_all = "camelCase")]
16pub struct Resource {
17    /// The uri of the resource.
18    pub uri: String,
19    /// The name of the tool.
20    pub name: String,
21    /// The description of the tool.
22    pub description: String,
23    /// The mime type of the resource.
24    pub mime_type: String,
25}
26
27/// A response to a resources/list request.
28#[derive(Debug, Serialize)]
29#[serde(rename_all = "camelCase")]
30pub struct ResourcesListResponse {
31    /// Resources list.
32    pub resources: Vec<Resource>,
33}