diff --git a/packages/types/src/mcp.ts b/packages/types/src/mcp.ts index f1bfde325d..613a4e4da8 100644 --- a/packages/types/src/mcp.ts +++ b/packages/types/src/mcp.ts @@ -99,22 +99,48 @@ export type McpResourceResponse = { }> } +/** + * Annotations that can be attached to content items in MCP tool call responses. + * Used to indicate audience targeting, priority, and modification timestamps. + */ +export type McpContentAnnotations = { + audience?: Array<"user" | "assistant"> + priority?: number + lastModified?: string +} + export type McpToolCallResponse = { _meta?: Record // eslint-disable-line @typescript-eslint/no-explicit-any content: Array< | { type: "text" text: string + annotations?: McpContentAnnotations + _meta?: Record } | { type: "image" data: string mimeType: string + annotations?: McpContentAnnotations + _meta?: Record } | { type: "audio" data: string mimeType: string + annotations?: McpContentAnnotations + _meta?: Record + } + | { + type: "resource_link" + uri: string + name: string + description?: string + mimeType?: string + title?: string + annotations?: McpContentAnnotations + _meta?: Record } | { type: "resource" @@ -123,9 +149,13 @@ export type McpToolCallResponse = { mimeType?: string text?: string blob?: string + _meta?: Record } + annotations?: McpContentAnnotations + _meta?: Record } > + structuredContent?: Record isError?: boolean } diff --git a/src/core/tools/UseMcpToolTool.ts b/src/core/tools/UseMcpToolTool.ts index 7cbc09bfd7..2bdc0cca18 100644 --- a/src/core/tools/UseMcpToolTool.ts +++ b/src/core/tools/UseMcpToolTool.ts @@ -271,6 +271,13 @@ export class UseMcpToolTool extends BaseTool<"use_mcp_tool"> { const { blob: _, ...rest } = item.resource return JSON.stringify(rest, null, 2) } + if (item.type === "resource_link") { + const { uri, name, description, mimeType } = item + const parts: Record = { uri, name } + if (description) parts.description = description + if (mimeType) parts.mimeType = mimeType + return JSON.stringify(parts, null, 2) + } if (item.type === "image") { // Handle image content (MCP image content has mimeType and data properties) if (item.mimeType && item.data) {