refactor: use MCP resource types for ui/download-file params
Replace custom {filename, content, mimeType, encoding} params with
standard MCP resource types: EmbeddedResource for inline content and
ResourceLink for host-resolved references.
New params shape:
params: { contents: (EmbeddedResource | ResourceLink)[] }
This reuses existing MCP primitives instead of inventing new ones,
and enables hosts to show resource 'bubbles' or resolve ResourceLink
URIs via resources/read on the MCP server.
This commit is contained in:
parent
494c73e7ca
commit
3757271641
1 changed files with 366 additions and 125 deletions
|
|
@ -13,8 +13,10 @@
|
|||
import type {
|
||||
CallToolResult,
|
||||
ContentBlock,
|
||||
EmbeddedResource,
|
||||
Implementation,
|
||||
RequestId,
|
||||
ResourceLink,
|
||||
Tool,
|
||||
} from "@modelcontextprotocol/sdk/types.js";
|
||||
|
||||
|
|
@ -181,14 +183,8 @@ export interface McpUiOpenLinkResult {
|
|||
export interface McpUiDownloadFileRequest {
|
||||
method: "ui/download-file";
|
||||
params: {
|
||||
/** @description Suggested filename for the download. */
|
||||
filename: string;
|
||||
/** @description File content — text or base64-encoded binary. */
|
||||
content: string;
|
||||
/** @description MIME type of the file (e.g. "image/svg+xml", "application/json"). */
|
||||
mimeType: string;
|
||||
/** @description Content encoding. Defaults to "utf-8". Use "base64" for binary content. */
|
||||
encoding?: "utf-8" | "base64";
|
||||
/** @description Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types. */
|
||||
contents: (EmbeddedResource | ResourceLink)[];
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue