Skip to content

Commit e6192bc

Browse files
committed
fix(mcp): adding passthrough types
1 parent 17b753c commit e6192bc

2 files changed

Lines changed: 28 additions & 24 deletions

File tree

packages/types/src/mcp.ts

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -99,32 +99,32 @@ export type McpResourceResponse = {
9999
}>
100100
}
101101

102+
export type McpResourceLinkAnnotations = {
103+
audience?: ("user" | "assistant")[]
104+
priority?: number
105+
lastModified?: string
106+
}
107+
108+
// Defined in MCP spec 2025-06-18: https://modelcontextprotocol.io/specification/2025-06-18/server/tools
109+
export type McpResourceLink = {
110+
type: "resource_link"
111+
uri: string
112+
name: string
113+
description?: string
114+
mimeType?: string
115+
title?: string
116+
size?: number
117+
annotations?: McpResourceLinkAnnotations
118+
}
119+
102120
export type McpToolCallResponse = {
103121
_meta?: Record<string, any> // eslint-disable-line @typescript-eslint/no-explicit-any
104122
content: Array<
105-
| {
106-
type: "text"
107-
text: string
108-
}
109-
| {
110-
type: "image"
111-
data: string
112-
mimeType: string
113-
}
114-
| {
115-
type: "audio"
116-
data: string
117-
mimeType: string
118-
}
119-
| {
120-
type: "resource"
121-
resource: {
122-
uri: string
123-
mimeType?: string
124-
text?: string
125-
blob?: string
126-
}
127-
}
123+
| { type: "text"; text: string }
124+
| { type: "image"; data: string; mimeType: string }
125+
| { type: "audio"; data: string; mimeType: string }
126+
| { type: "resource"; resource: { uri: string; mimeType?: string; text?: string; blob?: string } }
127+
| McpResourceLink
128128
>
129129
isError?: boolean
130130
}

src/core/tools/UseMcpToolTool.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ClineAskUseMcpServer, McpExecutionStatus } from "@roo-code/types"
1+
import type { ClineAskUseMcpServer, McpExecutionStatus, McpResourceLink } from "@roo-code/types"
22

33
import { Task } from "../task/Task"
44
import { formatResponse } from "../prompts/responses"
@@ -282,6 +282,10 @@ export class UseMcpToolTool extends BaseTool<"use_mcp_tool"> {
282282
}
283283
return ""
284284
}
285+
if (item.type === "resource_link") {
286+
const link = item as McpResourceLink
287+
return `[${link.name}](${link.uri})${link.description ? ` — ${link.description}` : ""}`
288+
}
285289
return ""
286290
})
287291
.filter(Boolean)

0 commit comments

Comments
 (0)