feat(mcp): bound tool-result passthrough and surface resource audience annotations
Route CallToolResult content through the render.rs content policy per plans/mcp-resources-prompts-design.md §6 (T8): oversized text sliced at TEXT_MAX_BYTES_CLAMP with a self-explaining truncation note, image/audio/ embedded blob content spilled (or inlined when UTF-8-clean) instead of shipping base64 into model context, and structuredContent subject to the same ceiling. Clamp server-controlled uri/mime metadata strings to the new METADATA_MAX_BYTES bound in both the read and tool-result paths, sanitize the terminal rendering of MCP dispatch errors while keeping raw text in the tool_call_error payload, and surface resource audience annotations in both mcp_search results and mcp_read metadata via the catalog.
This commit is contained in:
@@ -125,6 +125,8 @@ pub struct CatalogItem {
|
||||
pub size: Option<u64>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub arguments: Option<Vec<PromptArgument>>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub audience: Option<Vec<String>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||
|
||||
Reference in New Issue
Block a user